Documentation
¶
Index ¶
- Constants
- Variables
- func ContentTypeFormat(c string) string
- func Decode(r io.Reader, i any, t any) error
- func Encode(w io.Writer, i any, t any) error
- func Marshal(i any, t any) ([]byte, error)
- func Register(t string, handle Binder) error
- func SetMimeType(id uint8, name string, typ string)
- func Unmarshal(b []byte, i any, t any) error
- type Binder
- type T
Constants ¶
View Source
const ( HeaderAccept = "Accept" HeaderContentType = "Content-Type" )
View Source
const ( MIMEJSON string = "application/json" MIMEXML = "application/xml" MIMEXML2 = "text/xml" MIMEPOSTForm = "application/x-www-form-urlencoded" MIMEPROTOBUF = "application/x-protobuf" MIMEMSGPACK = "application/x-msgpack" MIMEMSGPACK2 = "application/msgpack" MIMEYAML = "application/x-yaml" MIMEBytes string = "application/bytes" )
Content-Type MIME of the most common data formats.
Variables ¶
View Source
var Bytes = bytesBinding{ Binary: binary.BigEndian, }
View Source
var Form = &formBinding{}
View Source
var Json = jsonBinding{}
View Source
var Protobuf = &protobufBinding{}
View Source
var Xml = &xmlBinding{}
Functions ¶
func ContentTypeFormat ¶ added in v1.2.0
func SetMimeType ¶ added in v1.2.0
Types ¶
Click to show internal directories.
Click to hide internal directories.