Versions in this module Expand all Collapse all v4 v4.5.3 Sep 5, 2023 v4.5.2 Sep 5, 2023 Changes in this version + func BackOffDelay(n uint, _ error, config *Config) time.Duration + func Do(retryableFunc RetryableFunc, opts ...Option) error + func DoWithData(retryableFunc RetryableFuncWithData[T], opts ...Option) (T, error) + func FixedDelay(_ uint, _ error, config *Config) time.Duration + func IsRecoverable(err error) bool + func RandomDelay(_ uint, _ error, config *Config) time.Duration + func Unrecoverable(err error) error + type Config struct + type DelayTypeFunc func(n uint, err error, config *Config) time.Duration + func CombineDelay(delays ...DelayTypeFunc) DelayTypeFunc + type Error []error + func (e Error) As(target interface{}) bool + func (e Error) Error() string + func (e Error) Is(target error) bool + func (e Error) Unwrap() error + func (e Error) WrappedErrors() []error + type OnRetryFunc func(n uint, err error) + type Option func(*Config) + func Attempts(attempts uint) Option + func AttemptsForError(attempts uint, err error) Option + func Context(ctx context.Context) Option + func Delay(delay time.Duration) Option + func DelayType(delayType DelayTypeFunc) Option + func LastErrorOnly(lastErrorOnly bool) Option + func MaxDelay(maxDelay time.Duration) Option + func MaxJitter(maxJitter time.Duration) Option + func OnRetry(onRetry OnRetryFunc) Option + func RetryIf(retryIf RetryIfFunc) Option + func WithTimer(t Timer) Option + func WrapContextErrorWithLastError(wrapContextErrorWithLastError bool) Option + type RetryIfFunc func(error) bool + type RetryableFunc func() error + type RetryableFuncWithData func() (T, error) + type Timer interface + After func(time.Duration) <-chan time.Time