httpretry

package
v2.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: GPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func Idempotent(ctx context.Context) context.Context

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL