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 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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