Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInterrupt ¶
func Permanent ¶
Permanent makes the given error a permanent failure that stops the Retry loop immediately.
func RetryWithContext ¶
func RetryWithContext(ctx context.Context, op func(ctx context.Context) error, timeout time.Duration, minAttempts ...int) error
RetryWithContext retries the given operation until it succeeds, has a permanent failure or times out. The timeout is the minimum between the timeout of the context and the given timeout. The context given to the operation will have a timeout of a percentage of the overall timeout. The percentage is calculated from the given minimum number of attempts. If the given minimum number of attempts is 3, the timeout of each `op` call if the overall timeout / 3. The default minimum number of attempts is 2.
Types ¶
type TimeoutError ¶
type TimeoutError struct { }
func (TimeoutError) Error ¶
func (i TimeoutError) Error() string
Click to show internal directories.
Click to hide internal directories.