Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFinsihed = errors.New("finished all attempts")
)
Functions ¶
func BackoffDelay ¶
This type of delay doubles the timeout between retries as long as it does not overflow int64 of time.Duration
func ConstantDelay ¶
The type of delay that have a constant timeout between retries. The delay is specified through Delay option
func Do ¶
func Do(task BreakableTask, opts ...Option) error
Types ¶
type BreakableTask ¶
type BreakableTask func() error
type OnRetryCallback ¶
type Option ¶
type Option func(*Config)
func Attempts ¶
Set a hard concrete number of retries. Default is 3. To retry until working, set to a number less than 1
func Context ¶
Set a context for the execution. If it has a timeout, then it will cancel the execution when the timeout is up
func DelayMethod ¶
Set the type of delay to use. Default is ConstantDelay
func OnRetry ¶
func OnRetry(callback OnRetryCallback) Option
Set a callback to be called on retries.
type RetryDelegate ¶
Click to show internal directories.
Click to hide internal directories.