Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveConnection ¶
func RemoveConnection(ws *WebSocketContainer, g *Server)
Types ¶
type BasicMessage ¶
type BasicMessage struct {
MsgType string `json:"msgtype"`
}
type Server ¶
type Server struct { WalletIndex map[string]string WsSockets map[string]*WebSocketContainer Database *data.Database LastBroadcastTime time.Time HandleMessage func(g *Server, ws *WebSocketContainer, m BasicMessage, p []byte) error HandleDisconnect func(ws *WebSocketContainer) // contains filtered or unexported fields }
func NewServer ¶
func NewServer( database *data.Database, handleMessage func(g *Server, ws *WebSocketContainer, m BasicMessage, p []byte) error, handleDisconnect func(ws *WebSocketContainer), ) *Server
func (*Server) WebSocketConnectionHandler ¶
func (g *Server) WebSocketConnectionHandler(response http.ResponseWriter, request *http.Request)
func (*Server) WsHandler ¶
func (g *Server) WsHandler(ws *WebSocketContainer)
Click to show internal directories.
Click to hide internal directories.