retry

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 6 Imported by: 0

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