Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRetryLimited ertryable function must be set limit, Either, timeout or number of retries ErrRetryLimited = errors.New("no attempt limited") )
Functions ¶
This section is empty.
Types ¶
type RetryConfig ¶
type RetryConfig struct {
// contains filtered or unexported fields
}
RetryConfig config of retryable function
func NewRetryConfig ¶
func NewRetryConfig(options ...RetryOptions) *RetryConfig
NewRetryConfig get retry config
type RetryOptions ¶
type RetryOptions func(rc *RetryConfig)
RetryOptions options for retryable function
func WithCounter ¶
func WithCounter(counter int) RetryOptions
WithCounter set attempt num for fretryable function
func WithExpire ¶
func WithExpire(timeout time.Duration) RetryOptions
WithExpire set expire time for fretryable function
func WithInterval ¶
func WithInterval(interval time.Duration) RetryOptions
WithInterval set interval time for fretryable function
Click to show internal directories.
Click to hide internal directories.