Documentation ¶
Overview ¶
Package eows is used to Execute commands Over WebSocket
Package eows is used to Execute commands Over WebSocket
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmitExitCB ¶
type EmitExitCB func(e *ExecOverWS, code int, err error)
EmitExitCB is the function callback used to emit exit proc code
type EmitOutputCB ¶
type EmitOutputCB func(e *ExecOverWS, stdout, stderr string)
EmitOutputCB is the function callback used to emit data
type ExecOverWS ¶
type ExecOverWS struct { Cmd string // command name to execute Args []string // command arguments SocketIO *socketio.Socket // websocket Sid string // websocket ID CmdID string // command ID // Optional fields Env []string // command environment variables CmdExecTimeout int // command execution time timeout Log *logrus.Logger // logger (nil if disabled) InputEvent string // websocket input event name InputCB OnInputCB // stdin callback OutputCB EmitOutputCB // stdout/stderr callback ExitCB EmitExitCB // exit proc callback UserData *map[string]interface{} // user data passed to callbacks OutSplit SplitType // split method to tokenize stdout/stderr // contains filtered or unexported fields }
ExecOverWS .
func GetEows ¶
func GetEows(cmdID string) *ExecOverWS
GetEows gets ExecOverWS object from command ID
func New ¶
func New(cmd string, args []string, so *socketio.Socket, soID, cmdID string) *ExecOverWS
New creates a new instace of eows
func (*ExecOverWS) Signal ¶
func (e *ExecOverWS) Signal(signal string) error
Signal sends a signal to the running command / process
func (*ExecOverWS) Start ¶
func (e *ExecOverWS) Start() error
Start executes the command and redirect stdout/stderr into a WebSocket
Click to show internal directories.
Click to hide internal directories.