httpclient

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientTimeout = 10 * time.Second

overridden by client config if specified

View Source
var LongOpTimeout = 15 * time.Minute

bounds long-running operations against worker apis, such as image pulls

Functions

func ConfigureManagerClient

func ConfigureManagerClient(opts Options)

func ConfigureWorkerClient

func ConfigureWorkerClient(opts Options)

func Manager

func Manager() *http.Client

client for reaching the manager api

func ManagerScheme

func ManagerScheme() string

reports the URL scheme ("http" or "https") currently configured for manager API URLs

func ManagerURL

func ManagerURL(address, path string) string

builds a manager API URL in the configured scheme: "<scheme>://<address><path>". address is a "host:port" pair

func Plain

func Plain() *http.Client

no tls no auth

func Reset

func Reset()

intended for testing

func Worker

func Worker() *http.Client

used by the manager to reach worker apis

func WorkerLongOp

func WorkerLongOp() *http.Client

client for long-running operations against worker apis shares the worker client's TLS/auth transport, but uses LongOpTimeout

func WorkerScheme

func WorkerScheme() string

reports the URL scheme ("http" or "https") currently configured for worker API URLs

func WorkerURL

func WorkerURL(address, path string) string

builds a worker API URL in the configured scheme: "<scheme>://<address><path>". address is a "host:port" pair

Types

type Options

type Options struct {
	// enables HTTPS, nil keeps plain HTTP
	TLSConfig *tls.Config

	// when set, is sent as "Authorization: Bearer <token>" on
	// every request made by the configured client
	BearerToken string
}

zero value = plan http, no config

Jump to

Keyboard shortcuts

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