Documentation ¶
Overview ¶
Package internal is a work in progress. It is planned to accomodate modules such as db and models.
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(r *http.Request) bool { return true }, }
UpgradeConnection is generic protocol upgrader for entire DMS.
Functions ¶
func HandleWebSocket ¶
HandleWebSocket godoc
@Summary Sends a command to specific node and prints back response. @Description Sends a command to specific node and prints back response. @Tags peers @Success 200 @Router /peers/ws [get]
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.