Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between the node and the websocket connection.
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
func (*Hub) BroadcastMsg ¶
BroadcastMsg sends a message to all clients.
func (*Hub) ServeWebsocket ¶
func (h *Hub) ServeWebsocket(w http.ResponseWriter, r *http.Request, onConnect ...func(client *Client))
ServeWebsocket handles websocket requests from the peer.
Click to show internal directories.
Click to hide internal directories.