backoff

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(fn RetryFunc, config Config) (interface{}, error)

Retry retries the given function using exponential backoff.

Types

type Config

type Config struct {
	MaxRetries   int
	InitialDelay time.Duration
	MaxDelay     time.Duration
}

Config holds the configuration for the backoff.

type RetryFunc

type RetryFunc func() (interface{}, error)

RetryFunc defines the signature of the function to be retried.

Jump to

Keyboard shortcuts

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