Documentation ¶
Overview ¶
Package retry provides util functions to retry fail actions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNeedRetry = errors.New("need retry")
ErrNeedRetry is a placholder helper, in case you have no error to return, such as bool status, etc.
Functions ¶
func ConstantBackoffs ¶
ConstantBackoffs creates a list of backoffs with constant values.
func ExponentialBackoffs ¶
ExponentialBackoffs creates a list of backoffs with values are calculated by backoff*2^[0 1 2 .. n).
func ZeroBackoffs ¶
ZeroBackoffs creates a list of backoffs with zero values.
Types ¶
type Retrier ¶
type Retrier struct {
// contains filtered or unexported fields
}
Retrier retrys fail actions with backoff.
Click to show internal directories.
Click to hide internal directories.