httpclient

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 7 Imported by: 0

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

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

func DialTimeout() time.Duration

DialTimeout returns the configured dial timeout, honoring ENTIRE_CONNECT_TIMEOUT_SECONDS. Invalid values fall back to DefaultDialTimeout with a warning to stderr.

func NewTransport

func NewTransport(skipTLSVerify bool) *http.Transport

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.

Jump to

Keyboard shortcuts

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