Documentation ¶
Overview ¶
Package retry provides a simple interface for retrying operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Doer ¶
type Doer interface { // Do performs an operation. // // It should return an error that can be checked for retriability. Do(ctx context.Context) error }
Doer does something and returns an error.
type IntervalRetrier ¶
type IntervalRetrier struct {
// contains filtered or unexported fields
}
IntervalRetrier retries a call with an interval. The call is defined in the Doer property.
func NewIntervalRetrier ¶
func NewIntervalRetrier(doer Doer, interval time.Duration, retriable func(error) bool, optClock ...clock.WithTicker) *IntervalRetrier
NewIntervalRetrier returns a new IntervalRetrier. The optional clock is used for testing.
Click to show internal directories.
Click to hide internal directories.