Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DelayFunc ¶
func BackOffDelay ¶
BackOffDelay is a DelayType which increases delay between consecutive retries Delay set delay between retry, default is 100ms
func FixedDelay ¶
FixedDelay is a DelayType which keeps delay the same through all iterations
func RandomDelay ¶
RandomDelay is a DelayType which picks a random delay up to maxJitter
type Error ¶
type Error []error
Error type represents list of errors in retry
func (Error) Error ¶
Error method return string representation of Error It is an implementation of error interface
func (Error) Last ¶
return the direct last error that came from the retried function default is false (return wrapped errors with everything)
func (Error) Unwrap ¶
Unwrap the last error for compatibility with `errors.Unwrap()`. When you need to unwrap all errors, you should use `WrappedErrors()` instead.
err := Do( func() error { return errors.New("original error") }, Attempts(1), ) fmt.Println(errors.Unwrap(err)) # "original error" is printed
Added in version 4.2.0.
func (Error) WrappedErrors ¶
WrappedErrors returns the list of errors that this Error is wrapping. It is an implementation of the `errwrap.Wrapper` interface in package [errwrap](https://github.com/hashicorp/errwrap) so that `retry.Error` can be used with that library.