backoff

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMinDuration = 5 * time.Second
	DefaultMaxDuration = 60 * time.Second
	DefaultFactor      = float64(2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backoff

type Backoff struct {
	// contains filtered or unexported fields
}

func NewBackoff

func NewBackoff(cfg ...Config) *Backoff

func (*Backoff) Next

func (b *Backoff) Next(attempt int) time.Duration

type Config

type Config struct {
	Min    time.Duration
	Max    time.Duration
	Factor float64
}

Jump to

Keyboard shortcuts

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