Documentation
¶
Index ¶
- func Retry(fn func(ctx context.Context) error, opts ...Option) error
- func RetryContext(ctx context.Context, fn func(ctx context.Context) error, opts ...Option) error
- func RetryValue[T any](fn func(ctx context.Context) (T, error), opts ...Option) (T, error)
- func RetryValueContext[T any](ctx context.Context, fn func(ctx context.Context) (T, error), opts ...Option) (T, error)
- type Option
- type RetryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RetryContext ¶
func RetryValue ¶
Types ¶
type Option ¶
type Option func(*RetryOptions)
func WithBackoffFactor ¶
func WithJitter ¶
func WithMaxDelay ¶
func WithMaxTries ¶
type RetryOptions ¶
type RetryOptions struct {
MaxTries int
Delay time.Duration
MaxDelay time.Duration
BackoffFactor float64
Jitter float64
}
func DefaultRetryOptions ¶
func DefaultRetryOptions() RetryOptions
Click to show internal directories.
Click to hide internal directories.