Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MsgTypeReserved : Reserved MsgTypeReserved byte = iota // MsgTypeOnline : Online message MsgTypeOnline // MsgTypeOnlineAck : Online ACK MsgTypeOnlineAck // MsgTypeOffline : Offline message MsgTypeOffline // MsgTypeOfflineAck : Offline ACK MsgTypeOfflineAck // MsgTypeUpward : Upward message MsgTypeUpward // MsgTypeUpwardAck : Upward ACK MsgTypeUpwardAck // MsgTypeDownward : Downward message MsgTypeDownward // MsgTypeDownwardAck : Downward ACK MsgTypeDownwardAck // MsgTypePing : Heartbeat PING MsgTypePing // MsgTypePong : Heartbeat PONE MsgTypePong )
View Source
const ( // MsgStageHeader : Header needed (Type + CompressMode + SerializeMode) + (BodyLength) (5 bytes) MsgStageHeader byte = iota // MsgStageBody : Body needed (n bytes) MsgStageBody // MsgStageComplete : All done MsgStageComplete )
const (
// MsgStageHeader : Header needed (Type + CompressMode + SerializeMode) (1 byte) MsgStageHeader int = iota // MsgStageUids : Uids needed (2 bytes) MsgStageUids // MsgStageUID : UID array needed ((8 * Uids) bytes) MsgStageUID // MsgStageLength : Payload length needed (4 bytes) MsgStageLength // MsgStagePayload : Payload data needed (length bytes) MsgStagePayload // MsgStageComplete : All done MsgStageComplete
)
View Source
const ( // MsgCompressNone : No compression MsgCompressNone byte = iota // MsgCompressDeflate : Deflate (GNU zip) MsgCompressDeflate // MsgCompressSnappy : Google snappy MsgCompressSnappy // MsgCompressLZ4 : LZ4 MsgCompressLZ4 )
View Source
const ( // MsgSerializeRaw : No serialization MsgSerializeRaw byte = iota // MsgSerializeJSON : JSON MsgSerializeJSON // MsgSerializeMsgPack : MessagePack MsgSerializeMsgPack // MsgSerializeAMF3 : AMF3 MsgSerializeAMF3 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommonCommand ¶
type CommonCommand struct { Additional map[string]string `cmd:"Additional"` Command int `cmd:"Command"` Params map[string]interface{} `cmd:"Params"` }
CommonCommand : Common command
func CmdDecode ¶
func CmdDecode(raw []byte, t byte) (*CommonCommand, error)
CmdDecode : Decode bytes into struct
{{{ [CmdDecode]
func (*CommonCommand) Encode ¶
func (cmd *CommonCommand) Encode(t byte) ([]byte, error)
Encode : Encode command struct into bytes
{{{ [Encode] Encode command
func (*CommonCommand) ToRaw ¶
func (cmd *CommonCommand) ToRaw() []byte
ToRaw : CommonCommand to raw byte array
type Message ¶
type Message struct { Type byte SerializeMode byte CompressMode byte BodyLength uint32 Body Body Stage byte // contains filtered or unexported fields }
Message : Data struct defination
Click to show internal directories.
Click to hide internal directories.