Documentation ¶
Index ¶
Constants ¶
View Source
const ( MIMEJSON = "application/json" MIMEXML = "application/xml" MIMEXML2 = "text/xml" MIMEPlain = "text/plain" MIMEPOSTForm = "application/x-www-form-urlencoded" MIMEMultipartPOSTForm = "multipart/form-data" )
Variables ¶
View Source
var ( JSON = jsonBinding{} XML = xmlBinding{} Form = formBinding{} FormPost = formBinding{} FormMultipart = formMultipartBinding{} Query = queryBinding{} Header = headerBinding{} Uri = uriBinding{} )
Functions ¶
func MapForm ¶
func MapForm(obj interface{}, form map[string][]string, formfile map[string][]*multipart.FileHeader, tag string) error
MapForm map form or multipart.FileHeader to target obj support map[string]string, map[string][]string, struct struct field指针超过一层没有意义, 不支持
func NewvVlidatorV10 ¶
func NewvVlidatorV10() *validatorV10
func SetMultipartMemory ¶
func SetMultipartMemory(n int64)
Types ¶
type Bindinger ¶
func NewBindinger ¶
NewBindinger returns the appropriate Binding instance based on HTTP method and content type.
type StructValidater ¶
type StructValidater interface { ValidateStruct(interface{}) error // Engine returns the underlying validator engine which powers the // StructValidator implementation. Engine() interface{} Name() string }
StructValidater is an interface which needs to be implemented
var Validator StructValidater = NewvVlidatorV10()
Validator is the default validator which implements the StructValidator interface. It uses https://github.com/go-playground/validator/tree/v10.5.0
Click to show internal directories.
Click to hide internal directories.