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.
func NewWithNoTimeout ¶ added in v0.14.4
func NewWithNoTimeout() *Retrier
NewWithNoTimeout creates a new retrier with no global timeout and infinite retries.
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.