Documentation ¶
Index ¶
Constants ¶
View Source
const ( MessageAuthentication = iota MessageReceive MessageSent )
Variables ¶
This section is empty.
Functions ¶
func Websockets ¶
Types ¶
type AuthenticationMessage ¶
type BaseMessage ¶
type BaseMessage struct {
Type int `json:"type"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a middleman between websocket connection and the hub
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Maintains the set of active clients and broadcasts messages to the clients
func (*Hub) PushMessage ¶
Send message over websocket connection client
type ReceiveMessage ¶
type SentMessage ¶
type UserMapping ¶
Create mapping of users to client connections
func (*UserMapping) Add ¶
func (um *UserMapping) Add(id string, client *Client)
Map client connection to ip to client id
func (*UserMapping) Delete ¶
func (um *UserMapping) Delete(id string, ip string)
func (*UserMapping) Get ¶
func (um *UserMapping) Get(id string) []*Client
Retrieve all connected clients by user id
Click to show internal directories.
Click to hide internal directories.