retry

package
v1.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMaxRetry = errors.New("failed max retries")
)

Functions

func ExponentialBackoff

func ExponentialBackoff[T any](ctx context.Context, fn func() (T, error), optionFnc ...RetryOption) (_ T, rErr error)

func ExponentialBackoffOnlyErr

func ExponentialBackoffOnlyErr(ctx context.Context, fn func() error, optionFnc ...RetryOption) (rErr error)

func NewSkip

func NewSkip(err error) error

func Retry

func Retry[T any](ctx context.Context, fn func() (T, error), optionFnc ...RetryOption) (_ T, rErr error)

func RetryOnlyErr

func RetryOnlyErr(ctx context.Context, fn func() error, optionFnc ...RetryOption) (rErr error)

Types

type CalculateExponentialBackoffFn

type CalculateExponentialBackoffFn func(retryCount int) time.Duration

type RetryOption

type RetryOption interface {
	// contains filtered or unexported methods
}

func WithCalExponentialBackoff

func WithCalExponentialBackoff(fn CalculateExponentialBackoffFn) RetryOption

func WithMaxRetries

func WithMaxRetries(maxRetries int) RetryOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL