socket

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastSummaryMessage added in v0.5.0

func BroadcastSummaryMessage(message interface{})

BroadcastSummaryMessage sends a summary update to all connected clients.

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) BroadcastSummaryMessageToUser added in v0.5.0

func (cm *ConnectionManager) BroadcastSummaryMessageToUser(username string, data interface{})

BroadcastSummaryMessageToUser sends a summary update only to the target user's 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

func (*ConnectionManager) WriteMessage added in v0.5.0

func (cm *ConnectionManager) WriteMessage(conn *websocket.Conn, messageType int, data []byte) error

WriteMessage serializes websocket writes for a connection to avoid concurrent writes.

type SummaryTarget added in v0.5.0

type SummaryTarget interface {
	TargetUsername() string
}

type UserConnection added in v0.3.0

type UserConnection struct {
	Conn                  *websocket.Conn
	Username              string
	DisplayName           string
	PhoneNumbers          []string
	AccessKeyId           string
	TranscriptionEnabled  bool
	TranscriptionUniqueID string
	// contains filtered or unexported fields
}

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