Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper for a HTTP client that adds a retry logic to manage temporary failures
func NewClient ¶
NewClient returns the client passed as input wrapped with a retry logic strategy is the Strategy used to get a backoff time before the next retry maxRetries is the maximum number of retries before returning a failure
func NewDefaultClient ¶
NewDefaultClient returns the default http package client wrapped with a retry logic strategy is the Strategy used to get a backoff time before the next retry maxRetries is the maximum number of retries before returning a failure
type Constant ¶
type Constant struct { // Quantum is the basic unit of duration for the algorithm Quantum time.Duration }
Constant implements the constant backoff algorithm
type Exponential ¶
type Exponential struct { // Quantum is the basic unit of duration for the algorithm Quantum time.Duration }
Exponential implements the exponential backoff algorithm
type JitteredConstant ¶
type JitteredConstant struct {
Constant
}
JitteredConstant implements the constant backoff algorithm with a +/- 33% jitter
type JitteredExponential ¶
type JitteredExponential struct {
Exponential
}
JitteredExponential implements the exponential backoff algorithm with a +/- 33% jitter
type JitteredLinear ¶
type JitteredLinear struct {
Linear
}
JitteredLinear implements the linear backoff algorithm with a +/- 33% jitter