backoff

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

DefaultBackoff is our opinionated Backoff function for retry.WithBackoff - between 128ms and 1m.

Functions

This section is empty.

Types

type Backoff

type Backoff func(uint64) time.Duration

Backoff returns the backoff duration for a specific retry attempt.

func NewExponentialWithJitter

func NewExponentialWithJitter(min, max time.Duration) Backoff

NewExponentialWithJitter returns an exponentially increasing Backoff implementation.

The calculated time.Duration values are within [min, max], exponentially increasing and slightly randomized. If min or max are zero or negative, they will default to 100ms and 10s, respectively. It panics if min >= max.

Jump to

Keyboard shortcuts

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