Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTooManyRetries indicates that an operation did not complete within // configured retry count. ErrTooManyRetries = fmt.Errorf("too many retries") )
Functions ¶
func Do ¶
func Do(ctx context.Context, tracer tracing.Tracer, max int, f func(context.Context, int) (bool, error)) error
Do tries the function f until max attempts is reached. If f returns a true bool or a nil error retries are stopped and the error is returned.
Context cancellation is respected in between attempts.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.