httpclient

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package httpclient exposes a single shared *http.Client for all install-path HTTP traffic (recipe fetches, GHCR token exchange, GHCR blob downloads, registry index fetches).

Why share one client? Each *http.Client owns a *http.Transport whose idle-connection pool is the only thing that keeps TCP + TLS connections warm between requests. Constructing a fresh client per call — the previous pattern — gives every request its own empty pool, so a multi-package sync paid for a new TCP handshake and a new TLS negotiation on every recipe fetch and every token exchange.

The shared client deliberately has no per-client Timeout. The install pipeline serves both short metadata fetches (seconds) and long binary downloads (minutes); callers enforce per- request budgets via context.WithTimeout instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default() *http.Client

Default returns the process-wide shared HTTP client. Callers pass a context with their own per-request timeout via http.NewRequestWithContext rather than relying on a client- level Timeout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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