Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec interface {
Name() string
Marshal(val any) ([]byte, error)
Unmarshal(data []byte, val any) error
}
Codec 是消息编码/解码接口。 注:
Codec 用于将 websocket 连接收发的消息进行编码/解码。 即前端 ( 业务客户端 ) 和网关之间收发的消息进行编码/解码。
type ProtoCodec ¶
type ProtoCodec struct{}
func NewProtoCodec ¶
func NewProtoCodec() *ProtoCodec
func (*ProtoCodec) Name ¶
func (c *ProtoCodec) Name() string
Click to show internal directories.
Click to hide internal directories.