socket

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: GPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 CloseRevokedConnections added in v0.8.0

func CloseRevokedConnections(username string) int

CloseRevokedConnections disconnects the websockets of a user logged in with a token that is no longer valid, e.g. after a password change

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
	JWTToken              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