Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRetryTimeout timeout error for retrying ErrRetryTimeout = errors.New("retry timeout") )
Functions ¶
Types ¶
type Option ¶
type Option func(*Options)
Option ...
func InitialInterval ¶
InitialInterval set initial interval
type Options ¶
type Options struct { InitialInterval time.Duration // the initial interval for retring after failure, default 100 milliseconds MaxInterval time.Duration // the max interval for retring after failure, default 1 second Timeout time.Duration // the total time before returning if something is wrong, default 1 minute Callback func(err error, sleep time.Duration) // the callback function for Retry when the f called failed Backoff bool }
Options options for the retry functions
Click to show internal directories.
Click to hide internal directories.