util

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsKubeletGetNodeReq added in v1.5.0

func IsKubeletGetNodeReq(req *http.Request) bool

IsKubeletGetNodeReq judge whether the request is a get node request from kubelet

func IsKubeletLeaseReq added in v1.2.0

func IsKubeletLeaseReq(req *http.Request) bool

IsKubeletLeaseReq judge whether the request is a lease request from kubelet

func IsListRequestWithNameFieldSelector added in v1.2.0

func IsListRequestWithNameFieldSelector(req *http.Request) bool

IsListRequestWithNameFieldSelector will check if the request has FieldSelector "metadata.name". If found, return true, otherwise false.

func IsSubjectAccessReviewCreateGetRequest added in v1.2.0

func IsSubjectAccessReviewCreateGetRequest(req *http.Request) bool

func WithListRequestSelector

func WithListRequestSelector(handler http.Handler) http.Handler

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

func WithObjectFilter added in v1.7.0

func WithObjectFilter(handler http.Handler, filterFinder filter.FilterFinder) http.Handler

func WithPartialObjectMetadataRequest added in v1.7.0

func WithPartialObjectMetadataRequest(handler http.Handler) http.Handler

WithPartialObjectMetadataRequest is used for extracting info for partial object metadata request, then these info is used by cache manager.

func WithRequestClientComponent

func WithRequestClientComponent(handler http.Handler) http.Handler

WithRequestClientComponent adds user agent header in request context.

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 WithRequestForPoolScopeMetadata added in v1.7.0

func WithRequestForPoolScopeMetadata(handler http.Handler, resolveRequestForPoolScopeMetadata func(req *http.Request) (bool, bool)) http.Handler

WithRequestForPoolScopeMetadata add marks in context for specifying whether a request is used for list/watching pool scope metadata or not, moreover, request for pool scope metadata should be served by multiplexer manager or forwarded to outside.

func WithRequestTimeout

func WithRequestTimeout(handler http.Handler) http.Handler
  1. 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.
  2. 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

func WithRequestTrace(handler http.Handler) http.Handler

WithRequestTrace used to trace status code and request metrics. at the same time, print detailed logs of request at start and end serving point.

func WithSaTokenSubstitute added in v0.7.0

func WithSaTokenSubstitute(handler http.Handler, tenantMgr tenant.Interface) http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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