Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeResp ¶
Types ¶
type Request ¶
type Request struct { HeaderLength uint32 // 协议头长度 BodyLength uint32 // 协议体长度 RequestID uint32 // 消息ID Version uint8 // 版本 Compressor uint8 // 压缩算法 Serializer uint8 // 序列化协议 ServiceName string // 服务名 MethodName string // 方法名 Meta map[string]string // 扩展字段,用于传递自定义元数据 Data []byte // 协议体 }
func (*Request) CalculateBodyLength ¶
func (req *Request) CalculateBodyLength()
func (*Request) CalculateHeaderLength ¶
func (req *Request) CalculateHeaderLength()
type Response ¶
type Response struct { HeaderLength uint32 // 协议头长度 BodyLength uint32 // 协议体长度 RequestID uint32 // 消息ID Version uint8 // 版本 Compressor uint8 // 压缩算法 Serializer uint8 // 序列化协议 Error []byte // 错误信息 Data []byte // 响应数据 }
func DecodeResp ¶
func (*Response) CalculateBodyLength ¶
func (resp *Response) CalculateBodyLength()
func (*Response) CalculateHeaderLength ¶
func (resp *Response) CalculateHeaderLength()
Click to show internal directories.
Click to hide internal directories.