const invalidTimeoutInURL … // WithRequestDeadline determines the timeout duration applicable to the given request and sets a new context // with the appropriate deadline. // auditWrapper provides an http.Handler that audits a failed request. // longRunning returns true if he given request is a long running request. // requestTimeoutMaximum specifies the default request timeout value. func WithRequestDeadline(handler http.Handler, sink audit.Sink, policy audit.PolicyRuleEvaluator, longRunning request.LongRunningRequestCheck, negotiatedSerializer runtime.NegotiatedSerializer, requestTimeoutMaximum time.Duration) http.Handler { … } func withRequestDeadline(handler http.Handler, sink audit.Sink, policy audit.PolicyRuleEvaluator, longRunning request.LongRunningRequestCheck, negotiatedSerializer runtime.NegotiatedSerializer, requestTimeoutMaximum time.Duration, clock clock.PassiveClock) http.Handler { … } // withFailedRequestAudit decorates a failed http.Handler and is used to audit a failed request. // statusErr is used to populate the Message property of ResponseStatus. func withFailedRequestAudit(failedHandler http.Handler, statusErr *apierrors.StatusError, sink audit.Sink, policy audit.PolicyRuleEvaluator) http.Handler { … } // failedErrorHandler returns an http.Handler that uses the specified StatusError object // to render an error response to the request. func failedErrorHandler(s runtime.NegotiatedSerializer, statusError *apierrors.StatusError) http.Handler { … } // parseTimeout parses the given HTTP request URL and extracts the timeout query parameter // value if specified by the user. // If a timeout is not specified the function returns false and err is set to nil // If the value specified is malformed then the function returns false and err is set func parseTimeout(req *http.Request) (time.Duration, bool, error) { … } // handleError does the following: // a) it writes the specified error code, and msg to the ResponseWriter // object, it does not print the given innerErr into the ResponseWriter object. // b) additionally, it prints the given msg, and innerErr to the log with other // request scoped data that helps identify the given request. func handleError(w http.ResponseWriter, r *http.Request, code int, innerErr error, msg string) { … }