Documentation ¶
Index ¶
- func CustomContext(ctx context.Context) inbuilt.Middleware
- func HTTPSOnly(next inbuilt.Handler, req *http.Request) *http.Response
- func LogRequests(loggers ...Logger) inbuilt.Middleware
- func Recover(next inbuilt.Handler, req *http.Request) (resp *http.Response)
- func Redirect(from, to string) inbuilt.Middleware
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomContext ¶ added in v0.13.0
func CustomContext(ctx context.Context) inbuilt.Middleware
func HTTPSOnly ¶ added in v0.10.2
HTTPSOnly redirects all http requests to https. In case no Host header is provided, 400 Bad Request will be returned without calling the actual handler.
Note: it causes 1 (one) allocation
func LogRequests ¶ added in v0.13.0
func LogRequests(loggers ...Logger) inbuilt.Middleware
func Recover ¶
Recover is a basic middleware that catches any panics, logs it and returns 500 Internal Server Error
func Redirect ¶ added in v0.13.0
func Redirect(from, to string) inbuilt.Middleware
Types ¶
Click to show internal directories.
Click to hide internal directories.