handler

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 31 Imported by: 6 modules, 5 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 New added in v0.6.0

func New(ctx context.Context, t Throttler) http.Handler

New constructs a new http.Handler that deals with revision activation.

func NewContextHandler added in v0.12.0

func NewContextHandler(ctx context.Context, next http.Handler) http.Handler

NewContextHandler creates a handler that extracts the necessary context from the request and makes it available on the request's context.

Types

type ConcurrencyReporter added in v0.4.0

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

ConcurrencyReporter reports stats based on incoming requests and ticks.

func NewConcurrencyReporter

func NewConcurrencyReporter(ctx context.Context, podName string,
	reqCh chan network.ReqEvent, statCh chan []asmetrics.StatMessage) *ConcurrencyReporter

NewConcurrencyReporter creates a ConcurrencyReporter which listens to incoming ReqEvents on reqCh and ticks on reportCh and reports stats on statCh.

func (*ConcurrencyReporter) Run added in v0.4.0

func (cr *ConcurrencyReporter) Run(stopCh <-chan struct{})

Run runs until stopCh is closed and processes events on all incoming channels.

type HealthHandler added in v0.5.0

type HealthHandler struct {
	HealthCheck func() error
	NextHandler http.Handler
	Logger      *zap.SugaredLogger
}

HealthHandler handles responding to kubelet probes with a provided health check.

func (*HealthHandler) ServeHTTP added in v0.5.0

func (h *HealthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type MetricHandler added in v0.9.0

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

MetricHandler sends metrics via reporter

func NewMetricHandler added in v0.9.0

func NewMetricHandler(podName string, next http.Handler) *MetricHandler

NewMetricHandler creates a handler collects and reports request metrics

func (*MetricHandler) ServeHTTP added in v0.9.0

func (h *MetricHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ProbeHandler added in v0.4.0

type ProbeHandler struct {
	NextHandler http.Handler
}

ProbeHandler handles responding to Knative internal network probes.

func (*ProbeHandler) ServeHTTP added in v0.4.0

func (h *ProbeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RequestEventHandler

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

RequestEventHandler sends events to the given channel.

func NewRequestEventHandler

func NewRequestEventHandler(reqChan chan network.ReqEvent, next http.Handler) *RequestEventHandler

NewRequestEventHandler creates a handler that sends events about incoming/closed http connections to the given channel.

func (*RequestEventHandler) ServeHTTP

func (h *RequestEventHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Throttler added in v0.10.0

type Throttler interface {
	Try(context.Context, func(string) error) error
}

Throttler is the interface that Handler calls to Try to proxy the user request.

Jump to

Keyboard shortcuts

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