Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConnHost = "localhost" ConnType = "tcp" )
const for connection
View Source
const ( SignalConnect Signal = "SIGNAL_CONNECT" SignalExec = "SIGNAL_EXEC" SignalSuccess = "SIGNAL_SUCCESS" SignalError = "SIGNAL_ERROR" )
const for signal type
View Source
const ( ExecSet ExecType = "EXEC_SET" ExecGet = "EXEC_GET" ExecDel = "EXEC_DEL" ExecExp = "EXEC_EXP" ExecExists = "EXEC_EXISTS" )
const for execution types
Variables ¶
This section is empty.
Functions ¶
func CommandHeadersToMessage ¶
func CommandHeadersToMessage(headers CommandHeader) string
CommandHeadersToMessage returns message built from given headers
func CommandToMessage ¶
CommandToMessage generate message string from given command
Types ¶
type Command ¶
type Command struct {
Type Signal `json:"t"`
User string `json:"u"`
Payload []string `json:"p,omitempty"`
Headers CommandHeader `json:"h,omitempty"`
}
Command struct for client and server data
func NewCommandFromMessage ¶
NewCommandFromMessage create command from message string message format: cmd=>uid=>payload=>header
type CommandHeader ¶
type CommandHeader map[string]interface{}
CommandHeader type
func NewCommandHeadersFromMessage ¶
func NewCommandHeadersFromMessage(message string) CommandHeader
NewCommandHeadersFromMessage create command header from given message the message should: EXEC_TYPE:<ExecType>
type Exec ¶
Exec define execution model
func NewExecFromCommandPayload ¶
NewExecFromCommandPayload create exec using command payload
Click to show internal directories.
Click to hide internal directories.