Documentation ¶
Index ¶
- func WithCacheHeaderCheck(handler http.Handler) http.Handler
- func WithListRequestSelector(handler http.Handler) http.Handler
- func WithMaxInFlightLimit(handler http.Handler, limit int) http.Handler
- func WithRequestClientComponent(handler http.Handler) http.Handler
- func WithRequestContentType(handler http.Handler) http.Handler
- func WithRequestTimeout(handler http.Handler) http.Handler
- func WithRequestTrace(handler http.Handler) http.Handler
- func WithRequestTraceFull(handler http.Handler) http.Handler
- func WithSaTokenSubstitute(handler http.Handler, tenantMgr tenant.Interface) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCacheHeaderCheck ¶
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 ¶
WithListRequestSelector add label selector and field selector string in list request context.
func WithMaxInFlightLimit ¶
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 ¶
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 ¶
WithRequestContentType add req-content-type in request context. if no Accept header is set, the request will be reject with a message.
func WithRequestTimeout ¶
- WithRequestTimeout add timeout context for watch request. timeout is TimeoutSeconds plus a margin(15 seconds). the timeout context is used to cancel the request for hub missed disconnect signal from kube-apiserver when watch request is ended.
- WithRequestTimeout reduce timeout context for get/list request. timeout is Timeout reduce a margin(2 seconds). When request remote server fail, can get data from cache before client timeout.
func WithRequestTrace ¶
WithRequestTrace used to trace status code and latency for outward requests redirected from proxyserver to apiserver
func WithRequestTraceFull ¶ added in v1.0.0
WithRequestTraceFull used to trace the entire duration: coming to yurthub -> yurthub to apiserver -> leaving yurthub
Types ¶
This section is empty.