Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode is decodes provided url values to destination struct. Using Decode requires your request to follow JSON API spec - If it's values contains anything except from "include", "sort", "search", "filter", "page", or query has parameters that are not tagged in dest - Decode still populates dest but also returns an error. The only error type it returns is errBadRequest that is compatible with ape (https://gitlab.com/distributed_lab/ape), so can be rendered directly to client.
func DecodeSilently ¶
DecodeSilently decodes provided url values to destination struct. Using DecodeSilently requires your request to follow JSON API spec - If it's values contains anything except from "include", "sort", "search", "filter", "page", or query has parameters that are not tagged in dest - DecodeSilently populates dest and does not return an error (where Decode returns). The only error type it returns is errBadRequest that is compatible with ape (https://gitlab.com/distributed_lab/ape), so can be rendered directly to client.
func MustEncode ¶
func MustEncode(src interface{}) string
MustEncode - encodes given struct with urlval tags into url query string. Panics on failure