Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { // Marshal 编码 Marshal(msgType message.Type, payload interface{}) ([]byte, error) // Unmarshal 解码 Unmarshal(data []byte, registry *message.Registry) (msgType message.Type, payload interface{}, err error) // String 名称 String() string }
Codec 编解码器
type JSON ¶
type JSON struct { // Type 类型 Type message.Type `json:"type"` // Payload 消息体 Payload json.RawMessage `json:"payload"` }
JSON json格式
Click to show internal directories.
Click to hide internal directories.