Documentation
¶
Overview ¶
Package retry provides retry logic with exponential backoff and jitter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShouldRetry ¶
ShouldRetry determines if a request should be retried based on the error or status code.
Types ¶
type Config ¶
type Config struct {
// MaxRetries is the maximum number of retry attempts.
MaxRetries int
// BaseDelay is the initial delay before the first retry.
BaseDelay time.Duration
// MaxDelay is the maximum delay between retries.
MaxDelay time.Duration
// Multiplier is the factor by which the delay increases after each retry.
Multiplier float64
}
Config holds configuration for the retry mechanism.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default retry configuration.
Click to show internal directories.
Click to hide internal directories.