Documentation
¶
Index ¶
- func SetMQTTChannel(ch chan mqtt.WebSocketMessage)
- func WsProxyHandler(c *gin.Context)
- type ConnectionManager
- func (cm *ConnectionManager) AddConnection(conn *websocket.Conn, user *UserConnection)
- func (cm *ConnectionManager) BroadcastMQTTMessage(messageType string, data interface{})
- func (cm *ConnectionManager) GetAllConnections() map[*websocket.Conn]*UserConnection
- func (cm *ConnectionManager) GetConnection(conn *websocket.Conn) (*UserConnection, bool)
- func (cm *ConnectionManager) IsAuthorizedForTranscription(conn *websocket.Conn, ...) bool
- func (cm *ConnectionManager) RemoveConnection(conn *websocket.Conn)
- type UserConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetMQTTChannel ¶ added in v0.3.0
func SetMQTTChannel(ch chan mqtt.WebSocketMessage)
SetMQTTChannel sets the MQTT channel for forwarding messages to WebSocket clients
func WsProxyHandler ¶
Types ¶
type ConnectionManager ¶ added in v0.3.0
type ConnectionManager struct {
// contains filtered or unexported fields
}
ConnectionManager manages all active WebSocket connections
func (*ConnectionManager) AddConnection ¶ added in v0.3.0
func (cm *ConnectionManager) AddConnection(conn *websocket.Conn, user *UserConnection)
AddConnection adds a new connection to the manager
func (*ConnectionManager) BroadcastMQTTMessage ¶ added in v0.3.0
func (cm *ConnectionManager) BroadcastMQTTMessage(messageType string, data interface{})
BroadcastMQTTMessage sends an MQTT message to all authorized connections
func (*ConnectionManager) GetAllConnections ¶ added in v0.3.0
func (cm *ConnectionManager) GetAllConnections() map[*websocket.Conn]*UserConnection
GetAllConnections returns all active connections
func (*ConnectionManager) GetConnection ¶ added in v0.3.0
func (cm *ConnectionManager) GetConnection(conn *websocket.Conn) (*UserConnection, bool)
GetConnection gets connection data for a specific connection
func (*ConnectionManager) IsAuthorizedForTranscription ¶ added in v0.3.0
func (cm *ConnectionManager) IsAuthorizedForTranscription(conn *websocket.Conn, speakerName, speakerNumber, counterpartName, counterpartNumber string) bool
IsAuthorizedForTranscription checks if a user is authorized to receive a transcription
func (*ConnectionManager) RemoveConnection ¶ added in v0.3.0
func (cm *ConnectionManager) RemoveConnection(conn *websocket.Conn)
RemoveConnection removes a connection from the manager
Click to show internal directories.
Click to hide internal directories.