Documentation ¶
Overview ¶
Package params unifies access to httprouter, POST, PUT, GET, etc., parameters and automatically converts parameters from string to the destination type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct { // AfterParse is called after Parse executed successfully. It is useful for // operations that should occur after parsing, like validation. AfterParse func(dest interface{}) error // contains filtered or unexported fields }
Parser parses httprouter, POST, PUT, GET, etc., parameters.
func (*Parser) Parse ¶
Parse takes a pointer to a struct, and for each struct field it tries to find a corresponding parameter, converts the parameter from string to the struct field’s type and writes it to the struct field. A struct field and parameter correspond when the parameter name matches the lowercased struct field name.
Click to show internal directories.
Click to hide internal directories.