Documentation
¶
Index ¶
- Variables
- func NewRetryTransport(base http.RoundTripper) http.RoundTripper
- func NewRetryTransportWithConfig(base http.RoundTripper, retry Retry, backoff Backoff) http.RoundTripper
- func NewTracingRoundTripper(transport http.RoundTripper) http.RoundTripper
- func NewTracingRoundTripperWithLogger(transport http.RoundTripper) http.RoundTripper
- func SetRetryConfig(config RetryConfig)
- type Backoff
- type Retry
- type RetryConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultBackoff = Backoff{1.0 * time.Second, 2.0, 0.1}
View Source
var DefaultRetry = Retry{3 * time.Second, 3}
Functions ¶
func NewRetryTransport ¶ added in v0.7.135
func NewRetryTransport(base http.RoundTripper) http.RoundTripper
NewRetryTransport creates a custom HTTP transport that handles 429, 408, and 503 errors with exponential backoff. It wraps the provided transport and adds retry logic specifically for rate limiting, timeout, and service unavailable scenarios.
func NewRetryTransportWithConfig ¶ added in v0.7.135
func NewRetryTransportWithConfig(base http.RoundTripper, retry Retry, backoff Backoff) http.RoundTripper
NewRetryTransportWithConfig creates a retry transport with custom retry and backoff settings
func NewTracingRoundTripper ¶
func NewTracingRoundTripper(transport http.RoundTripper) http.RoundTripper
func NewTracingRoundTripperWithLogger ¶
func NewTracingRoundTripperWithLogger(transport http.RoundTripper) http.RoundTripper
func SetRetryConfig ¶ added in v0.7.135
func SetRetryConfig(config RetryConfig)
SetRetryConfig updates the retry configuration
Types ¶
type RetryConfig ¶ added in v0.7.135
type RetryConfig struct {
MaxWait time.Duration
MaxRetry int
Duration time.Duration
Factor float64
Jitter float64
}
RetryConfig holds the configuration for retry behavior
func GetRetryConfig ¶ added in v0.7.135
func GetRetryConfig() RetryConfig
GetRetryConfig returns the current retry configuration
Click to show internal directories.
Click to hide internal directories.