MCPcopy Create free account
hub / github.com/conforma/cli / NewRetryTransport

Function NewRetryTransport

internal/http/retry.go:78–87  ·  view source on GitHub ↗

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.

(base http.RoundTripper)

Source from the content-addressed store, hash-verified

76// with exponential backoff. It wraps the provided transport and adds retry
77// logic specifically for rate limiting, timeout, and service unavailable scenarios.
78func NewRetryTransport(base http.RoundTripper) http.RoundTripper {
79 if base == nil {
80 base = http.DefaultTransport
81 }
82 return &retryTransport{
83 base: base,
84 retry: DefaultRetry,
85 backoff: DefaultBackoff,
86 }
87}
88
89// NewRetryTransportWithConfig creates a retry transport with custom retry and backoff settings
90func NewRetryTransportWithConfig(base http.RoundTripper, retry Retry, backoff Backoff) http.RoundTripper {

Calls

no outgoing calls