try

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxRetries = 10

MaxRetries is the maximum number of retries before bailing.

Functions

func Do

func Do(fn Func) error

Do keeps trying the function until the second argument returns false, or no error is returned.

func IsMaxRetries

func IsMaxRetries(err error) bool

IsMaxRetries checks whether the error is due to hitting the maximum number of retries or not.

Types

type Func

type Func func(attempt int) (retry bool, err error)

Func represents functions that can be retried.

Jump to

Keyboard shortcuts

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