Documentation ¶
Index ¶
Constants ¶
View Source
const Context = `WEBSERVER/WEBSOCKET`
Context to use when logging
View Source
const ContextBroadcast = "WEBSOCKET/BROADCAST"
ContextBroadcast used to identify the broadcast server in logging
View Source
const DeadlinePong = 3 * time.Minute
DeadlinePong to send after a ping request in the control message
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Broadcast ¶
type Broadcast struct {
// contains filtered or unexported fields
}
Broadcast for sending messages to channels subscribing to events here
func NewBroadcast ¶
func NewBroadcast() *Broadcast
NewBroadcast, creating a new map and new counter for messages and set up the server that handles new subscriptions.
func (Broadcast) BroadcastJson ¶
func (broadcast Broadcast) BroadcastJson(content interface{})
func (*Broadcast) Shutdown ¶
func (broadcast *Broadcast) Shutdown()
Shutdown the broadcast, closing the inner worker and setting the struct to nil
func (Broadcast) Subscribe ¶
Subscribe to the broadcast, with a new channel receiving messages being sent
func (Broadcast) Unsubscribe ¶
Click to show internal directories.
Click to hide internal directories.