Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultBackoffStrategy ¶
func DefaultBackoffStrategy() retry.Backoff
DefaultBackoffStrategy returns the default backoff strategy. The default backoff strategy is an exponential backoff with a maximum duration and maximum retries.
func RetryableError ¶
RetryableError marks an error as retryable.
Types ¶
type RetryConfig ¶
type RetryConfig struct {
// BackoffStrategy is the backoff strategy to use.
BackoffStrategy retry.Backoff
}
RetryConfig is the configuration for a retry operation.
type Retryer ¶
type Retryer struct {
// contains filtered or unexported fields
}
Retryer is a utility for retrying functions.
func NewDefaultRetryer ¶
func NewDefaultRetryer() *Retryer
NewDefaultRetryer creates a new Retryer with the default configuration. The default configuration is an exponential backoff with a maximum duration and maximum retries.
func NewNoOpRetryer ¶
func NewNoOpRetryer() *Retryer
NewNoOpRetryer creates a new Retryer that does not retry. This is useful for testing.
func NewRetryer ¶
func NewRetryer(config *RetryConfig) *Retryer
NewRetryer creates a new Retryer with the given configuration. If either the config or config.BackoffStrategy are nil, the default configuration is used. The default configuration is an exponential backoff with a maximum duration and maximum retries.