Documentation
¶
Overview ¶
Package middleware provides HTTP middlewares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chain ¶
func Chain(handler http.Handler, middlewares ...Middleware) http.Handler
Chain applies a series of middlewares to an http.Handler. The middlewares are applied in reverse order, meaning the last middleware in the list will be the first to execute when handling an HTTP request.
func EnforceJSON ¶
EnforceJSON is a middleware that ensures the incoming HTTP request has a Content-Type header set to "application/json". If the header is missing or invalid, it returns an appropriate error response (400 Bad Request or 415 Unsupported Media Type).
Types ¶
Click to show internal directories.
Click to hide internal directories.