Documentation
¶
Overview ¶
Package internal is a work in progress. It is planned to accommodate modules such as db and types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ShutdownChan chan os.Signal
View Source
var UpgradeConnection = websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 1024, CheckOrigin: func(_ *http.Request) bool { return true }, }
UpgradeConnection is generic protocol upgrader for entire DMS.
Functions ¶
func ListenForWs ¶
func ListenForWs(conn *WebSocketConnection)
ListenForWs listens to the connected client for any message. It is assumed that every message that is coming is a command to be executed.
func SendCommandForExecution ¶
func SendCommandForExecution()
SendCommandForExecution work is to send command for execution and fetch the result This function listens for new commands from commandChan
Types ¶
type Command ¶
type Command struct { Command string NodeID string // ID of the node where command will be executed Result string Conn *WebSocketConnection }
Command represents a command to be executed
type WebSocketConnection ¶
WebSocketConnection is pointer to gorilla/websocket.Conn
Click to show internal directories.
Click to hide internal directories.