Documentation ¶
Overview ¶
Package decode contains decoders for various HTTP artefacts
Index ¶
- func All(dst interface{}, r *http.Request) error
- func Form(dst interface{}, r *http.Request) error
- func ID(name string, r *http.Request) (resource.ID, error)
- func Param(name string, r *http.Request) (string, error)
- func Query(dst interface{}, query url.Values) error
- func RegisterConverter(v any, fn schema.Converter)
- 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 and request path variables, respectively, with path variables taking precedence over body params, and body params over 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.
func RegisterConverter ¶ added in v0.2.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.