Documentation
¶
Overview ¶
Package command provides methods and functions for creating and parsing Altid control messages
go get github.com/altid/server/command
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// The sending client ID
UUID uint32
CmdType CmdType
// Arguments for known commands, such as buffer/open/close/link
Args []string
// The raw command bytes
Data []byte
}
Command is a ctl message
func FromString ¶
FromString retruns a command from string input, or an error if it was unable to parse
cmdChannel <- FromString(clientuuid, "buffer newbuffer") cmdChannel <- FromString(clientuuid, "link new old")
func New ¶
New - helper func with varargs
cmdChannel <- New(clientuuid, BufferCmd, nil, "newbuffer")
cmdChannel <- New(clientuuid, CloseCmd, nil, "oldbuffer")
cmdChannel <- New(clientuuid, OtherCmd, []byte("emote I swapped buffers"))
cmdChannel <- New(clientuuid, LinkCmd, nil, "newbuffer", "oldbuffer")
Click to show internal directories.
Click to hide internal directories.