middleware

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counting

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

func NewCounting added in v0.14.0

func NewCounting(next http.Handler, queueCounter queue.Counter, instruments *metrics.Instruments) *Counting

func (*Counting) ServeHTTP

func (cm *Counting) ServeHTTP(w http.ResponseWriter, r *http.Request)

type EndpointResolver added in v0.14.0

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

func NewEndpointResolver added in v0.14.0

func NewEndpointResolver(next http.Handler, readyCache *k8s.ReadyEndpointsCache, cfg EndpointResolverConfig) *EndpointResolver

NewEndpointResolver returns a middleware that resolves a ready backend endpoint for each request. It waits for at least one endpoint to become ready (handling cold starts) and optionally falls back to an alternate upstream when the backend does not become ready in time.

func (*EndpointResolver) ServeHTTP added in v0.14.0

func (er *EndpointResolver) ServeHTTP(w http.ResponseWriter, r *http.Request)

type EndpointResolverConfig added in v0.14.0

type EndpointResolverConfig struct {
	ReadinessTimeout      time.Duration
	EnableColdStartHeader bool
}

type Logging

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

func NewLogging

func NewLogging(next http.Handler, logger logr.Logger) *Logging

func (*Logging) ServeHTTP

func (lm *Logging) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Metrics added in v0.8.0

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

Metrics records request count and duration with bounded route identity labels. It creates a routeInfo in the request context before calling next, and reads the (potentially mutated) routeInfo after next returns to set metric labels.

func NewMetrics added in v0.8.0

func NewMetrics(next http.Handler, instruments *metrics.Instruments) *Metrics

func (*Metrics) ServeHTTP added in v0.8.0

func (m *Metrics) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Routing

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

func NewRouting

func NewRouting(next http.Handler, routingTable routing.Table, reader client.Reader, tlsEnabled bool, requestTimeout time.Duration) *Routing

func (*Routing) ServeHTTP

func (rm *Routing) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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