Documentation
¶
Overview ¶
Package middleware defines some generic middleware.
Index ¶
- Variables
- func ErrorPage(statusCode int, f http.HandlerFunc) func(http.Handler) http.Handler
- func LogRequest(next http.Handler) http.Handler
- func Logger(r *http.Request) logrus.FieldLogger
- func Neuter(next http.Handler) http.Handler
- func SetContentType(contentType string) func(http.Handler) http.Handler
- func SetLogger(l logrus.FieldLogger) func(http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
View Source
var SetRequestID = middleware.RequestID
SetRequestID sets the request ID in the context.
Functions ¶
func LogRequest ¶
LogRequest logs information about the request.
It will panic if no logger is found in the context.
func Logger ¶
func Logger(r *http.Request) logrus.FieldLogger
Logger returns the logger for the given request.
Panics if the logger is not found.
func SetContentType ¶
SetContentType sets the content type of the response.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.