socket

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

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

func WsProxyHandler(c *gin.Context)

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

type UserConnection added in v0.3.0

type UserConnection struct {
	Conn                 *websocket.Conn
	Username             string
	DisplayName          string
	PhoneNumbers         []string
	AccessKeyId          string
	TranscriptionEnabled bool
}

UserConnection represents a WebSocket connection with user data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL