retryer

package
v0.0.0-testrgm3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(body func() (RetrySignal, error), maxRetries int, minDelay time.Duration, maxDelay time.Duration) error

Retry retries the provided function using exponential backoff, starting with `minDelay` between attempts, and increasing to `maxDelay` after each failure. Stops when the provided function returns `FuncComplete`, or `maxRetries` is reached.

Types

type RetrySignal

type RetrySignal = int
const (
	FuncFailure RetrySignal = iota
	FuncComplete
	FuncError
)

Jump to

Keyboard shortcuts

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