Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NetworkConnectionError ¶
func New ¶
func New(inner httpclient.HttpClient, cfg RetryConfig, lgr zerolog.Logger) httpclient.HttpClient
New creates an HTTP client decorator that retries each request on network error.
func NewExponentialBackOff ¶
func NewExponentialBackOff(cfg RetryConfig, target string, lgr zerolog.Logger, connect func() error) error
NewExponentialBackOff runs some connect function repeatedly until it returns without error or returns with an error considered permanent (i.e. not a network error).
It is based on github.com/cenkalti/backoff/v4 backoff.ExponentialBackOff
Types ¶
type RetryConfig ¶
RetryConfig configures connection retry logic. The zero value will work fine. By default, the initial back-off is 500ms and this increases exponentially to a maximum of 1 minute.
Click to show internal directories.
Click to hide internal directories.