Documentation ¶
Index ¶
Constants ¶
View Source
const ( GobType = "application/gob" JsonType = "application/json" )
Variables ¶
View Source
var NewCodecFuncMap map[Type]NewCodecFunc
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { io.Closer ReadHeader(header traffic.Header) error ReadBody(body interface{}) error Write(header traffic.Header, body interface{}) error }
Codec 编解码器
func NewGobCodec ¶
func NewGobCodec(conn io.ReadWriteCloser) Codec
type GobCodec ¶
type GobCodec struct {
// contains filtered or unexported fields
}
GobCodec 默认自带的编解码器
type NewCodecFunc ¶
type NewCodecFunc func(closer io.ReadWriteCloser) Codec
Click to show internal directories.
Click to hide internal directories.