Documentation ¶
Index ¶
Constants ¶
const ( MIMEJSON = "application/json" // json MIMEYAML = "application/x-yaml" // yaml MIMEXML = "application/xml" // xml MIMEXML2 = "text/xml" // xml MIMEPOSTForm = "application/x-www-form-urlencoded" // form MIMEMultipartPOSTForm = "multipart/form-data" // form MIMEPROTOBUF = "application/x-protobuf" // protobuf MIMETOML = "application/toml" // toml MIMEHTML = "text/html" MIMEPlain = "text/plain" )
Content-Type MIME of the most common data formats.
Variables ¶
var ( JSON Binder = jsonBinder{} XML Binder = xmlBinding{} YAML Binder = yamlBinding{} Form Binder = formBinder{} FormMultipart Binder = formMultipartBinder{} ProtoBuf Binder = protobufBinding{} TOML Binder = tomlBinding{} Query Binder = queryBinding{} Header Binder = headerBinding{} URI URIBinder = uriBinding{} )
These implement the Binding interface and can be used to bind the data present in the request to struct instances.
var ( // ErrConvertMapStringSlice can not convert to map[string][]string ErrConvertMapStringSlice = errors.New("can not convert to map slices of strings") // ErrConvertToMapString can not convert to map[string]string ErrConvertToMapString = errors.New("can not convert to map of strings") )
var ( // ErrMultiFileHeader multipart.FileHeader invalid ErrMultiFileHeader = errors.New("unsupported field type for multipart.FileHeader") // ErrMultiFileHeaderLenInvalid array for []*multipart.FileHeader len invalid ErrMultiFileHeaderLenInvalid = errors.New("unsupported len of array for []*multipart.FileHeader") )
var EnableDecoderDisallowUnknownFields = false // TODO(m) migrate to binder global options
EnableDecoderDisallowUnknownFields is used to call the DisallowUnknownFields method on the JSON Decoder instance. DisallowUnknownFields causes the Decoder to return an error when the destination is a struct and the input contains object keys which do not match any non-ignored, exported fields in the destination.
var EnableDecoderUseNumber = false // TODO(m) migrate to binder global options
EnableDecoderUseNumber is used to call the UseNumber method on the JSON Decoder instance. UseNumber causes the Decoder to unmarshal a number into an interface{} as a Number instead of as a float64.
var ErrBindNonPointerValue = errors.New("can not bind to non-pointer value")
ErrBindNonPointerValue is required bind pointer