Documentation
¶
Overview ¶
Package httpretry retries a request once after a transient failure between a CDN and the service behind it, such as a 502 for a single request when the CDN could not reach the origin.
Index ¶
Constants ¶
const DefaultDelay = 1500 * time.Millisecond
DefaultDelay is how long the transport waits before its one retry: long enough for a CDN to pick another origin connection, short enough that the caller does not notice.
Variables ¶
This section is empty.
Functions ¶
func Idempotent ¶
Idempotent marks a request as safe to send twice although its method is not idempotent, for a POST the service applies the same way however often it arrives.
func Transport ¶
func Transport(base http.RoundTripper) http.RoundTripper
Transport wraps base so a request is retried once after DefaultDelay when it failed before reaching the service (any method), or when a request safe to send twice got a 502, 503 or 504 or lost its connection. A nil base means http.DefaultTransport.
Types ¶
This section is empty.