Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrGetPayloadLen 获取负载长度失败 ErrGetPayloadLen = errors.New("get payload length failed") // ErrSkip buff 跳过失败 ErrSkip = errors.New("buffer skip failed") // ErrGetFlag 获取标记失败 ErrGetFlag = errors.New("get flag failed") // ErrGetSN 获取自增编号失败 ErrGetSN = errors.New("get sn failed") // ErrGetModule 获取功能模块信息失败 ErrGetModule = errors.New("get module id failed") // ErrGetAction 获取功能细分信息失败 ErrGetAction = errors.New("get action id failed") // ErrGetPayload 获取负载失败 ErrGetPayload = errors.New("get payload failed") // ErrDecryptPayload 解密负载失败 ErrDecryptPayload = errors.New("decrypt payload failed") // ErrDecompressPayload 解压负载失败 ErrDecompressPayload = errors.New("decompress payload failed") )
Functions ¶
func DefaultDatapck ¶
func DefaultDatapck(config *zeronetwork.Config) zeronetwork.Datapack
DefaultDatapck 默认的封包与解包器
func NewLTD ¶
func NewLTD( whetherCompress bool, compressThreshold int, compress zerocompress.Compress, whetherCrypto bool, logger zerologger.Logger, ) zeronetwork.Datapack
NewLTD 创建一个封包解包工具
func NewLTDMessage ¶
func NewLTDMessage(flag, sn, code uint16, module, action uint8, payload []byte) zeronetwork.Message
NewLTDMessage 创建一个消息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.