Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Retrier ¶
type Retrier struct {
// contains filtered or unexported fields
}
func New ¶
func New(timeout time.Duration, opts ...RetrierOpt) *Retrier
New creates a new retrier with a global timeout (max time allowed for the whole execution) The default retry policy is to always retry with no wait time in between retries
func NewWithMaxRetries ¶
NewWithMaxRetries creates a new retrier with no global timeout and a max retries policy
type RetrierOpt ¶
type RetrierOpt func(*Retrier)
func WithBackoffFactor ¶ added in v0.7.0
func WithBackoffFactor(factor float32) RetrierOpt
func WithMaxRetries ¶
func WithMaxRetries(maxRetries int, backOffPeriod time.Duration) RetrierOpt
WithMaxRetries sets a retry policy that will retry up to maxRetries times with a wait time between retries of backOffPeriod
func WithRetryPolicy ¶
func WithRetryPolicy(policy RetryPolicy) RetrierOpt
Click to show internal directories.
Click to hide internal directories.