Documentation ¶
Overview ¶
Package retry implements a retrying transport based on a combination of strategies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Attempt ¶
Attempt counts the round trips issued, starting from 1. Response is valid only when Err is nil.
type Delayer ¶
type Delayer func(Attempt)
Delayer sleeps or selects any amount of time for each attempt.
func Exponential ¶
Linear sleeps for delta * 2^attempts
type MaxError ¶
type MaxError struct {
// contains filtered or unexported fields
}
MaxError is returned from RoundTrip when the maximum attempts has been reached.
type Retryer ¶
Retryer chooses whether or not to retry this request. The error is only valid when the Retyer returns Abort.
func All ¶
All aggregates decisions from Retryers for an attempt. All returns Abort and the error on the first Abort. If at least one returns Retry All returns Retry with nil error. Otherwise All returns Ignore with nil error.
func Idempotent ¶
func Idempotent() Retryer
Idempotent retries when the request is expected to be idempotent according to RFC 2616, section 9.1.2. https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.2
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
TimeoutError is returned from RoundTrip when the time limit has been reached.
func (TimeoutError) Error ¶
func (e TimeoutError) Error() string