Documentation ¶
Overview ¶
Package fixedlen : header + payload header: '负载长度(U16)' + '标记(U16)' + '自增编号(U16)' + '消息编号(U16)' payload: 负载,即消息内容,使用 codec 进行编码与解码 对于标记见 flag.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrGetPayloadLen 获取负载长度失败 ErrGetPayloadLen = errors.New("get payload length failed") // ErrGetFlag 获取标记失败 ErrGetFlag = errors.New("get flag failed") // ErrGetSN 获取自增编号失败 ErrGetSN = errors.New("get sn failed") // ErrGetMessageID 获取消息编号失败 ErrGetMessageID = errors.New("get message id failed") // ErrGetPayload 获取负载失败 ErrGetPayload = errors.New("get payload failed") )
Functions ¶
func NewMessageFromClient ¶
NewMessageFromClient ..
Types ¶
type Option ¶
type Option func(*fixedLen)
Option ..
func WithCompressThreshold ¶
WithCompressThreshold 加密的阈值,当消息负载长度超过该值时才会加密
func WithWhetherCompress ¶
WithWhetherCompress 是否需要对消息负载进行加密
func WithWhetherCrypto ¶
WithWhetherCrypto 是否需要对消息负载进行加密
Click to show internal directories.
Click to hide internal directories.