backoff

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarkErrorPermanent

func MarkErrorPermanent(err error) error

MarkErrorPermanent marks an error permanent error so it won't be retried (unlike with non-marked errors considered as transient)

func NewConstantBackoffPolicy

func NewConstantBackoffPolicy(config *ConstantBackoffConfig) *backoff.Constant

NewConstantBackoffPolicy creates a new constant backoff policy

func Retry

func Retry(function func() error, backoffPolicy backoff.Policy) (err error)

Retry retries the given function using a backoff policy

Types

type ConstantBackoffConfig

type ConstantBackoffConfig struct {
	Delay          time.Duration
	MaxElapsedTime time.Duration
	MaxRetries     int
}

ConstantBackoffConfig holds the config for constant backoff policy

Jump to

Keyboard shortcuts

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