retry

package
v0.0.48 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 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 ...Option) error

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 Option

type Option func(*Config)

func WithAttempts

func WithAttempts(attempts uint) Option

func WithContext

func WithContext(ctx context.Context) Option

func WithDelayFn added in v0.0.21

func WithDelayFn(delayTypeFn DelayTypeFunc) Option

func WithIf

func WithIf(retryIf IfFunc) Option

func WithOnRetry

func WithOnRetry(onRetry OnRetryFunc) Option

type UserFunc

type UserFunc func() error

Jump to

Keyboard shortcuts

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