Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRetry = errors.New("retry") ErrExit = errors.New("exit") )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Retry)
func WithContext ¶
WithContext sets the ctx for Infinite policy retry
func WithMaxAttempts ¶
WithMaxAttempts sets the maximum number of attempts
type Retry ¶
type Retry struct {
// contains filtered or unexported fields
}
Retry represents a retry mechanism
func New ¶
New creates a new Retry instance
maxAttempts: the maximum number of attempts. Default is 5
policy: the retry policy. Default is PolicyBackoff
func (*Retry) SetMaxAttempts ¶
SetMaxAttempts sets the maximum number of attempts
Click to show internal directories.
Click to hide internal directories.