apimachineryk8s.io/apimachinery/pkg/util/net/testing Index | Files

package nettesting

import "k8s.io/apimachinery/pkg/util/net/testing"

Package nettesting contains utilities for testing networking functionality. Don't use these utilities in production code. They have not been security reviewed.

Index

Types

type HTTPProxyHandler

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

HTTPProxyHandler implements a simple handler for http_proxy and https_proxy requests for use in testing.

func NewHTTPProxyHandler

func NewHTTPProxyHandler(t TB, hook func(req *http.Request) bool) *HTTPProxyHandler

NewHTTPProxyHandler returns a new HTTPProxyHandler. It accepts an optional hook which is called early in the handler to export request state. If the hook returns false, the handler returns immediately with a server error.

func (*HTTPProxyHandler) ServeHTTP

func (h *HTTPProxyHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP handles an HTTP proxy request.

func (*HTTPProxyHandler) Wait

func (h *HTTPProxyHandler) Wait()

type TB

type TB interface {
	Logf(format string, args ...any)
}

Source Files

http.go

Version
v0.32.0-alpha.2
Published
Oct 16, 2024
Platform
js/wasm
Imports
7 packages
Last checked
3 hours ago

Tools for package owners.