Documentation ¶
Index ¶
- func AuthF(next func(http.ResponseWriter, *http.Request)) http.Handler
- func AuthH(next http.Handler) http.Handler
- func BodyF(bodyStruct interface{}) func(func(http.ResponseWriter, *http.Request)) http.Handler
- func BodyH(bodyStruct interface{}) func(http.Handler) http.Handler
- func CORS(h http.Handler) http.Handler
- func ParamsF(next func(http.ResponseWriter, *http.Request)) http.Handler
- func ParamsH(next http.Handler) http.Handler
- func Recover(h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthF ¶
AuthF is a middleware that checks if the user is logged in by validating the token provided in the Authorization header
func AuthH ¶
AuthH is a middleware that checks if the user is logged in by validating the token provided in the Authorization header
func BodyF ¶
BodyF is a middleware that takes a struct and a controller function. It parses the request body into the given struct and pushes it into the request's context using the BodyCtxKey
func BodyH ¶
BodyH is a middleware that takes a struct and a request handler. It parses the request body into the given struct and pushes it into the request's context using the BodyCtxKey
func ParamsF ¶
ParamsF is a middleware that takes a controller function and pushes the request path parameters into the request's context using the ParamsCtxKey.
Types ¶
This section is empty.