Documentation
¶
Overview ¶
Package retry reruns fallible operations (network calls, toolchain runs) with capped attempts and backoff. Permanent failures should be returned wrapped so callers can exclude them via Options.RetryIf.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Attempts caps tries including the first call. Default 3.
Attempts uint
// Delay is the base backoff between tries. Default time.Second.
Delay time.Duration
// RetryIf, when set, vetoes retries for matching errors.
RetryIf func(error) bool
}
Options tunes Do. Zero value retries 3 times with 1s backoff.