...

Package group

import "github.com/Diarkis/diarkis/proto/go/group"
Overview
Index

Overview ▾

Code generated by Diarkis Puffer module: DO NOT EDIT.

Auto-generated by Diarkis Version 1.0.0

- Maximum length of a string is 65535 bytes - Maximum length of a byte array is 65535 bytes - Maximum length of any array is 65535 elements

Code generated by Diarkis Puffer module: DO NOT EDIT.

Auto-generated by Diarkis Version 1.0.0

- Maximum length of a string is 65535 bytes - Maximum length of a byte array is 65535 bytes - Maximum length of any array is 65535 elements

Code generated by Diarkis Puffer module: DO NOT EDIT.

Auto-generated by Diarkis Version 1.0.0

- Maximum length of a string is 65535 bytes - Maximum length of a byte array is 65535 bytes - Maximum length of any array is 65535 elements

Code generated by Diarkis Puffer module: DO NOT EDIT.

Auto-generated by Diarkis Version 1.0.0

- Maximum length of a string is 65535 bytes - Maximum length of a byte array is 65535 bytes - Maximum length of any array is 65535 elements

Constants

BroadcastCmd 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 BroadcastCmd uint16 = 113

BroadcastVer 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 BroadcastVer uint8 = 1

CreateCmd 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 CreateCmd uint16 = 110

CreateVer 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 CreateVer uint8 = 1

JoinCmd 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 JoinCmd uint16 = 111

JoinVer 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 JoinVer uint8 = 1

LeaveCmd 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 LeaveCmd uint16 = 112

LeaveVer 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 LeaveVer uint8 = 1

type Broadcast

Broadcast represents the command protocol data structure.

type Broadcast struct {
    // Command version of the protocol
    Ver uint8
    // Command ID of the protocol
    Cmd uint16
    // group ID
    GroupID string
    // Message to be sent as the broadcast
    Message []byte
    // If true, UDP will become RUDP
    Reliable bool
}

func NewBroadcast

func NewBroadcast() *Broadcast

NewBroadcast creates a new instance of Broadcast struct.

func (*Broadcast) GetCmd

func (proto *Broadcast) GetCmd() uint16

func (*Broadcast) GetVer

func (proto *Broadcast) GetVer() uint8

func (*Broadcast) Pack

func (proto *Broadcast) Pack() []byte

Pack encodes Broadcast struct to a byte array to be delivered over the command.

func (*Broadcast) String

func (proto *Broadcast) String() string

func (*Broadcast) Unpack

func (proto *Broadcast) Unpack(bytes []byte) error

Unpack decodes the command payload byte array to Broadcast struct.

type Create

Create represents the command protocol data structure.

type Create struct {
    // Command version of the protocol
    Ver uint8
    // Command ID of the protocol
    Cmd uint16
    // If true, the group will not be deleted until TTL expires even if all members leave
    AllowEmpty bool
    // If true, the creator user will join the group automatically
    Join bool
    // TTL of the group in seconds
    Ttl uint16
}

func NewCreate

func NewCreate() *Create

NewCreate creates a new instance of Create struct.

func (*Create) GetCmd

func (proto *Create) GetCmd() uint16

func (*Create) GetVer

func (proto *Create) GetVer() uint8

func (*Create) Pack

func (proto *Create) Pack() []byte

Pack encodes Create struct to a byte array to be delivered over the command.

func (*Create) String

func (proto *Create) String() string

func (*Create) Unpack

func (proto *Create) Unpack(bytes []byte) error

Unpack decodes the command payload byte array to Create struct.

type Join

Join represents the command protocol data structure.

type Join struct {
    // Command version of the protocol
    Ver uint8
    // Command ID of the protocol
    Cmd uint16
    // group ID
    GroupID string
    // Message to be sent when join is successful.
    Message []byte
}

func NewJoin

func NewJoin() *Join

NewJoin creates a new instance of Join struct.

func (*Join) GetCmd

func (proto *Join) GetCmd() uint16

func (*Join) GetVer

func (proto *Join) GetVer() uint8

func (*Join) Pack

func (proto *Join) Pack() []byte

Pack encodes Join struct to a byte array to be delivered over the command.

func (*Join) String

func (proto *Join) String() string

func (*Join) Unpack

func (proto *Join) Unpack(bytes []byte) error

Unpack decodes the command payload byte array to Join struct.

type Leave

Leave represents the command protocol data structure.

type Leave struct {
    // Command version of the protocol
    Ver uint8
    // Command ID of the protocol
    Cmd uint16
    // group ID
    GroupID string
    // Message to be sent when leave is successful.
    Message []byte
}

func NewLeave

func NewLeave() *Leave

NewLeave creates a new instance of Leave struct.

func (*Leave) GetCmd

func (proto *Leave) GetCmd() uint16

func (*Leave) GetVer

func (proto *Leave) GetVer() uint8

func (*Leave) Pack

func (proto *Leave) Pack() []byte

Pack encodes Leave struct to a byte array to be delivered over the command.

func (*Leave) String

func (proto *Leave) String() string

func (*Leave) Unpack

func (proto *Leave) Unpack(bytes []byte) error

Unpack decodes the command payload byte array to Leave struct.