Documentation
¶
Overview ¶
Package decode contains decoders for various HTTP artefacts
Index ¶
- func All(dst interface{}, r *http.Request) error
- func Decode(dst interface{}, src map[string][]string) error
- func Form(dst interface{}, r *http.Request) error
- func ID(name string, r *http.Request) (resource.TfeID, error)
- func Param(name string, r *http.Request) (string, error)
- func Query(dst interface{}, query url.Values) error
- func Route(dst interface{}, r *http.Request) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
All populates the struct pointed to by dst with query params, req body params, cookie values, and request path variables, with the following precedence: 1. cookies 2. path variables 3. body params 4. query params
func ID ¶ added in v0.3.6
ID retrieves a single parameter by name from the request and parses into a resource ID.
func Param ¶
Param retrieves a single parameter by name from the request, first checking the body (if POST/PUT/PATCH) and the query, falling back to looking for a path variable.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.