Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client manages a specific websocket connection to a client
type EventHandler ¶
type EventHandler interface { // OnClientConnect is called once each time a new client is connected. // use sendToClient to send events to the new client. OnClientConnect(sendToClient chan events.Event) // OnEventReceived will be called each time _any_ client sends an event. // event is the event recieved, and events can be sent back to _all_ clients using sendToAll. OnEventReceived(event events.Event, sendToAll chan events.Event) }
An EventHandler is a struct that handles websocket events
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
A Manager manages a group of websocket connections
func (*Manager) SetEventHandler ¶
func (m *Manager) SetEventHandler(handler EventHandler)
SetEventHandler sets the event handler for the websocket manager
Click to show internal directories.
Click to hide internal directories.