Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NewCodecFuncMap map[Type]NewCodecFunc
保存不同类型编解码器的创建函数
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { io.Closer ReadHeader(*Header) error //读取头信息 ReadBody(interface{}) error //读取消息体 Write(*Header, interface{}) error //写入头信息 }
Codec 编解码器接口
type GobCodec ¶
type GobCodec struct {
// contains filtered or unexported fields
}
Gob编解码器
func (*GobCodec) ReadHeader ¶
ReadHeader 读取请求头,h需要是指针
Click to show internal directories.
Click to hide internal directories.