Documentation ¶
Overview ¶
copy
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CompressorTypeMismatchError = errors.New("codec request and response Compressor type mismatch") UnexpectedChecksumError = errors.New("codec unexpected checksum") WriteError = errors.New("codec WriteError") ReadError = errors.New("codec ReadError") ReadHeaderError = errors.New("header size greater than FrozeMaxHeaderSize") )
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface { Write(*header.Header, any) error //coder compress写任意解码器支持的对象 WriteData(*header.Header, []byte) error //compress WriteRawData(*header.Header, []byte) error //none服务器转发或者,发送文件 不需要数据处理 ReadHeader() (*header.Header, error) ReadBody(any) error //coder compress ReadBodyData(*[]byte) error //compress ReadBodyRawData(*[]byte) error //none服务器转发或者,发送文件 不需要数据处理 Close() error Marshal(coder.CoderType, any) ([]byte, error) Unmarshal(coder.CoderType, *[]byte, any) error }
编解码器
func NewCodec ¶
func NewCodec(conn io.ReadWriteCloser, opts ...*options.CodecOptions) Codec
Click to show internal directories.
Click to hide internal directories.