Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NilCodecID 空的编解码器id. NilCodecID byte = 0 // NilCodecName 空的编解码器名称. NilCodecName string = "" )
View Source
const ( NameForm = "form" IdForm = 'f' )
View Source
const ( NameJson = "json" IdJson = 'j' )
View Source
const ( NamePlain = "plain" IdPlain = 's' )
View Source
const ( NameXml = "xml" IdXml = 'x' )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Codec ¶
type Codec interface { ID() byte Name() string Marshal(interface{}) ([]byte, error) Unmarshal([]byte, interface{}) error }
Codec 消息内容的编解码器
type PlainCodec ¶ added in v0.0.3
type PlainCodec struct{}
PlainCodec plain text codec
func (PlainCodec) Marshal ¶ added in v0.0.3
func (PlainCodec) Marshal(v interface{}) ([]byte, error)
func (PlainCodec) Unmarshal ¶ added in v0.0.3
func (PlainCodec) Unmarshal(data []byte, v interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.