httpclient

package
v0.15.51 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 3 Imported by: 1 module, 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 httpclient makes the client ar2 reads what isn't GitHub's API with.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger *slog.Logger) *http.Client

New returns a client that retries what a server failed for a moment, and carries no token.

It is for what isn't GitHub's API: an asset, a signature, a certificate a definition names, a forge. The GitHub token is GitHub's, and a host anywhere else has no business being handed it, so it starts from a client without one.

A server error, a rate limit and a connection that failed are retried, which is what a run would otherwise wait a whole lap to try again. What the server says once the retries run out is passed through as the response rather than replaced with an error, because the status is what decides whether an asset is missing or the moment was bad: a 404 is the release, a 503 is the server.

aqua's own downloader retries on its own, so it is given a client that doesn't: see Plain.

func Plain

func Plain() *http.Client

Plain returns a client that neither retries nor carries a token, for aqua's downloader, which adds the retries itself: giving it a client that retries already would retry each of its retries.

func Retryable

func Retryable(logger *slog.Logger, client *http.Client) *http.Client

Retryable wraps client with the retries New describes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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