retry

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(userFunc UserFunc, opts ...Option) error

Types

type Config

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

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 WithDelay

func WithDelay(delay time.Duration) 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