You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
333 B
Go
16 lines
333 B
Go
1 year ago
|
package packet
|
||
|
|
||
|
type (
|
||
|
// Packer 数据帧 封包/解包
|
||
|
Packer interface {
|
||
|
// Pack 封包,将原始数据构造为二进制流数据帧
|
||
|
Pack(header any, data []byte) ([]byte, error)
|
||
|
|
||
|
// Unpack 解包
|
||
|
Unpack(header any, data []byte) ([]IPacket, error)
|
||
|
}
|
||
|
|
||
|
// PackerBuilder Packer构建器
|
||
|
PackerBuilder func() Packer
|
||
|
)
|