build(deps): bump github.com/gophercloud/gophercloud
Bumps [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) from 0.11.0 to 0.20.0. - [Release notes](https://github.com/gophercloud/gophercloud/releases) - [Changelog](https://github.com/gophercloud/gophercloud/blob/master/CHANGELOG.md) - [Commits](https://github.com/gophercloud/gophercloud/compare/v0.11.0...v0.20.0) --- updated-dependencies: - dependency-name: github.com/gophercloud/gophercloud dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
24727bb2e3
commit
839a708755
20 changed files with 593 additions and 194 deletions
39
vendor/github.com/gophercloud/gophercloud/doc.go
generated
vendored
39
vendor/github.com/gophercloud/gophercloud/doc.go
generated
vendored
|
|
@ -106,5 +106,44 @@ intermediary processing on each page, you can use the AllPages method:
|
|||
This top-level package contains utility functions and data types that are used
|
||||
throughout the provider and service packages. Of particular note for end users
|
||||
are the AuthOptions and EndpointOpts structs.
|
||||
|
||||
An example retry backoff function, which respects the 429 HTTP response code and a "Retry-After" header:
|
||||
|
||||
endpoint := "http://localhost:5000"
|
||||
provider, err := openstack.NewClient(endpoint)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
provider.MaxBackoffRetries = 3 // max three retries
|
||||
provider.RetryBackoffFunc = func(ctx context.Context, respErr *ErrUnexpectedResponseCode, e error, retries uint) error {
|
||||
retryAfter := respErr.ResponseHeader.Get("Retry-After")
|
||||
if retryAfter == "" {
|
||||
return e
|
||||
}
|
||||
|
||||
var sleep time.Duration
|
||||
|
||||
// Parse delay seconds or HTTP date
|
||||
if v, err := strconv.ParseUint(retryAfter, 10, 32); err == nil {
|
||||
sleep = time.Duration(v) * time.Second
|
||||
} else if v, err := time.Parse(http.TimeFormat, retryAfter); err == nil {
|
||||
sleep = time.Until(v)
|
||||
} else {
|
||||
return e
|
||||
}
|
||||
|
||||
if ctx != nil {
|
||||
select {
|
||||
case <-time.After(sleep):
|
||||
case <-ctx.Done():
|
||||
return e
|
||||
}
|
||||
} else {
|
||||
time.Sleep(sleep)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
*/
|
||||
package gophercloud
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue