Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConnectionHub = connectionHub{ Rooms: ConnectionNamespaces{ Roles: make(map[string]map[*Connection]*Client), Organization: make(map[string]map[*Connection]*Client), Usernames: make(map[string]map[*Connection]*Client), }, Emit: make(chan Message), Broadcast: make(chan Message), Register: make(chan Client), Unregister: make(chan Client), Clients: make(clients), }
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { User string Organization string Roles []string Username string Conn *Connection }
type Connection ¶
type ConnectionNamespaces ¶
type ConnectionNamespaces struct { // index rooms clients by connections to allow better access Roles map[string]map[*Connection]*Client Organization map[string]map[*Connection]*Client Usernames map[string]map[*Connection]*Client }
type ConnectionRoom ¶
type MesageTarget ¶
type MesageTarget string
const ( User MesageTarget = "user" Organization MesageTarget = "organization" Role MesageTarget = "role" )
func (MesageTarget) String ¶
func (t MesageTarget) String() string
type Message ¶
type Message struct { Broadcast bool Data []byte Destinations MessageDestinations Origin string }
type MessageDestinations ¶
Click to show internal directories.
Click to hide internal directories.