Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProtoDecoderBytes ¶
ProtoDecoderBytes 工具方法
Types ¶
type Decoder ¶
type Decoder interface { // 收到客户端的数据 Decoder(bytes []byte) messages.Message // 封装编码 Encode(result any) []byte // Tool 工具方法 Data(cmd, subCmd int64, body any) []byte }
Decoder 对数据的解码器
type JsonDecoder ¶
type JsonDecoder struct { }
func (JsonDecoder) Data ¶ added in v0.0.42
func (d JsonDecoder) Data(cmd, subCmd int64, body interface{}) []byte
Tool 工具方法
func (JsonDecoder) Decoder ¶ added in v0.0.42
func (d JsonDecoder) Decoder(bytes []byte) messages.Message
DecoderBytes 处理客户端返回的数据
func (JsonDecoder) Encode ¶ added in v0.0.42
func (d JsonDecoder) Encode(result interface{}) []byte
EncodeBytes 编码为字节
type ProtoDecoder ¶
type ProtoDecoder struct { }
func (ProtoDecoder) Data ¶ added in v0.0.42
func (p ProtoDecoder) Data(cmd, subCmd int64, body any) []byte
Data 工具方法,用于简化编码,减少代码量
func (ProtoDecoder) Decoder ¶ added in v0.0.42
func (p ProtoDecoder) Decoder(bytes []byte) messages.Message
func (ProtoDecoder) Encode ¶ added in v0.0.42
func (p ProtoDecoder) Encode(result interface{}) []byte
Click to show internal directories.
Click to hide internal directories.