Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeBinary = "application/octet-stream" ContentTypeForm = "application/x-www-form-urlencoded" ContentTypeJSON = "application/json" ContentTypeYaml = "application/x-yaml" ContentTypeToml = "application/toml" ContentTypeHTML = "text/html" ContentTypeText = "text/plain" ContentTypeXML = "application/xml" ContentTypeXML2 = "text/xml" ContentTypeMultipartPostForm = "multipart/form-data" ContentTypeProtoBuf = "application/x-protobuf" ContentTypeMsgPack = "application/x-msgpack" ContentTypeMsgPack2 = "application/msgpack" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Binding ¶
Binding describes the interface which needs to be implemented for binding the data present in the request such as JSON request body, query parameters or the form POST.
func NewJSONBinding ¶
func NewJSONBinding(opts ...JSONBindingOption) Binding
type JSONBinding ¶
type JSONBinding struct {
// contains filtered or unexported fields
}
func (*JSONBinding) Apply ¶
func (binding *JSONBinding) Apply(opts ...JSONBindingOption)
func (*JSONBinding) ContentType ¶
func (binding *JSONBinding) ContentType() []string
type JSONBindingOption ¶
type JSONBindingOption func(*JSONBinding)
func WithDisallowUnknownFields ¶
func WithDisallowUnknownFields(enable bool) JSONBindingOption
func WithUseNumber ¶
func WithUseNumber(enable bool) JSONBindingOption
Click to show internal directories.
Click to hide internal directories.