Versions in this module Expand all Collapse all v1 v1.0.0 Apr 7, 2026 Changes in this version + var ErrMaxAttemptsReached = errors.New("max attempts reached") + func IsRecoverable(err error) bool + func IsRetryable(err error) bool + func IsUnrecoverable(err error) bool + func Retryable(err error) error + func Unrecoverable(err error) error + type AttemptInfo struct + Attempt uint64 + AttemptDuration time.Duration + Elapsed time.Duration + Err error + MaxAttempts uint64 + MaxDuration time.Duration + type OnRetryFunc func(info AttemptInfo) + type Option func(*config) + func AdjustTimeoutPercent(pct int) Option + func Attempts(n uint64) Option + func BaseDelay(d time.Duration) Option + func DelayIncludesAttempt(b bool) Option + func DelayTypeConstant() Option + func DelayTypeExponential() Option + func DelayTypeFibonacci() Option + func JitterPercent(pct uint64) Option + func LastErrorOnly(b bool) Option + func MaxDelay(d time.Duration) Option + func MinAdjustTimeout(d time.Duration) Option + func OnRetry(fn OnRetryFunc) Option + func RetryIf(fn RetryIfFunc) Option + func TimeoutJitterPercent(pct int) Option + func UntilSucceeded() Option + type Result struct + Data T + func Do(ctx context.Context, fn RetryableFunc, opts ...Option) Result[struct{}] + func DoWithData[T any](ctx context.Context, fn RetryableFuncWithData[T], opts ...Option) Result[T] + type RetryIfFunc func(err error) bool + type RetryableFunc func(ctx context.Context) error + type RetryableFuncWithData func(ctx context.Context) (T, error)