retry

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const (
	DefaultNumberOfRetries     = 20
	DefaultDelayBetweenRetires = time.Second * 5
)

Variables

This section is empty.

Functions

func Retry

func Retry(retryFunc RetryFunc, opts ...Option) error

Retry executes the retryFunc repeatedly until it was successful or canceled by the context The default number of retries is 20 and the default delay between retries is 5 seconds

Types

type Option

type Option func(*RetryConfiguration)

func Context

func Context(ctx context.Context) Option

func DelayBetweenRetries

func DelayBetweenRetries(d time.Duration) Option

func NumberOfRetries

func NumberOfRetries(n uint) Option

type RetryConfiguration

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

type RetryFunc

type RetryFunc func() error

Jump to

Keyboard shortcuts

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