Documentation ¶
Index ¶
- Constants
- Variables
- func ParseForm(r *http.Request) (map[string]interface{}, error)
- func ParseJSON(r *http.Request, obj interface{}) error
- func ParseMsgPack(r *http.Request, obj interface{}) error
- func ParseProtoBuf(r *http.Request, pm proto.Message) error
- func ParseXML(r *http.Request, obj interface{}) error
- func ParseYaml(r *http.Request, obj interface{}) error
- func ValidateStruct(obj interface{}) error
- type FormFile
- type MultipartForm
Constants ¶
View Source
const ( // ContentTypeJSON application/json ContentTypeJSON = "application/json" // ContentTypeXML application/xml ContentTypeXML = "application/xml" // ContentTypePlain text/plain ContentTypePlain = "text/plain" // ContentTypePostForm application/x-www-form-urlencoded ContentTypePostForm = "application/x-www-form-urlencoded" // ContentTypeMultipartPostForm multipart/form-data ContentTypeMultipartPostForm = "multipart/form-data" // ContentTypeYaml application/x-yaml ContentTypeYaml = "application/x-yaml" // ContentTypeMsgPack application/x-msgpack ContentTypeMsgPack = "application/x-msgpack" // ContentTypeProtoBuf application/x-protobuf ContentTypeProtoBuf = "application/x-protobuf" )
Variables ¶
View Source
var ( // ErrContentType context type error ErrContentType = errors.New("context type error") )
View Source
var ( // ErrResponseObject valid error when parse object ErrResponseObject = errors.New("valid error when parse object") )
Functions ¶
func ParseProtoBuf ¶
ParseProtoBuf 解析请求参数
Types ¶
type MultipartForm ¶
MultipartForm MultipartForm
func ParseMultipartForm ¶
func ParseMultipartForm(r *http.Request) (*MultipartForm, error)
ParseMultipartForm 解析请求参数
Click to show internal directories.
Click to hide internal directories.