Documentation ¶
Overview ¶
Package fetch contains the HTTP client that just-install uses to download installers over HTTP(S). It mostly contains functions built on top of Go's HTTP client.
Index ¶
Constants ¶
const ConnectionPhaseTimeout = 5 * time.Second
ConnectionPhaseTimeout is the timeout used as upper bound for various phases of the connection to a remote host (i.e. establishing a TCP connection, TLS handshake, etc). This is kept as short as possible to immediately catch transient network errors.
const RequestTimeout = 30 * time.Minute
RequestTimeout is the timeout used as the upper bound for an entire HTTP request, including the time needed to download the requested file.
Variables ¶
var Transport = &http.Transport{ DialContext: (&net.Dialer{ DualStack: true, KeepAlive: 0, Timeout: ConnectionPhaseTimeout, }).DialContext, DisableKeepAlives: true, ExpectContinueTimeout: ConnectionPhaseTimeout, IdleConnTimeout: ConnectionPhaseTimeout, MaxConnsPerHost: 1, Proxy: http.ProxyFromEnvironment, ResponseHeaderTimeout: ConnectionPhaseTimeout, TLSHandshakeTimeout: ConnectionPhaseTimeout, }
Transport is an HTTP transport optimized to perform a sigle request to a single host, with short timeouts for various connection phases.
Functions ¶
Types ¶
This section is empty.