backoff

package
v0.0.0-...-28ca6ac Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 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