Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeContactWs ¶
func ServeContactWs(contactId string, hub *ContactHub, w http.ResponseWriter, r *http.Request, pingInterval int)
ServeContactWs serveWs handles websocket requests from the peer.
Types ¶
type ContactClient ¶
type ContactClient struct {
// contains filtered or unexported fields
}
ContactClient Client is a middleman between the websocket connection and the hub.
type ContactEvent ¶
type ContactEvent struct { ContactId string `json:"contactId"` InteractionEvent model.InteractionEventCreate `json:"event"` }
type ContactHub ¶
type ContactHub struct { // Registered clients. Clients map[*ContactClient]bool // Inbound messages from the clients. Broadcast chan ContactEvent // Register requests from the clients. Register chan *ContactClient Quit chan bool // contains filtered or unexported fields }
ContactHub Hub maintains the set of active clients and broadcasts messages to the clients.
func NewContactHub ¶
func NewContactHub() *ContactHub
func (*ContactHub) Run ¶
func (h *ContactHub) Run()
Click to show internal directories.
Click to hide internal directories.