retry

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(userFn UserFunc, opts ...retryOption) error

func WithAttempts

func WithAttempts(attempts uint) retryOption

func WithContext

func WithContext(ctx context.Context) retryOption

func WithDelayFn added in v0.0.21

func WithDelayFn(delayTypeFn DelayTypeFunc) retryOption

func WithIf

func WithIf(retryIf IfFunc) retryOption

func WithOnRetry

func WithOnRetry(onRetry OnRetryFunc) retryOption

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

type DelayTypeFunc added in v0.0.21

type DelayTypeFunc func(n uint, err error, config *Config) time.Duration

type Error

type Error []error

func (Error) Error

func (e Error) Error() string

func (Error) WrappedErrors

func (e Error) WrappedErrors() []error

type IfFunc

type IfFunc func(error) bool

type OnRetryFunc

type OnRetryFunc func(n uint, err error)

type UserFunc

type UserFunc func() error

Jump to

Keyboard shortcuts

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