Documentation ¶
Overview ¶
Package yare maps http.Request and http.Response properties to easily JSON loggable map.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrParse = errors.New("parse error")
ErrParse indicates a parsing error.
Functions ¶
func EchoHander ¶
EchoHander returns a handler that serves HTTP requests with Echo response.
func RegisterAuthScheme ¶
func RegisterAuthScheme(scheme string, parser ParserFunc)
RegisterAuthScheme registers custom authentication credentials parser for a given scheme.
func RegisterContentType ¶
func RegisterContentType(cty string, parser ParserFunc) error
RegisterContentType registers custom content parser for a given Content-Type.
Types ¶
type Dict ¶
type Dict map[string]interface{}
A Dict represents generic key-value pairs.
func MapRequest ¶
MapRequest creates Dict from various request attributes.
func MapResponse ¶
MapResponse creates Dict from various response attributes.
func MapValues ¶
MapValues creates Dict from string multimap (like url.Values and http.Header).
Stores single values as string multi values as string array.
type ParserFunc ¶
ParserFunc used to register custom body and authorization parsers.
func (ParserFunc) Optional ¶ added in v1.3.0
func (p ParserFunc) Optional() ParserFunc
Optional returns a new ParserFunc which silently ignore errors.