Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DoubleTimeBackoff ¶
type DoubleTimeBackoff struct {
// contains filtered or unexported fields
}
func (*DoubleTimeBackoff) Do ¶
func (b *DoubleTimeBackoff) Do(f func() error) error
type NilBackoff ¶
type NilBackoff struct{}
func (NilBackoff) Do ¶
func (NilBackoff) Do(f func() error) error
type Retrier ¶
type Retrier interface {
// Do executes the function doing retries in case it returns an error
Do(f func() error) error
}
func NewDoubleTimeBackoff ¶
NewDoubleTimeBackoff retries the function f backing off the double of time each retry until a successfully call is made. initialBackoff is minimal time to wait for the next call maxBackoff is the maximum time between calls, if is 0 there is no maximum maxCalls is the maximum number of calls to the function, if is 0 there is no maximum
func NewNilBackoff ¶
func NewNilBackoff() Retrier
NewNilBackoff it just calls the function, it usefull for testing
Click to show internal directories.
Click to hide internal directories.