chore(deps): bump google.golang.org/api from 0.149.0 to 0.150.0 (#2845)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.149.0 to 0.150.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.149.0...v0.150.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
parent
dd8331d3a9
commit
c2a0ead633
6
go.mod
6
go.mod
|
|
@ -147,9 +147,9 @@ require (
|
|||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/sys v0.14.0
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
golang.org/x/time v0.1.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
google.golang.org/api v0.149.0
|
||||
google.golang.org/api v0.150.0
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
|
||||
google.golang.org/grpc v1.59.0 // indirect
|
||||
|
|
@ -183,7 +183,7 @@ require (
|
|||
github.com/subosito/gotenv v1.2.0 // indirect
|
||||
github.com/toqueteos/webbrowser v1.2.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
|
||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
|
|
|||
12
go.sum
12
go.sum
|
|
@ -919,8 +919,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
|||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.1.0 h1:xYY+Bajn2a7VBmTM5GikTmnK8ZuX8YgnQCqZpbBNtmA=
|
||||
golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
|
||||
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
|
|
@ -1007,8 +1007,8 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR
|
|||
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
|
||||
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
|
||||
google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
|
||||
google.golang.org/api v0.149.0 h1:b2CqT6kG+zqJIVKRQ3ELJVLN1PwHZ6DJ3dW8yl82rgY=
|
||||
google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI=
|
||||
google.golang.org/api v0.150.0 h1:Z9k22qD289SZ8gCJrk4DrWXkNjtfvKAUo/l1ma8eBYE=
|
||||
google.golang.org/api v0.150.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
|
|
@ -1064,8 +1064,8 @@ google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5
|
|||
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func (lim *Limiter) Burst() int {
|
|||
// TokensAt returns the number of tokens available at time t.
|
||||
func (lim *Limiter) TokensAt(t time.Time) float64 {
|
||||
lim.mu.Lock()
|
||||
_, _, tokens := lim.advance(t) // does not mutute lim
|
||||
_, tokens := lim.advance(t) // does not mutate lim
|
||||
lim.mu.Unlock()
|
||||
return tokens
|
||||
}
|
||||
|
|
@ -183,7 +183,7 @@ func (r *Reservation) CancelAt(t time.Time) {
|
|||
return
|
||||
}
|
||||
// advance time to now
|
||||
t, _, tokens := r.lim.advance(t)
|
||||
t, tokens := r.lim.advance(t)
|
||||
// calculate new number of tokens
|
||||
tokens += restoreTokens
|
||||
if burst := float64(r.lim.burst); tokens > burst {
|
||||
|
|
@ -304,7 +304,7 @@ func (lim *Limiter) SetLimitAt(t time.Time, newLimit Limit) {
|
|||
lim.mu.Lock()
|
||||
defer lim.mu.Unlock()
|
||||
|
||||
t, _, tokens := lim.advance(t)
|
||||
t, tokens := lim.advance(t)
|
||||
|
||||
lim.last = t
|
||||
lim.tokens = tokens
|
||||
|
|
@ -321,7 +321,7 @@ func (lim *Limiter) SetBurstAt(t time.Time, newBurst int) {
|
|||
lim.mu.Lock()
|
||||
defer lim.mu.Unlock()
|
||||
|
||||
t, _, tokens := lim.advance(t)
|
||||
t, tokens := lim.advance(t)
|
||||
|
||||
lim.last = t
|
||||
lim.tokens = tokens
|
||||
|
|
@ -356,7 +356,7 @@ func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration)
|
|||
}
|
||||
}
|
||||
|
||||
t, last, tokens := lim.advance(t)
|
||||
t, tokens := lim.advance(t)
|
||||
|
||||
// Calculate the remaining number of tokens resulting from the request.
|
||||
tokens -= float64(n)
|
||||
|
|
@ -379,15 +379,11 @@ func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration)
|
|||
if ok {
|
||||
r.tokens = n
|
||||
r.timeToAct = t.Add(waitDuration)
|
||||
}
|
||||
|
||||
// Update state
|
||||
if ok {
|
||||
// Update state
|
||||
lim.last = t
|
||||
lim.tokens = tokens
|
||||
lim.lastEvent = r.timeToAct
|
||||
} else {
|
||||
lim.last = last
|
||||
}
|
||||
|
||||
return r
|
||||
|
|
@ -396,7 +392,7 @@ func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration)
|
|||
// advance calculates and returns an updated state for lim resulting from the passage of time.
|
||||
// lim is not changed.
|
||||
// advance requires that lim.mu is held.
|
||||
func (lim *Limiter) advance(t time.Time) (newT time.Time, newLast time.Time, newTokens float64) {
|
||||
func (lim *Limiter) advance(t time.Time) (newT time.Time, newTokens float64) {
|
||||
last := lim.last
|
||||
if t.Before(last) {
|
||||
last = t
|
||||
|
|
@ -409,7 +405,7 @@ func (lim *Limiter) advance(t time.Time) (newT time.Time, newLast time.Time, new
|
|||
if burst := float64(lim.burst); tokens > burst {
|
||||
tokens = burst
|
||||
}
|
||||
return t, last, tokens
|
||||
return t, tokens
|
||||
}
|
||||
|
||||
// durationFromTokens is a unit conversion function from the number of tokens to the duration
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
// Copyright 2022 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package rate
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Sometimes will perform an action occasionally. The First, Every, and
|
||||
// Interval fields govern the behavior of Do, which performs the action.
|
||||
// A zero Sometimes value will perform an action exactly once.
|
||||
//
|
||||
// # Example: logging with rate limiting
|
||||
//
|
||||
// var sometimes = rate.Sometimes{First: 3, Interval: 10*time.Second}
|
||||
// func Spammy() {
|
||||
// sometimes.Do(func() { log.Info("here I am!") })
|
||||
// }
|
||||
type Sometimes struct {
|
||||
First int // if non-zero, the first N calls to Do will run f.
|
||||
Every int // if non-zero, every Nth call to Do will run f.
|
||||
Interval time.Duration // if non-zero and Interval has elapsed since f's last run, Do will run f.
|
||||
|
||||
mu sync.Mutex
|
||||
count int // number of Do calls
|
||||
last time.Time // last time f was run
|
||||
}
|
||||
|
||||
// Do runs the function f as allowed by First, Every, and Interval.
|
||||
//
|
||||
// The model is a union (not intersection) of filters. The first call to Do
|
||||
// always runs f. Subsequent calls to Do run f if allowed by First or Every or
|
||||
// Interval.
|
||||
//
|
||||
// A non-zero First:N causes the first N Do(f) calls to run f.
|
||||
//
|
||||
// A non-zero Every:M causes every Mth Do(f) call, starting with the first, to
|
||||
// run f.
|
||||
//
|
||||
// A non-zero Interval causes Do(f) to run f if Interval has elapsed since
|
||||
// Do last ran f.
|
||||
//
|
||||
// Specifying multiple filters produces the union of these execution streams.
|
||||
// For example, specifying both First:N and Every:M causes the first N Do(f)
|
||||
// calls and every Mth Do(f) call, starting with the first, to run f. See
|
||||
// Examples for more.
|
||||
//
|
||||
// If Do is called multiple times simultaneously, the calls will block and run
|
||||
// serially. Therefore, Do is intended for lightweight operations.
|
||||
//
|
||||
// Because a call to Do may block until f returns, if f causes Do to be called,
|
||||
// it will deadlock.
|
||||
func (s *Sometimes) Do(f func()) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
if s.count == 0 ||
|
||||
(s.First > 0 && s.count < s.First) ||
|
||||
(s.Every > 0 && s.count%s.Every == 0) ||
|
||||
(s.Interval > 0 && time.Since(s.last) >= s.Interval) {
|
||||
f()
|
||||
s.last = time.Now()
|
||||
}
|
||||
s.count++
|
||||
}
|
||||
|
|
@ -5,4 +5,4 @@
|
|||
package internal
|
||||
|
||||
// Version is the current tagged release of the library.
|
||||
const Version = "0.149.0"
|
||||
const Version = "0.150.0"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
"description": "Stores and retrieves potentially large, immutable data objects.",
|
||||
"discoveryVersion": "v1",
|
||||
"documentationLink": "https://developers.google.com/storage/docs/json_api/",
|
||||
"etag": "\"3133333835393639383131353638313238353437\"",
|
||||
"etag": "\"39383633393336373936373236333033393737\"",
|
||||
"icons": {
|
||||
"x16": "https://www.google.com/images/icons/product/cloud_storage-16.png",
|
||||
"x32": "https://www.google.com/images/icons/product/cloud_storage-32.png"
|
||||
|
|
@ -92,6 +92,242 @@
|
|||
},
|
||||
"protocol": "rest",
|
||||
"resources": {
|
||||
"anywhereCache": {
|
||||
"methods": {
|
||||
"disable": {
|
||||
"description": "Disables an Anywhere Cache instance.",
|
||||
"httpMethod": "POST",
|
||||
"id": "storage.anywhereCaches.disable",
|
||||
"parameterOrder": [
|
||||
"bucket",
|
||||
"anywhereCacheId"
|
||||
],
|
||||
"parameters": {
|
||||
"anywhereCacheId": {
|
||||
"description": "The ID of requested Anywhere Cache instance.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"description": "Name of the partent bucket",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/disable",
|
||||
"response": {
|
||||
"$ref": "AnywhereCache"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
},
|
||||
"get": {
|
||||
"description": "Returns the metadata of an Anywhere Cache instance.",
|
||||
"httpMethod": "GET",
|
||||
"id": "storage.anywhereCaches.get",
|
||||
"parameterOrder": [
|
||||
"bucket",
|
||||
"anywhereCacheId"
|
||||
],
|
||||
"parameters": {
|
||||
"anywhereCacheId": {
|
||||
"description": "The ID of requested Anywhere Cache instance.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"description": "Name of the partent bucket",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}",
|
||||
"response": {
|
||||
"$ref": "AnywhereCache"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_only",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
},
|
||||
"insert": {
|
||||
"description": "Creates an Anywhere Cache instance.",
|
||||
"httpMethod": "POST",
|
||||
"id": "storage.anywhereCaches.insert",
|
||||
"parameterOrder": [
|
||||
"bucket"
|
||||
],
|
||||
"parameters": {
|
||||
"bucket": {
|
||||
"description": "Name of the partent bucket",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "b/{bucket}/anywhereCaches",
|
||||
"request": {
|
||||
"$ref": "AnywhereCache"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "GoogleLongrunningOperation"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
},
|
||||
"list": {
|
||||
"description": "Returns a list of Anywhere Cache instances of the bucket matching the criteria.",
|
||||
"httpMethod": "GET",
|
||||
"id": "storage.anywhereCaches.list",
|
||||
"parameterOrder": [
|
||||
"bucket"
|
||||
],
|
||||
"parameters": {
|
||||
"bucket": {
|
||||
"description": "Name of the partent bucket",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"pageSize": {
|
||||
"description": "Maximum number of items return in a single page of responses. Maximum 1000.",
|
||||
"format": "int32",
|
||||
"location": "query",
|
||||
"minimum": "0",
|
||||
"type": "integer"
|
||||
},
|
||||
"pageToken": {
|
||||
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
||||
"location": "query",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "b/{bucket}/anywhereCache",
|
||||
"response": {
|
||||
"$ref": "AnywhereCaches"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_only",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
},
|
||||
"pause": {
|
||||
"description": "Pauses an Anywhere Cache instance.",
|
||||
"httpMethod": "POST",
|
||||
"id": "storage.anywhereCaches.pause",
|
||||
"parameterOrder": [
|
||||
"bucket",
|
||||
"anywhereCacheId"
|
||||
],
|
||||
"parameters": {
|
||||
"anywhereCacheId": {
|
||||
"description": "The ID of requested Anywhere Cache instance.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"description": "Name of the partent bucket",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/pause",
|
||||
"response": {
|
||||
"$ref": "AnywhereCache"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
},
|
||||
"resume": {
|
||||
"description": "Resumes a paused or disabled Anywhere Cache instance.",
|
||||
"httpMethod": "POST",
|
||||
"id": "storage.anywhereCaches.resume",
|
||||
"parameterOrder": [
|
||||
"bucket",
|
||||
"anywhereCacheId"
|
||||
],
|
||||
"parameters": {
|
||||
"anywhereCacheId": {
|
||||
"description": "The ID of requested Anywhere Cache instance.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"description": "Name of the partent bucket",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}/resume",
|
||||
"response": {
|
||||
"$ref": "AnywhereCache"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
},
|
||||
"update": {
|
||||
"description": "Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.",
|
||||
"httpMethod": "PATCH",
|
||||
"id": "storage.anywhereCaches.update",
|
||||
"parameterOrder": [
|
||||
"bucket",
|
||||
"anywhereCacheId"
|
||||
],
|
||||
"parameters": {
|
||||
"anywhereCacheId": {
|
||||
"description": "The ID of requested Anywhere Cache instance.",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"description": "Name of the partent bucket",
|
||||
"location": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"path": "b/{bucket}/anywhereCaches/{anywhereCacheId}",
|
||||
"request": {
|
||||
"$ref": "AnywhereCache"
|
||||
},
|
||||
"response": {
|
||||
"$ref": "GoogleLongrunningOperation"
|
||||
},
|
||||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"bucketAccessControls": {
|
||||
"methods": {
|
||||
"delete": {
|
||||
|
|
@ -3563,9 +3799,87 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"revision": "20231012",
|
||||
"revision": "20231028",
|
||||
"rootUrl": "https://storage.googleapis.com/",
|
||||
"schemas": {
|
||||
"AnywhereCache": {
|
||||
"description": "An Anywhere Cache instance.",
|
||||
"id": "AnywhereCache",
|
||||
"properties": {
|
||||
"admissionPolicy": {
|
||||
"description": "The cache-level entry admission policy.",
|
||||
"type": "string"
|
||||
},
|
||||
"anywhereCacheId": {
|
||||
"description": "The ID of the Anywhere cache instance.",
|
||||
"type": "string"
|
||||
},
|
||||
"bucket": {
|
||||
"description": "The name of the bucket containing this cache instance.",
|
||||
"type": "string"
|
||||
},
|
||||
"createTime": {
|
||||
"description": "The creation time of the cache instance in RFC 3339 format.",
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"description": "The ID of the resource, including the project number, bucket name and anywhere cache ID.",
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"default": "storage#anywhereCache",
|
||||
"description": "The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.",
|
||||
"type": "string"
|
||||
},
|
||||
"pendingUpdate": {
|
||||
"description": "True if the cache instance has an active Update long-running operation.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"selfLink": {
|
||||
"description": "The link to this cache instance.",
|
||||
"type": "string"
|
||||
},
|
||||
"state": {
|
||||
"description": "The current state of the cache instance.",
|
||||
"type": "string"
|
||||
},
|
||||
"ttl": {
|
||||
"description": "The TTL of all cache entries in whole seconds. e.g., \"7200s\". ",
|
||||
"format": "google-duration",
|
||||
"type": "string"
|
||||
},
|
||||
"updateTime": {
|
||||
"description": "The modification time of the cache instance metadata in RFC 3339 format.",
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"AnywhereCaches": {
|
||||
"description": "A list of Anywhere Caches.",
|
||||
"id": "AnywhereCaches",
|
||||
"properties": {
|
||||
"items": {
|
||||
"description": "The list of items.",
|
||||
"items": {
|
||||
"$ref": "AnywhereCache"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"kind": {
|
||||
"default": "storage#anywhereCaches",
|
||||
"description": "The kind of item this is. For lists of Anywhere Caches, this is always storage#anywhereCaches.",
|
||||
"type": "string"
|
||||
},
|
||||
"nextPageToken": {
|
||||
"description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"Bucket": {
|
||||
"description": "A bucket.",
|
||||
"id": "Bucket",
|
||||
|
|
@ -3951,7 +4265,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"retentionDurationSeconds": {
|
||||
"description": "The period of time in seconds, that soft-deleted objects in the bucket will be retained and cannot be permanently deleted.",
|
||||
"description": "The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted.",
|
||||
"format": "int64",
|
||||
"type": "string"
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -14,10 +14,12 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"cloud.google.com/go/compute/metadata"
|
||||
"go.opencensus.io/plugin/ocgrpc"
|
||||
"golang.org/x/oauth2"
|
||||
"golang.org/x/time/rate"
|
||||
"google.golang.org/api/internal"
|
||||
"google.golang.org/api/option"
|
||||
"google.golang.org/grpc"
|
||||
|
|
@ -38,6 +40,9 @@ const enableDirectPathXds = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
|
|||
// Set at init time by dial_socketopt.go. If nil, socketopt is not supported.
|
||||
var timeoutDialerOption grpc.DialOption
|
||||
|
||||
// Log rate limiter
|
||||
var logRateLimiter = rate.Sometimes{Interval: 1 * time.Second}
|
||||
|
||||
// Dial returns a GRPC connection for use communicating with a Google cloud
|
||||
// service, configured with the given ClientOptions.
|
||||
func Dial(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error) {
|
||||
|
|
@ -153,6 +158,9 @@ func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.C
|
|||
)
|
||||
|
||||
// Attempt Direct Path:
|
||||
logRateLimiter.Do(func() {
|
||||
logDirectPathMisconfig(endpoint, creds.TokenSource, o)
|
||||
})
|
||||
if isDirectPathEnabled(endpoint, o) && isTokenSourceDirectPathCompatible(creds.TokenSource, o) && metadata.OnGCE() {
|
||||
// Overwrite all of the previously specific DialOptions, DirectPath uses its own set of credentials and certificates.
|
||||
grpcOpts = []grpc.DialOption{
|
||||
|
|
@ -296,6 +304,24 @@ func checkDirectPathEndPoint(endpoint string) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
func logDirectPathMisconfig(endpoint string, ts oauth2.TokenSource, o *internal.DialSettings) {
|
||||
if isDirectPathXdsUsed(o) {
|
||||
// Case 1: does not enable DirectPath
|
||||
if !isDirectPathEnabled(endpoint, o) {
|
||||
log.Println("WARNING: DirectPath is misconfigured. Please set the EnableDirectPath option along with the EnableDirectPathXds option.")
|
||||
} else {
|
||||
// Case 2: credential is not correctly set
|
||||
if !isTokenSourceDirectPathCompatible(ts, o) {
|
||||
log.Println("WARNING: DirectPath is misconfigured. Please make sure the token source is fetched from GCE metadata server and the default service account is used.")
|
||||
}
|
||||
// Case 3: not running on GCE
|
||||
if !metadata.OnGCE() {
|
||||
log.Println("WARNING: DirectPath is misconfigured. DirectPath is only available in a GCE environment.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func processAndValidateOpts(opts []option.ClientOption) (*internal.DialSettings, error) {
|
||||
var o internal.DialSettings
|
||||
for _, opt := range opts {
|
||||
|
|
|
|||
|
|
@ -930,7 +930,7 @@ golang.org/x/text/secure/bidirule
|
|||
golang.org/x/text/transform
|
||||
golang.org/x/text/unicode/bidi
|
||||
golang.org/x/text/unicode/norm
|
||||
# golang.org/x/time v0.1.0
|
||||
# golang.org/x/time v0.3.0
|
||||
## explicit
|
||||
golang.org/x/time/rate
|
||||
# golang.org/x/tools v0.13.0
|
||||
|
|
@ -956,7 +956,7 @@ golang.org/x/tools/internal/typesinternal
|
|||
## explicit; go 1.17
|
||||
golang.org/x/xerrors
|
||||
golang.org/x/xerrors/internal
|
||||
# google.golang.org/api v0.149.0
|
||||
# google.golang.org/api v0.150.0
|
||||
## explicit; go 1.19
|
||||
google.golang.org/api/googleapi
|
||||
google.golang.org/api/googleapi/transport
|
||||
|
|
@ -995,7 +995,7 @@ google.golang.org/genproto/internal
|
|||
## explicit; go 1.19
|
||||
google.golang.org/genproto/googleapis/api
|
||||
google.golang.org/genproto/googleapis/api/annotations
|
||||
# google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b
|
||||
# google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405
|
||||
## explicit; go 1.19
|
||||
google.golang.org/genproto/googleapis/rpc/code
|
||||
google.golang.org/genproto/googleapis/rpc/errdetails
|
||||
|
|
|
|||
Loading…
Reference in New Issue