Documentation
¶
Index ¶
- Constants
- func DoNotRetry(err error) error
- type Backoff
- type BackoffOption
- func WithBackoffInitialInterval(initialInterval time.Duration) BackoffOption
- func WithBackoffMaxInterval(maxInterval time.Duration) BackoffOption
- func WithBackoffMaxRetries(maxRetries int) BackoffOption
- func WithBackoffMultiplier(multiplier float64) BackoffOption
- func WithBackoffRandomizationFactor(randomizationFactor float64) BackoffOption
- type ErrDoNotRetry
- type Retryer
Constants ¶
View Source
const ( DefaultInitialInterval = 500 * time.Millisecond DefaultMaxRetries = 100 DefaultMaxInterval = 60 * time.Second DefaultMultiplier float64 = 1.5 DefaultRandomizationFactor float64 = 0.5 )
View Source
const ( CannotBeRetried = "this operation cannot be retried" MaxRetriesExceeded = "this operation exceeded the maximum number of retries" MaxElapsedExceeded = "this operation exceeded the maximum time allowed to complete" )
Variables ¶
This section is empty.
Functions ¶
func DoNotRetry ¶
Types ¶
type Backoff ¶
type Backoff struct {
// contains filtered or unexported fields
}
func NewBackoff ¶
func NewBackoff(options ...BackoffOption) *Backoff
func NewConstantBackoff ¶
func NewConstantBackoff(options ...BackoffOption) *Backoff
func NewExponentialBackoff ¶
func NewExponentialBackoff(options ...BackoffOption) *Backoff
type BackoffOption ¶
type BackoffOption func(*Backoff)
func WithBackoffInitialInterval ¶
func WithBackoffInitialInterval(initialInterval time.Duration) BackoffOption
func WithBackoffMaxInterval ¶
func WithBackoffMaxInterval(maxInterval time.Duration) BackoffOption
func WithBackoffMaxRetries ¶
func WithBackoffMaxRetries(maxRetries int) BackoffOption
func WithBackoffMultiplier ¶
func WithBackoffMultiplier(multiplier float64) BackoffOption
func WithBackoffRandomizationFactor ¶
func WithBackoffRandomizationFactor(randomizationFactor float64) BackoffOption
type ErrDoNotRetry ¶
type ErrDoNotRetry struct {
// contains filtered or unexported fields
}
func (*ErrDoNotRetry) Error ¶
func (e *ErrDoNotRetry) Error() string
func (*ErrDoNotRetry) Unwrap ¶
func (e *ErrDoNotRetry) Unwrap() error
Click to show internal directories.
Click to hide internal directories.