Documentation ¶
Index ¶
- func Factory() *pack_factory
- func NewDataPack() ziface.IDataPack
- func NewDataPackLtv() ziface.IDataPack
- type DataPack
- type DataPackLtv
- type Message
- func (msg *Message) GetData() []byte
- func (msg *Message) GetDataLen() uint32
- func (msg *Message) GetMsgID() uint32
- func (msg *Message) GetRawData() []byte
- func (msg *Message) Init(ID uint32, data []byte)
- func (msg *Message) SetData(data []byte)
- func (msg *Message) SetDataLen(len uint32)
- func (msg *Message) SetMsgID(msgID uint32)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Factory ¶
func Factory() *pack_factory
Factory Generates different packaging and unpackaging methods, singleton
(生成不同封包解包的方式,单例)
func NewDataPack ¶
NewDataPack initializes a packing and unpacking instance (封包拆包实例初始化方法)
func NewDataPackLtv ¶
NewDataPackLtv initializes a packing and unpacking instance (封包拆包实例初始化方法)
Types ¶
type DataPack ¶
type DataPack struct{}
func (*DataPack) GetHeadLen ¶
GetHeadLen returns the length of the message header (获取包头长度方法)
type DataPackLtv ¶
type DataPackLtv struct{}
DataPackLtv LTV little-endian data packing and unpacking used by Zinx in its early days, compatible with previous applications (Zinx早期使用的LTV 小端方式,兼容之前的应用)
func (*DataPackLtv) GetHeadLen ¶
func (dp *DataPackLtv) GetHeadLen() uint32
GetHeadLen returns the length of the message header (获取包头长度方法)
type Message ¶
type Message struct { DataLen uint32 // Length of the message ID uint32 // ID of the message Data []byte // Content of the message // contains filtered or unexported fields }
Message structure for messages
func NewMessage ¶
func NewMsgPackage ¶
func (*Message) GetDataLen ¶
func (*Message) GetRawData ¶
func (*Message) SetDataLen ¶
Click to show internal directories.
Click to hide internal directories.