Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyParser ¶
type BodyParser struct {
// contains filtered or unexported fields
}
BodyParser object
func (*BodyParser) GetRequest ¶
func (b *BodyParser) GetRequest() *http.Request
Gets the corresponding request context
func (*BodyParser) Parse ¶
func (b *BodyParser) Parse(dest interface{}, ct Binding) error
Parse request body to given binding, parses it into dest, so dest should be a pointer struct. Currently only parsing JSON body's is supported
Soon we'll add support for multiple bindings
type BodyParserI ¶
type BodyParserI interface { // a parser to support multiple content type parsing Parse(dest interface{}, ct Binding) error // gets the corresponding request context GetRequest() *http.Request // function that sets request object into the bodyparser struct field 'req' New(r *http.Request) }
the methods a body parser has to implement
var DefaultBodyParser BodyParserI = &BodyParser{}
the default bodyparser
Click to show internal directories.
Click to hide internal directories.