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.
nnet/packet/pakcer.go

16 lines
321 B
Go

package packet
type (
// Packer 数据帧 封包/解包
Packer interface {
// Pack 封包,将原始数据构造为二进制流数据帧
Pack(header any, data []byte) ([]byte, error)
// Unpack 解包
Unpack(data []byte) ([]IPacket, error)
}
// PackerBuilder Packer构建器
PackerBuilder func() Packer
)