package dm
import "github.com/Diarkis/diarkis/proto/go/dm"
Index
Constants
const DisconnectCmd uint16 = 700
DisconnectCmd represents the command ID of the protocol's command ID.
[NOTE] The value is optional and if cmd is not given in the definition JSON, it will be 0.
const DisconnectVer uint8 = 1
DisconnectVer represents the ver of the protocol's command.
[NOTE] The value is optional and if ver is not given in the definition JSON, it will be 0.
const SendCmd uint16 = 701
SendCmd represents the command ID of the protocol's command ID.
[NOTE] The value is optional and if cmd is not given in the definition JSON, it will be 0.
const SendVer uint8 = 1
SendVer represents the ver of the protocol's command.
[NOTE] The value is optional and if ver is not given in the definition JSON, it will be 0.
Types
type Disconnect
type Disconnect struct { // Command version of the protocol Ver uint8 // Command ID of the protocol Cmd uint16 // Message content of the DM disconnect. Message []byte // The UID of the DM participant to disconnect from. TargetUID string }
Disconnect represents the command protocol data structure.
func NewDisconnect
func NewDisconnect() *Disconnect
NewDisconnect creates a new instance of Disconnect struct.
func (*Disconnect) GetCmd
func (proto *Disconnect) GetCmd() uint16
func (*Disconnect) GetVer
func (proto *Disconnect) GetVer() uint8
func (*Disconnect) Pack
func (proto *Disconnect) Pack() []byte
Pack encodes Disconnect struct to a byte array to be delivered over the command.
func (*Disconnect) PackedSize
func (proto *Disconnect) PackedSize() int
PackedSize returns the estimated packed size of the struct.
func (*Disconnect) String
func (proto *Disconnect) String() string
func (*Disconnect) Unpack
func (proto *Disconnect) Unpack(bytes []byte) error
Unpack decodes the command payload byte array to Disconnect struct.
type Send
type Send struct { // Command version of the protocol Ver uint8 // Command ID of the protocol Cmd uint16 // Message content of the DM to be sent. Message []byte // The UID of the DM target. TargetUID string }
Send represents the command protocol data structure.
func NewSend
func NewSend() *Send
NewSend creates a new instance of Send struct.
func (*Send) GetCmd
func (proto *Send) GetCmd() uint16
func (*Send) GetVer
func (proto *Send) GetVer() uint8
func (*Send) Pack
func (proto *Send) Pack() []byte
Pack encodes Send struct to a byte array to be delivered over the command.
func (*Send) PackedSize
func (proto *Send) PackedSize() int
PackedSize returns the estimated packed size of the struct.
func (*Send) String
func (proto *Send) String() string
func (*Send) Unpack
func (proto *Send) Unpack(bytes []byte) error
Unpack decodes the command payload byte array to Send struct.