Documentation ¶
Index ¶
- func Attempts(resp *http.Response) int
- func OK() (bool, error)
- func PermanentError(msg string) (bool, error)
- func PermanentErrorf(msg string, values ...interface{}) (bool, error)
- func RetriableError(msg string) (bool, error)
- func RetriableErrorf(msg string, values ...interface{}) (bool, error)
- type Client
- type Conditioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PermanentError ¶
PermanentError signals that an error occurred that cannot be retried
func PermanentErrorf ¶
PermanentErrorf is like PermanentError but allows string formatting
func RetriableError ¶
RetriableError signals that a retriable error ocurred
func RetriableErrorf ¶
RetriableErrorf is like RetriableError but allows string formatting
Types ¶
type Client ¶
Client represents an HTTP client. The "net/http".Client implements it for easy substitution in your project.
func NewBackoffClient ¶
func NewBackoffClient(httpClient http.Client, backoffer backoff.BackOff, conditioner Conditioner) Client
NewBackoffClient returns a Client implementation. It takes an implementation of backoff.Backoff, which determines the rate and limits of retrying. It takes a Conditioner which determines when to stop or continue retrying.
func NewDefaultBackoffClient5XX ¶
NewDefaultBackoffClient5XX retries requests if they result in 5XXs and accepts them if they result in 2XXs. If they are neither they return an error and retry no longer.