backoff

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backoff

type Backoff interface {
	// Duration returns the duration to wait before retrying the operation.
	// Duration accepts the numeber of times the operation has been retried.
	// If the operation has never been retried, the number should be 0.
	Duration(int) time.Duration
}

type ConstantBackoff

type ConstantBackoff struct {
	Interval time.Duration
}

func (*ConstantBackoff) Duration

func (b *ConstantBackoff) Duration(retries int) time.Duration

type ExponentialBackoff

type ExponentialBackoff struct {
	Interval time.Duration
	Base     int
}

func (*ExponentialBackoff) Duration

func (b *ExponentialBackoff) Duration(retries int) time.Duration

Jump to

Keyboard shortcuts

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