Documentation ¶
Index ¶
Constants ¶
View Source
const ( CommandTypeGet = "get" CommandTypeUpdate = "update" CommandTypeCreate = "create" CommandTypeDelete = "delete" )
Variables ¶
This section is empty.
Functions ¶
func ServeWs ¶
func ServeWs(hub *Hub, c WSController, w http.ResponseWriter, r *http.Request)
serveWs handles websocket requests from the peer.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
type ClientResponse ¶
type ClientResponse struct {
// contains filtered or unexported fields
}
type Command ¶
type Command struct { Command string `json:"command"` Data interface{} `json:"data"` // contains filtered or unexported fields }
type CommandType ¶
type CommandType string
type Response ¶
type Response struct { Status Status `json:"status"` Value interface{} `json:"value"` }
type WSController ¶
type WSController struct { FlagService flags.FlagService CacheClient storage.CacheClient }
func (WSController) Create ¶
func (ws WSController) Create(cmd *Command) Response
func (WSController) Delete ¶
func (ws WSController) Delete(cmd *Command) Response
func (WSController) Get ¶
func (ws WSController) Get(c *Command) Response
func (WSController) RunCommand ¶
func (ws WSController) RunCommand(cmd *Command) Response
func (WSController) Update ¶
func (ws WSController) Update(cmd *Command) Response
Click to show internal directories.
Click to hide internal directories.