Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
Retry is a helper function to retry an operation with the given strategy. It returns an error if the operation fails after all retries.
func RetryExponential ¶
RetryExponential is a helper function to retry an operation with exponential backoff.
func RetryFixed ¶
RetryFixed is a helper function to retry an operation with fixed backoff.
Types ¶
type Strategy ¶
type Strategy struct { // Maximum number of retries before giving up (inclusive) // Default is 5 MaxRetries int // Maximum number of retries before giving up (inclusive) // Maximum delay to use between retries (in milliseconds) // If Exponential is true, this is the initial delay // Default is 1000 Delay int // Whether to use exponential backoff or not (if false, constant delay is used) // Default is false Exponential bool // Maximum duration to wait between retries (in milliseconds) // Default is 10 seconds MaxDuration time.Duration }
Strategy is a configuration for the backoff strategy to use when retrying operations.
Click to show internal directories.
Click to hide internal directories.