httpfactory

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

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