util

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCacheHeaderCheck

func WithCacheHeaderCheck(handler http.Handler) http.Handler

WithCacheHeaderCheck add cache agent for response cache in default mode, only kubelet, kube-proxy, flanneld, coredns User-Agent can be supported to cache response. and with Edge-Cache header is also supported.

func WithListRequestSelector

func WithListRequestSelector(handler http.Handler) http.Handler

WithListRequestSelector add label selector and field selector string in list request context.

func WithMaxInFlightLimit

func WithMaxInFlightLimit(handler http.Handler, limit int) http.Handler

WithMaxInFlightLimit limits the number of in-flight requests. and when in flight requests exceeds the threshold, the following incoming requests will be rejected.

func WithRequestClientComponent

func WithRequestClientComponent(handler http.Handler) http.Handler

WithRequestClientComponent add component field in request context. component is extracted from User-Agent Header, and only the content before the "/" when User-Agent include "/".

func WithRequestContentType

func WithRequestContentType(handler http.Handler) http.Handler

WithRequestContentType add req-content-type in request context. if no Accept header is set, the request will be reject with a message.

func WithRequestTimeout

func WithRequestTimeout(handler http.Handler) http.Handler

func WithRequestTrace

func WithRequestTrace(handler http.Handler) http.Handler

WithRequestTrace used to trace status code and handle time for request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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