Documentation ¶
Index ¶
- Constants
- func GetRetriableStatusCode() []int
- func NewGetRequestRegionalEndpointRetryPolicy(regionalEndpoint string) policy.Policy
- func NewRateLimitPolicy(config *RateLimitConfig) policy.Policy
- func NewThrottlingPolicy() policy.Policy
- type GetRequestRegionalEndpointRetryPolicy
- type RateLimitConfig
- type RateLimitPolicy
- type RetryConfig
- type ThrottlingPolicy
Constants ¶
View Source
const ( DefaultMaxRetries = 3 DefaultMaxRetryDelay = math.MaxInt64 DefaultRetryDelay = 800 * time.Millisecond DefaultTryTimeout = 5 * time.Second )
View Source
const HeaderRetryAfter = "Retry-After"
Variables ¶
This section is empty.
Functions ¶
func GetRetriableStatusCode ¶
func GetRetriableStatusCode() []int
func NewRateLimitPolicy ¶
func NewRateLimitPolicy(config *RateLimitConfig) policy.Policy
func NewThrottlingPolicy ¶
Types ¶
type GetRequestRegionalEndpointRetryPolicy ¶
type GetRequestRegionalEndpointRetryPolicy struct {
// contains filtered or unexported fields
}
GetRequestRegionalEndpointRetryPolicy is a policy that retries requests on ResourceGroupNotFound error.
type RateLimitConfig ¶
type RateLimitConfig struct { // Enable rate limiting CloudProviderRateLimit bool `json:"cloudProviderRateLimit,omitempty" yaml:"cloudProviderRateLimit,omitempty"` // Rate limit QPS (Read) CloudProviderRateLimitQPS float32 `json:"cloudProviderRateLimitQPS,omitempty" yaml:"cloudProviderRateLimitQPS,omitempty"` // Rate limit Bucket Size CloudProviderRateLimitBucket int `json:"cloudProviderRateLimitBucket,omitempty" yaml:"cloudProviderRateLimitBucket,omitempty"` // Rate limit QPS (Write) CloudProviderRateLimitQPSWrite float32 `json:"cloudProviderRateLimitQPSWrite,omitempty" yaml:"cloudProviderRateLimitQPSWrite,omitempty"` // Rate limit Bucket Size CloudProviderRateLimitBucketWrite int `json:"cloudProviderRateLimitBucketWrite,omitempty" yaml:"cloudProviderRateLimitBucketWrite,omitempty"` }
RateLimitConfig indicates the rate limit config options.
type RateLimitPolicy ¶
type RateLimitPolicy struct {
// contains filtered or unexported fields
}
type RetryConfig ¶
type RetryConfig struct { PollingDelay *time.Duration RetryAttempts *int RetryDuration *time.Duration // Backoff holds parameters applied to a Backoff function. // The initial duration. Duration time.Duration // Duration is multiplied by factor each iteration, if factor is not zero // and the limits imposed by Steps and Cap have not been reached. // Should not be negative. // The jitter does not contribute to the updates to the duration parameter. Factor float64 // The sleep at each iteration is the duration plus an additional // amount chosen uniformly at random from the interval between // zero and `jitter*duration`. Jitter float64 // The remaining number of iterations in which the duration // parameter may change (but progress can be stopped earlier by // hitting the cap). If not positive, the duration is not // changed. Used for exponential backoff in combination with // Factor and Cap. Steps int // A limit on revised values of the duration parameter. If a // multiplication by the factor parameter would make the duration // exceed the cap then the duration is set to the cap and the // steps parameter is set to zero. Cap time.Duration // The errors indicate that the request shouldn't do more retrying. NonRetriableErrors []string // The RetriableHTTPStatusCodes indicates that the HTTPStatusCode should do more retrying. RetriableHTTPStatusCodes []int }
type ThrottlingPolicy ¶
ThrottlingPolicy implements the Azure SDK for Go's Policy interface. throttle counter is based on resources operation per subscription.
Click to show internal directories.
Click to hide internal directories.