Versions in this module Expand all Collapse all v1 v1.0.0 Feb 26, 2026retracted Changes in this version + type BackoffParam struct + func NewBackoffParam(initialDuration time.Duration, multiplier float64, maxDuration time.Duration) BackoffParam + func (b *BackoffParam) InitialDuration() time.Duration + func (b *BackoffParam) MaxDuration() time.Duration + func (b *BackoffParam) Multiplier() float64 + type DebugLogger interface + Enabled func() bool + LogRetry func(ctx context.Context, attempt int, maxAttempts int, backoff time.Duration, ...) + type NoOpLogger struct + func NewNoOpLogger() *NoOpLogger + func (n *NoOpLogger) Enabled() bool + func (n *NoOpLogger) LogRetry(_ context.Context, _ int, _ int, _ time.Duration, _ error) + type Result struct + func NewFailureResult[T any](err RetryableError, attempts int) Result[T] + func NewSuccessResult[T any](value T, attempts int) Result[T] + func Retry[T any](retryParam RetryParam, logger DebugLogger, fn func() (T, RetryableError)) Result[T] + func (r Result[T]) Attempts() int + func (r Result[T]) Err() RetryableError + func (r Result[T]) IsFailure() bool + func (r Result[T]) IsSuccess() bool + func (r Result[T]) Value() T + type RetryError struct + Cause RetryErrorCause + Message string + func NewRetryError(cause RetryErrorCause, message string, policy RetryPolicy, wrapped error) *RetryError + func (e *RetryError) Error() string + func (e *RetryError) Is(target error) bool + func (e *RetryError) RetryPolicy() RetryPolicy + func (e *RetryError) Unwrap() error + type RetryErrorCause string + const ErrExhaustedAttempts + const ErrZeroAttempt + type RetryParam struct + BackoffParam BackoffParam + BaseDelay time.Duration + Jitter time.Duration + MaxAttempts int + RandomSeed int64 + func NewRetryParam(baseDelay time.Duration, jitter time.Duration, randomSeed int64, ...) RetryParam + type RetryPolicy int + const RetryPolicyAuto + const RetryPolicyManual + const RetryPolicyNever + type RetryableError interface + RetryPolicy func() RetryPolicy