Documentation ¶
Index ¶
Constants ¶
View Source
const ( JsonName = "json" ProtoName = "proto" XmlName = "xml" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Codec ¶
type Codec interface { // Marshal 返回将v一定格式导出. Marshal(v interface{}) ([]byte, error) // Unmarshal 编解码器解析data的数据,并将结果存储在v指向的值中. Unmarshal(data []byte, v interface{}) error // Name 返回编解码器实现的名称。返回的字符串将在传输中用作内容类型的一部分.结果必须是静态的;结果不能在调用之间更改. Name() string }
Codec 定义传输用于编码和解码消息的接口. 注意:此接口的实现必须是线程安全的.
Click to show internal directories.
Click to hide internal directories.