package
0.0.0-20241227184035-be8c621d8cb0
Repository: https://github.com/ainsleydev/webkit.git
Documentation: pkg.go.dev
# Functions
CORS returns a Cross-Origin Resource Sharing (CORS) middleware.
Gzip returns a middleware that compresses HTTP responses using gzip compression.
Logger is a middleware that logs the start and end of each request, along with some useful data about what was requested, what the response status was, and how long it took to return.
Minify is a middleware that minifies the response body of the request.
NonWWWRedirect redirects all requests to the non-www subdomain of the current host.
Recover is a middleware that recovers from panics, logs the panic (and a backtrace), and returns a HTTP 500 (Internal Server Error) status if possible.
RequestID assigns a unique identifier to the contact under RequestIDContextKey.
TrailingSlashRedirect is a middleware that will match request paths with a trailing slash and redirect to the same path, less the trailing slash.
URL is a middleware that sets the full URL of the request in the context.
WWWRedirect redirects all requests to the www subdomain of the current host.
# Constants
RequestIDHeader is the name of the HTTP Header which contains the request id.