Package filters contains all the http handler chain filters which are not api related.



    This section is empty.


    This section is empty.


    func BasicLongRunningRequestCheck

    func BasicLongRunningRequestCheck(longRunningVerbs, longRunningSubresources sets.String) apirequest.LongRunningRequestCheck

      BasicLongRunningRequestCheck returns true if the given request has one of the specified verbs or one of the specified subresources, or is a profiler request.

      func NewCompressionResponseWriter

      func NewCompressionResponseWriter(w http.ResponseWriter, encoding string) (http.ResponseWriter, error)

        NewCompressionResponseWriter returns wraps w with a compression ResponseWriter, using the given encoding

        func RestfulWithCompression

        func RestfulWithCompression(function restful.RouteFunction, ctxMapper request.RequestContextMapper) restful.RouteFunction

          RestfulWithCompression wraps WithCompression to be compatible with go-restful

          func WithCORS

          func WithCORS(handler http.Handler, allowedOriginPatterns []string, allowedMethods []string, allowedHeaders []string, exposedHeaders []string, allowCredentials string) http.Handler

            WithCORS is a simple CORS implementation that wraps an http Handler. Pass nil for allowedMethods and allowedHeaders to use the defaults. If allowedOriginPatterns is empty or nil, no CORS support is installed.

            func WithCompression

            func WithCompression(handler http.Handler, ctxMapper request.RequestContextMapper) http.Handler

              WithCompression wraps an http.Handler with the Compression Handler

              func WithMaxInFlightLimit

              func WithMaxInFlightLimit(
              	handler http.Handler,
              	nonMutatingLimit int,
              	mutatingLimit int,
              	requestContextMapper apirequest.RequestContextMapper,
              	longRunningRequestCheck apirequest.LongRunningRequestCheck,
              ) http.Handler

                WithMaxInFlightLimit limits the number of in-flight requests to buffer size of the passed in channel.

                func WithPanicRecovery

                func WithPanicRecovery(handler http.Handler) http.Handler

                  WithPanicRecovery wraps an http Handler to recover and log panics.

                  func WithTimeout

                  func WithTimeout(h http.Handler, timeoutFunc func(*http.Request) (timeout <-chan time.Time, recordFn func(), err *apierrors.StatusError)) http.Handler

                    WithTimeout returns an http.Handler that runs h with a timeout determined by timeoutFunc. The new http.Handler calls h.ServeHTTP to handle each request, but if a call runs for longer than its time limit, the handler responds with a 504 Gateway Timeout error and the message provided. (If msg is empty, a suitable default message will be sent.) After the handler times out, writes by h to its http.ResponseWriter will return http.ErrHandlerTimeout. If timeoutFunc returns a nil timeout channel, no timeout will be enforced. recordFn is a function that will be invoked whenever a timeout happens.

                    func WithTimeoutForNonLongRunningRequests

                    func WithTimeoutForNonLongRunningRequests(handler http.Handler, requestContextMapper apirequest.RequestContextMapper, longRunning apirequest.LongRunningRequestCheck, timeout time.Duration) http.Handler

                      WithTimeoutForNonLongRunningRequests times out non-long-running requests after the time given by timeout.

                      func WithWaitGroup

                      func WithWaitGroup(handler http.Handler, requestContextMapper apirequest.RequestContextMapper, longRunning apirequest.LongRunningRequestCheck, wg *utilwaitgroup.SafeWaitGroup) http.Handler

                        WithWaitGroup adds all non long-running requests to wait group, which is used for graceful shutdown.


                        type Compressor

                        type Compressor interface {
                        	Flush() error

                          Compressor is an interface to compression writers