Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
func Retry(ctx context.Context, eventName log.Event, prefix func() string, o exported.RetryOptions, fn func(ctx context.Context, callbackArgs *RetryFnArgs) error, isFatalFn func(err error) bool) error
Retry runs a standard retry loop. It executes your passed in fn as the body of the loop. It returns if it exceeds the number of configured retry options or if 'isFatal' returns true.
Types ¶
type RetryFnArgs ¶
type RetryFnArgs struct { // I is the iteration of the retry "loop" and starts at 0. // The 0th iteration is the first call, and doesn't count as a retry. // The last try will equal RetryOptions.MaxRetries I int32 // LastErr is the returned error from the previous loop. // If you have potentially expensive LastErr error // contains filtered or unexported fields }
func (*RetryFnArgs) ResetAttempts ¶
func (rf *RetryFnArgs) ResetAttempts()
ResetAttempts resets all Retry() attempts, starting back at iteration 0.
Click to show internal directories.
Click to hide internal directories.