Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RetryOnAnyError = func(error) bool { return true }
Functions ¶
Types ¶
type BackOffOpts ¶
type BackOffOpts struct { InitialInterval time.Duration MaxInterval time.Duration MaxElapsedTime time.Duration }
var DefaultBackOffOpts *BackOffOpts = &BackOffOpts{ InitialInterval: 500 * time.Millisecond, MaxInterval: 3 * time.Second, MaxElapsedTime: 10 * time.Second}
type Retrier ¶
type Retrier struct { Name string // contains filtered or unexported fields }
func New ¶
func New(name string, backOffOpts *BackOffOpts, shouldRetryFunc func(error) bool) *Retrier
Retrier without logging functions included as defaults for notify funcs
func NewErrorTypeRetrier ¶
func NewErrorTypeRetrier(name string, backOffOpts *BackOffOpts, errorTypes ...interface{}) *Retrier
func NewRetrier ¶
func NewRetrier(name string, backOffOpts *BackOffOpts, shouldRetryFunc func(error) bool) *Retrier
func (*Retrier) AddNotifyGaveUp ¶
func (r *Retrier) AddNotifyGaveUp(f RetryNotifier)
func (*Retrier) AddNotifyRetry ¶
func (r *Retrier) AddNotifyRetry(f RetryNotifier)
func (*Retrier) SetBackOffOpts ¶
func (r *Retrier) SetBackOffOpts(b *BackOffOpts)
type RetryEvent ¶
type RetryNotifier ¶
type RetryNotifier func(*RetryEvent)
Click to show internal directories.
Click to hide internal directories.