package
1.0.2-rc1
Repository: https://github.com/zrhoffman/trafficcontrol.git
Documentation: pkg.go.dev

# Packages

Package middleware provides symbols for HTTP "middleware" which wraps handlers to perform common behaviors, such as authentication, headers, and compression.

# Functions

CompileRoutes - takes a map of methods to paths and handlers, and returns a map of methods to CompiledRoutes.
CreateRouteMap returns a map of methods to a slice of paths and handlers; wrapping the handlers in the appropriate middleware.
CreateThrottledHandler takes a handler, and a max and uses a channel to insure the handler is used concurrently by only max number of routines.
No description provided by the author
GetRouteIDMap takes a []int Route IDs and converts it into a map for fast lookup.
Handler - generic handler func used by the Handlers hooking into the routes.
IsRequestAPIAndUnknownVersion returns true if the request starts with `/api` and is a version not in the list of versions.
No description provided by the author
RegisterRoutes - parses the routes and registers the handlers with the Go Router.
Routes returns the API routes, raw non-API root level routes, and a catchall route for when no route matches.

# Constants

Authenticated ...
NoAuth ...
TODO config?.

# Structs

CompiledRoute ...
PathHandler ...
RawRoute is an HTTP route to be served at the root, rather than under /api/version.
Route ...
ServerData ...
ThrottledHandler ...