Documentation
¶
Overview ¶
Package httpclient builds *http.Transport instances shared by Entire's client binaries (git-remote-entire, entiredb, entire-deploy). Centralizing transport construction means one place to honor cross-cutting knobs like ENTIRE_CONNECT_TIMEOUT_SECONDS — without forcing callers through a single *http.Client constructor, since they legitimately differ in CheckRedirect, per-client Timeout, and request-level wrapping.
Index ¶
Constants ¶
const DefaultDialTimeout = 2 * time.Second
DefaultDialTimeout is the per-host TCP connect timeout. Short by default so failover paths skip dead nodes quickly, but long enough to absorb a slow initial connect (cold DNS, TLS-fronting LB, distant region) that a tighter budget would trip; override via ENTIRE_CONNECT_TIMEOUT_SECONDS on slow links where even this trips before the node can answer.
Variables ¶
This section is empty.
Functions ¶
func DialTimeout ¶
DialTimeout returns the configured dial timeout, honoring ENTIRE_CONNECT_TIMEOUT_SECONDS. Invalid values fall back to DefaultDialTimeout with a warning to stderr.
func NewTransport ¶
NewTransport builds an *http.Transport with the configured dial timeout and a baseline TLS config. Callers wrap the returned transport with their own RoundTripper as needed (e.g. debug logging) and assemble their own *http.Client around it.
Types ¶
This section is empty.