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" )
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 User string Payload string Headers CommandHeader }
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.