Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPermanent = errors.New("permanent error, do not retry")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Exponential *ExponentialConfig Constant *ConstantConfig }
type ConstantBackoff ¶
type ConstantBackoff struct {
backoff.BackOff
}
func NewConstantBackoff ¶
func NewConstantBackoff(ctx context.Context, cfg *ConstantConfig) *ConstantBackoff
func (*ConstantBackoff) Retry ¶
func (cbo *ConstantBackoff) Retry(op Operation) error
func (*ConstantBackoff) RetryNotify ¶
func (cbo *ConstantBackoff) RetryNotify(op Operation, notify Notify) error
type ConstantConfig ¶
type ExponentialBackoff ¶
type ExponentialBackoff struct {
backoff.BackOff
}
ExponentialBackoff is a wrapper around the cenkalti exponential backoff
func NewExponentialBackoff ¶
func NewExponentialBackoff(ctx context.Context, cfg *ExponentialConfig) *ExponentialBackoff
func (*ExponentialBackoff) Retry ¶
func (ebo *ExponentialBackoff) Retry(op Operation) error
func (*ExponentialBackoff) RetryNotify ¶
func (ebo *ExponentialBackoff) RetryNotify(op Operation, notify Notify) error
type ExponentialConfig ¶
type Provider ¶
func NewProvider ¶
NewProvider returns a backoff provider based on the config on input. If no valid input is provided, a no retry backoff provider is returned instead.
type StopBackoff ¶
type StopBackoff struct {
backoff.BackOff
}
func NewStopBackoff ¶
func NewStopBackoff() *StopBackoff
func (*StopBackoff) Retry ¶
func (sbo *StopBackoff) Retry(op Operation) error
func (*StopBackoff) RetryNotify ¶
func (sbo *StopBackoff) RetryNotify(op Operation, notify Notify) error
Click to show internal directories.
Click to hide internal directories.