httputils

package
v0.17.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package httputils holds helpers shared by the HTTP clients Fleet uses to reach remote content: Helm repositories, OCI registries and git servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent is the value Fleet sends in the User-Agent header of its outbound requests, so that registry and git server operators can tell Fleet's traffic apart from other clients'.

Types

type UserAgentTransport

type UserAgentTransport struct {
	Next http.RoundTripper
}

UserAgentTransport stamps UserAgent on the requests passing through it before handing them over to the transport it wraps. It leaves a request which already carries a User-Agent alone, so that a caller spelling out its own keeps it.

Setting it as the Transport of a client covers every request that client sends, including the ones libraries such as Helm and ORAS build out of Fleet's reach.

func (UserAgentTransport) CloseIdleConnections

func (t UserAgentTransport) CloseIdleConnections()

CloseIdleConnections forwards to the wrapped transport, so that http.Client.CloseIdleConnections keeps working on a client using it.

func (UserAgentTransport) RoundTrip

func (t UserAgentTransport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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