Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeMessageWs ¶
func ServeMessageWs(feedId string, hub *MessageHub, w http.ResponseWriter, r *http.Request, pingInterval int)
ServeMessageWs serveWs handles websocket requests from the peer.
Types ¶
type MessageClient ¶
type MessageClient struct {
// contains filtered or unexported fields
}
MessageClient Client is a middleman between the websocket connection and the hub.
type MessageEvent ¶
type MessageHub ¶
type MessageHub struct { // Registered clients. Clients map[*MessageClient]bool // Inbound messages from the clients. Broadcast chan MessageEvent // Register requests from the clients. Register chan *MessageClient Quit chan bool // contains filtered or unexported fields }
MessageHub Hub maintains the set of active clients and broadcasts messages to the clients.
func NewMessageHub ¶
func NewMessageHub() *MessageHub
func (*MessageHub) Run ¶
func (h *MessageHub) Run()
Click to show internal directories.
Click to hide internal directories.