httpfactory

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 16 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupHttpClientsFactory

func SetupHttpClientsFactory(k8s client.Client, logger logr.Logger) error

func SetupHttpClientsForTesting

func SetupHttpClientsForTesting(client *http.Client)

Types

type DefaultHttpClientsFactory

type DefaultHttpClientsFactory struct {
	// contains filtered or unexported fields
}

DefaultHttpClientsFactory is a thread-safe, caching implementation of HttpClientsFactory. It caches one HTTP client and one health-check client, rebuilding either only when the relevant routing configuration (proxy settings, TLS certificates) changes.

func (*DefaultHttpClientsFactory) GetHealthCheckHttpClient

func (h *DefaultHttpClientsFactory) GetHealthCheckHttpClient() *http.Client

func (*DefaultHttpClientsFactory) GetHttpClient

func (h *DefaultHttpClientsFactory) GetHttpClient(ctx context.Context, routingConfig *controller.RoutingConfig) *http.Client

type HttpClientsFactory

type HttpClientsFactory interface {
	// GetHttpClient returns an HTTP client configured with proxy, TLS, and custom CA certificates
	// from routingConfig.
	GetHttpClient(context.Context, *controller.RoutingConfig) *http.Client

	// GetHealthCheckHttpClient returns an HTTP client that skips TLS verification.
	// This client MUST only be used for workspace health/readiness checks, not for
	// fetching external content or making security-sensitive requests.
	GetHealthCheckHttpClient() *http.Client
}
var HttpFactory HttpClientsFactory

type TestHttpClientsFactory

type TestHttpClientsFactory struct {
	// contains filtered or unexported fields
}

func (*TestHttpClientsFactory) GetHealthCheckHttpClient

func (t *TestHttpClientsFactory) GetHealthCheckHttpClient() *http.Client

func (*TestHttpClientsFactory) GetHttpClient

Jump to

Keyboard shortcuts

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