Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ITemporaryError ¶
type ITemporaryError interface {
error
}
ITemporaryError is an interface for temporary errors.
type Retrier ¶
type Retrier struct {
// MaxRetries is the maximum number of retries.
MaxRetries int
// Jitter is the amount of jitter to apply to the retry interval.
Jitter time.Duration
// Timeout is the timeout for the retry function.
Timeout time.Duration
// Registry is the registry for temporary errors.
Registry *registry
// contains filtered or unexported fields
}
Retrier is a type that retries a function until it returns a nil error or the maximum number of retries is reached.
func NewRetrier ¶
NewRetrier returns a new Retrier.
func (*Retrier) IsTemporaryError ¶
IsTemporaryError checks if the error is in the list of temporary errors.
func (*Retrier) Retry ¶
Retry retries a function until it returns a nil error or the maximum number of retries is reached.
func (*Retrier) SetRegistry ¶
func (r *Retrier) SetRegistry(reg *registry)
SetRegistry sets the registry for temporary errors.
type RetryError ¶
RetryError is an error returned by the Retry function when the maximum number of retries is reached.
func (*RetryError) Unwrap ¶
func (e *RetryError) Unwrap() error
Unwrap returns the underlying error.
Click to show internal directories.
Click to hide internal directories.