Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
MaxAttempts int
InitialDelay time.Duration
MaxDelay time.Duration
Multiplier float64
RetryUnknown bool
}
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the recommended retry configuration: 4 attempts with exponential backoff (2s → 4s → 8s, capped at 30s, then scaled by a random factor in [0.5, 1.0) to decorrelate concurrent retries). RetryUnknown is false, so only errors implementing Retryable are retried — plain errors fail fast on the first attempt.
Returns a fresh value each call so caller mutations don't bleed into anyone else's config.
Click to show internal directories.
Click to hide internal directories.