decoder

package
v0.0.0-...-60a913f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2015 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrContentTypeUndefined is returned when the request does not include the
	// Content-Type header.
	ErrContentTypeUndefined = fmt.Errorf("Content-Type is undefined")

	// ErrDecoderNotImplemented is returned if the Content-Type does not match
	// one of the defined decoders, i.e.
	//    "application/json" => jsonDecode
	//    "application/xml" => undefined and this error is return
	ErrDecoderNotImplemented = fmt.Errorf("Decoding is not yet implement")
)

Functions

func Decode

func Decode(req *http.Request, v interface{}) error

Decode will ready the body of the HTTP request and attempt to unmarshall the content into the supplied interface. If the content-type of the request is not one that matches a known decoder, then an error will be thrown

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL