Documentation
¶
Overview ¶
Package decoder provides decoders.
Index ¶
Constants ¶
const ( // ContentTypeFormURL content-type header for url form decoder. ContentTypeFormURL = "application/x-www-form-urlencoded" // SplitSymbol array split symbol. SplitSymbol = "," )
const (
// ContentTypeJSON content-type header for json decoder.
ContentTypeJSON = "application/json"
)
const (
// ContentTypeMultipartFormData content-type header for multipart form-data decoder.
ContentTypeMultipartFormData = "multipart/form-data"
)
const (
// ContentTypeXML content-type header for xml decoder.
ContentTypeXML = "application/xml"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormURL ¶
type FormURL struct {
// contains filtered or unexported fields
}
FormURL url form decoder.
func NewFormURL ¶
func NewFormURL(opts ...FormURLOptionsFunc) *FormURL
NewFormURL returns new url form decoder.
func (*FormURL) ContentType ¶
ContentType returns content type of url form decoder.
type FormURLOptionsFunc ¶
type FormURLOptionsFunc func(*FormURL)
FormURLOptionsFunc function for setting options.
func WithDisabledSplit ¶
func WithDisabledSplit() FormURLOptionsFunc
WithDisabledSplit disables array splitting.
func WithSplitSymbol ¶
func WithSplitSymbol(splitSymbol string) FormURLOptionsFunc
WithSplitSymbol sets array split symbol.
type JSON ¶
type JSON struct{}
JSON json decoder.
func (*JSON) ContentType ¶
ContentType returns content-type header value.
type MultipartFile ¶ added in v1.5.0
type MultipartFile struct { Key string File multipart.File Header *multipart.FileHeader }
MultipartFile parsed multipart form-data file.
func (*MultipartFile) ContentType ¶ added in v1.5.0
func (f *MultipartFile) ContentType() string
ContentType returns content type of parsed file.
type MultipartFiles ¶ added in v1.5.0
type MultipartFiles []*MultipartFile
MultipartFiles parsed multipart form-data files.
func (MultipartFiles) Close ¶ added in v1.5.0
func (mf MultipartFiles) Close() error
Close close all files.
type MultipartFormData ¶ added in v1.5.0
type MultipartFormData struct {
// contains filtered or unexported fields
}
MultipartFormData multipart form-data decoder.
func NewMultipartFormData ¶ added in v1.5.0
func NewMultipartFormData(opts ...MultipartFormDataOptionsFunc) *MultipartFormData
NewMultipartFormData returns new multipart form-data decoder.
func (*MultipartFormData) ContentType ¶ added in v1.5.0
func (m *MultipartFormData) ContentType() string
ContentType returns content type of url form decoder.
type MultipartFormDataOptionsFunc ¶ added in v1.5.0
type MultipartFormDataOptionsFunc func(*MultipartFormData)
MultipartFormDataOptionsFunc function for setting options.
func WithMaxMemory ¶ added in v1.5.0
func WithMaxMemory(maxMemory int64) MultipartFormDataOptionsFunc
WithMaxMemory sets max memory.
type XML ¶
type XML struct{}
XML xml decoder.
func (*XML) ContentType ¶
ContentType returns content-type header value.