package
7.0.1+incompatible
Repository: https://github.com/apache/trafficcontrol.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
DisabledRouteHandler returns a http.Handler which returns a HTTP 5xx code to the client, and an error message indicating the route is currently disabled.
GetDefault returns the default middleware for Traffic Ops.
GetWrapAccessLog returns a Middleware which writes to the Access Log (which is the lib/go-log EventLog) after the HandlerFunc finishes.
GzipIfAccepts gzips the given bytes, writes a `Content-Encoding: gzip` header to the given writer, and returns the gzipped bytes, if the Request supports GZip (has an Accept-Encoding header).
GzipResponse takes a function which cannot error and returns only bytes, and wraps it as a http.HandlerFunc.
NotImplementedHandler returns a http.Handler which returns to the client a HTTP 501 Not Implemented status code, and a body which is a standard Traffic Ops error JSON.
RequiredPermissionsMiddleware produces a Middleware that checks that the authenticated user has all of the passed Permissions.
TimeOutWrapper is a Middleware which adds the given timeout to the request.
Use takes a slice of middlewares, and applies them in reverse order (which is the intuitive behavior) to the given HandlerFunc h.
WrapAccessLog takes the cookie secret and a http.Handler, and returns a HandlerFunc which writes to the Access Log (which is the lib/go-log EventLog) after the HandlerFunc finishes.
WrapHeaders is a Middleware which adds common headers and behavior to the handler.
WrapPanicRecover is a Middleware which adds a panic recover call to the given HandlerFunc h.
# Constants
AccessLogTimeFormat is the time format of the access log, as used by time.Time.Format.
DefaultRequestTimeout is the default request timeout, if no timeout is configured.
IMSHIT when a 304(Not Modified) was returned.
IMSMISS when anything other than a 304 was returned, meaning that something changed after the If-Modified-Since time of the request.
These are the different status values associated with an If-Modified-Since(IMS) request NONIMS when the request doesn't contain the If-Modified-Since header.
RouteID.
# Variables
ServerName is the name and version of Traffic Ops.
# Type aliases
Middleware is an HTTP dispatch "middleware" function.