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

20 lines
475 B
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package packet
import "errors"
var (
// ErrWrongPacketType represents a wrong packet type.
ErrWrongPacketType = errors.New("wrong packet type")
// ErrPacketSizeExceed represents a wrong packet size.
ErrPacketSizeExceed = errors.New("packet size exceed")
)
type (
// IPacket 数据帧
IPacket interface {
GetHeader() any // 数据帧头部 Header
GetLen() uint64 // 数据帧长度 8bytes根据实际情况进行转换
GetBody() []byte // 数据 Body
}
)