Documentation
¶
Index ¶
Constants ¶
View Source
const ( RetryAfterHeaderName = constants.RetryAfterHeaderName RateLimitResetHeaderName = constants.RateLimitResetHeaderName RateLimitResetAltHeaderName = constants.RateLimitResetAltHeaderName RetryHeaderMaxAllowableDurationInSec = constants.RetryHeaderMaxAllowableDurationInSec MaxBackoffTimeInSec = constants.MaxBackoffTimeInSec )
Variables ¶
This section is empty.
Functions ¶
func GetTimeToWait ¶
func GetTimeToWait(loopCount, maxRetry, minWaitInMs int, headers http.Header, _ string) time.Duration
GetTimeToWait returns the time to wait for the next retry returns 0 if no retry should be attempted loopCount: the current loop count maxRetry: the maximum number of retries minWaitInMs: the minimum wait time in milliseconds headers: the headers from the response operationName: the operation name, currently unused
Types ¶
type RetryParams ¶
type RetryParams struct {
MaxRetry int `json:"maxRetry,omitempty"`
MinWaitInMs int `json:"minWaitInMs,omitempty"`
}
RetryParams configures configuration for retry in case of HTTP too many request
func GetRetryParamsOrDefault ¶
func GetRetryParamsOrDefault(r *RetryParams) RetryParams
func NewRetryParams ¶
func NewRetryParams(retryParams *RetryParams) (*RetryParams, error)
func (*RetryParams) Validate ¶
func (r *RetryParams) Validate() error
Click to show internal directories.
Click to hide internal directories.