Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRetry ¶
CheckRetry checks if retry is allowed, and if it is allowed, it will sleep for the backoff duration. It is used when the function to be retried takes in arguments or returns a result.
func Retry ¶
func Retry(f Retryable, p RetryPolicy, isRetryable IsErrorRetryable) error
Retry will retry the given function until it succeeded or hit maximum number of retries then return last error.
Types ¶
type IsErrorRetryable ¶
IsErrorRetryable could be used to exclude certain errors during retry
type Retrier ¶
Retrier is interface for managing backoff.
func NewRetrier ¶
func NewRetrier(policy RetryPolicy) Retrier
NewRetrier is used for creating a new instance of Retrier
type RetryPolicy ¶
RetryPolicy is interface for defining retry policy.
func NewRetryPolicy ¶
func NewRetryPolicy(maxAttempts int, retryInterval time.Duration) RetryPolicy
NewRetryPolicy is used to create a new instance or RetryPolicy.
Click to show internal directories.
Click to hide internal directories.