Documentation ¶
Index ¶
- type EventManager
- func (em *EventManager) Broadcast(endpoint string, message []byte)
- func (em *EventManager) BroadcastToAll(message []byte)
- func (em *EventManager) HandleConnection(conn *websocket.Conn, endpoint string)
- func (em *EventManager) UpgradeConnection(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventManager ¶
type EventManager struct {
// contains filtered or unexported fields
}
EventManager manages WebSocket connections and broadcasting of messages.
func NewEventManager ¶
func NewEventManager() *EventManager
NewEventManager creates a new EventManager instance.
func (*EventManager) Broadcast ¶
func (em *EventManager) Broadcast(endpoint string, message []byte)
Broadcast sends a message to all clients at the specified endpoint.
func (*EventManager) BroadcastToAll ¶
func (em *EventManager) BroadcastToAll(message []byte)
BroadcastToAll sends a message to all clients across all endpoints.
func (*EventManager) HandleConnection ¶
func (em *EventManager) HandleConnection(conn *websocket.Conn, endpoint string)
HandleConnection adds a WebSocket connection to the specified endpoint.
func (*EventManager) UpgradeConnection ¶
func (em *EventManager) UpgradeConnection(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)
UpgradeConnection upgrades an HTTP request to a WebSocket connection.
Click to show internal directories.
Click to hide internal directories.