backoff

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyStat = Stat{}

Functions

This section is empty.

Types

type Backoff

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

func New

func New(opts ...Option) (*Backoff, error)

func (*Backoff) Reset

func (b *Backoff) Reset()

func (Backoff) Validate added in v0.0.19

func (b Backoff) Validate() error

func (*Backoff) Wait

func (b *Backoff) Wait(ctx context.Context) (Stat, error)

type Option added in v0.0.19

type Option = c.Option[Backoff]

func WithExponentialStrategy added in v0.3.1

func WithExponentialStrategy(opts ...strategies.ExponentialOption) Option

func WithMaxRetries

func WithMaxRetries(mr uint32) Option

func WithName

func WithName(name string) Option

func WithStrategy

func WithStrategy(s strategies.Interface) Option

type RetryLimitError

type RetryLimitError struct {
	BackoffName string
	MaxRetries  uint32
}

func (RetryLimitError) Error

func (e RetryLimitError) Error() string

type Stat

type Stat struct {
	Duration   time.Duration
	RetryIndex uint32
	MaxRetries uint32
}

func (Stat) String

func (s Stat) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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