Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventConnections ¶
func NewEventConnections() *eventConnections
NewEventConnections creates a new eventConections to track a set of clients.
func NewHub ¶
func NewHub(c EventConnections) *eventHub
NewHub creates a new hub instance. It doesn't start it.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements a persistent Websocket connection
func (*Client) Close ¶
func (c *Client) Close()
Close will tell the client to exit and clean up the connection.
type EventConnections ¶
EventConnections tracks a set of client connections and can be asked to broadcast a message to them.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements a hub for handling multiple websocket connections.
func (*Server) OnConnection ¶
OnConnection is called when a new websocket connection is made. It creates a persistent client connection and registers that connection with the hub. It it meant to be called by the websocket.Handler method.
Click to show internal directories.
Click to hide internal directories.