Documentation
¶
Index ¶
- func NewClient(hub *Hub, w http.ResponseWriter, r *http.Request)
- type Auth
- type Client
- func (c *Client) Close()
- func (c *Client) GetAuth() Auth
- func (c *Client) GetSubscriptions() []string
- func (c *Client) Send(s string)
- func (c *Client) SubscribePrivate(s string)
- func (c *Client) SubscribePublic(s string)
- func (c *Client) UnsubscribePrivate(s string)
- func (c *Client) UnsubscribePublic(s string)
- type Event
- type Hub
- type IClient
- type IncrementalObject
- type Request
- type Topic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// User ID if authorized
Auth Auth
// contains filtered or unexported fields
}
Client is a middleman between the websocket connection and the hub.
func (*Client) GetSubscriptions ¶
func (*Client) SubscribePrivate ¶
func (*Client) SubscribePublic ¶
func (*Client) UnsubscribePrivate ¶
func (*Client) UnsubscribePublic ¶
type Hub ¶
type Hub struct {
// Register Requests from the clients.
Requests chan Request
// Unregister requests from clients.
Unregister chan IClient
// List of clients registered to public topics
PublicTopics map[string]*Topic
// List of clients registered to private topics
PrivateTopics map[string]map[string]*Topic
// map[prefix -> map[topic -> *Topic]]
PrefixedTopics map[string]map[string]*Topic
// Storage for incremental objects
IncrementalObjects map[string]*IncrementalObject
// map[prefix -> allowed roles]
RBAC map[string][]string
// contains filtered or unexported fields
}
Hub maintains the set of active clients and broadcasts messages to the clients.
func (*Hub) ListenWebsocketEvents ¶
func (h *Hub) ListenWebsocketEvents()
func (*Hub) ReceiveMsg ¶
ReceiveMsg handles AMQP messages
func (*Hub) SkipPrivateMsg ¶
type IClient ¶
type IClient interface {
Send(string)
Close()
GetAuth() Auth
GetSubscriptions() []string
SubscribePublic(string)
SubscribePrivate(string)
UnsubscribePublic(string)
UnsubscribePrivate(string)
}
FIXME: IClient looks very wrong.
type IncrementalObject ¶
Click to show internal directories.
Click to hide internal directories.