Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
func Decode(w http.ResponseWriter, r *http.Request, val interface{}) error
Decode reads the body of an HTTP request looking for a JSON document. The body is decoded into the provided value.
If the provided value is a struct then it is checked for validation tags.
Types ¶
type Handler ¶
A Handler is a type that handles a http request, it differs from http.Handler because it returns an error and the context is explicitly passed.
func WrapMiddleware ¶
func WrapMiddleware(mw []Middleware, handler Handler) Handler
WrapMiddleware creates a new handler by wrapping middleware around a final handler. The middlewares' Handlers will be executed by requests in the order they are provided.
type Middleware ¶
Middleware is a function designed to run some code before and/or after another Handler. It is designed to remove boilerplate or other concerns not direct to any given Handler.