Documentation
¶
Index ¶
- type App
- func (a *App) AdminCreateDynamicConfig(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminCreateRoom(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminDeleteDynamicConfig(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminDeleteRoom(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminDeleteRoomsStatistics(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminGatewaysHandleInfo(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminGetDynamicConfig(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminGetRoom(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminListDynamicConfigs(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminListGateways(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminListRooms(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminListSessions(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminSetDynamicConfig(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminUpdateDynamicConfig(w http.ResponseWriter, r *http.Request)
- func (a *App) AdminUpdateRoom(w http.ResponseWriter, r *http.Request)
- func (a *App) HealthCheck(w http.ResponseWriter, r *http.Request)
- func (a *App) Initialize()
- func (a *App) InitializeWithDeps(db common.DBInterface, tokenVerifier middleware.OIDCTokenVerifier)
- func (a *App) Run()
- func (a *App) Shutdown()
- func (a *App) V1CreateGroup(w http.ResponseWriter, r *http.Request)
- func (a *App) V1GetComposite(w http.ResponseWriter, r *http.Request)
- func (a *App) V1GetRoom(w http.ResponseWriter, r *http.Request)
- func (a *App) V1GetUser(w http.ResponseWriter, r *http.Request)
- func (a *App) V1HandleEvent(w http.ResponseWriter, r *http.Request)
- func (a *App) V1HandleProtocol(w http.ResponseWriter, r *http.Request)
- func (a *App) V1HandleServiceProtocol(w http.ResponseWriter, r *http.Request)
- func (a *App) V1ListComposites(w http.ResponseWriter, r *http.Request)
- func (a *App) V1ListGroups(w http.ResponseWriter, r *http.Request)
- func (a *App) V1ListRooms(w http.ResponseWriter, r *http.Request)
- func (a *App) V1ListUsers(w http.ResponseWriter, r *http.Request)
- func (a *App) V1UpdateComposite(w http.ResponseWriter, r *http.Request)
- func (a *App) V1UpdateRoom(w http.ResponseWriter, r *http.Request)
- func (a *App) V1UpdateSession(w http.ResponseWriter, r *http.Request)
- func (a *App) V2GetConfig(w http.ResponseWriter, r *http.Request)
- func (a *App) V2GetRoomServer(w http.ResponseWriter, r *http.Request)
- func (a *App) V2GetRoomsStatistics(w http.ResponseWriter, r *http.Request)
- func (a *App) V2GetVHInfo(w http.ResponseWriter, r *http.Request)
- type AppCache
- type DynamicConfigCache
- func (c *DynamicConfigCache) ByKey(key string) (*models.DynamicConfig, bool)
- func (c *DynamicConfigCache) LastModified() time.Time
- func (c *DynamicConfigCache) Reload(db common.DBInterface) error
- func (c *DynamicConfigCache) Set(kv *models.DynamicConfig)
- func (c *DynamicConfigCache) Values() []*models.DynamicConfig
- type DynamicConfigsResponse
- type FailoverMapping
- type GatewayCache
- type GatewayDTO
- type GatewayStatus
- type GatewaysResponse
- type JanusAdminResponse
- type JanusStatusMessage
- type ListParams
- type ListResponse
- type MQTTListener
- func (l *MQTTListener) Client() mqtt.Client
- func (l *MQTTListener) Close()
- func (l *MQTTListener) GetGatewayStatuses() map[string]*common.GatewayStatusInfo
- func (l *MQTTListener) HandleEvent(c mqtt.Client, m mqtt.Message)
- func (l *MQTTListener) HandleGatewayAdminResponse(c mqtt.Client, m mqtt.Message)
- func (l *MQTTListener) HandleGatewayStatus(c mqtt.Client, m mqtt.Message)
- func (l *MQTTListener) HandleServiceProtocol(c mqtt.Client, m mqtt.Message)
- func (l *MQTTListener) IsGatewayOnline(serverName string) bool
- func (l *MQTTListener) SendAdminMessage(topic string)
- func (l *MQTTListener) SetAdminClient(ac *janus.MQTTAdminClient)
- func (l *MQTTListener) Start() error
- func (l *MQTTListener) Subscribe(c mqtt.Client)
- func (l *MQTTListener) UpdateSession(c mqtt.Client, m mqtt.Message)
- type PahoLogAdapter
- type PeriodicSessionCleaner
- type ProtocolError
- type RoomCache
- type RoomsRequest
- type RoomsResponse
- type ServiceProtocolHandler
- type SessionManager
- type SessionsResponse
- type UserCache
- type V1Composite
- type V1CompositeRoom
- type V1ProtocolMessageText
- type V1Room
- type V1RoomInfo
- type V1ServiceProtocolHandler
- type V1ServiceProtocolMessageText
- type V1SessionManager
- func (sm *V1SessionManager) Close()
- func (sm *V1SessionManager) HandleEvent(ctx context.Context, event interface{}) error
- func (sm *V1SessionManager) HandleProtocol(ctx context.Context, msg *janus.TextroomPostMsg) error
- func (sm *V1SessionManager) Start()
- func (sm *V1SessionManager) UpsertSession(ctx context.Context, user *V1User) error
- type V1User
- type V2Config
- type V2Gateway
- type V2RoomServerRequest
- type V2RoomServerRequestGeo
- type V2RoomServerResponse
- type V2RoomStatistics
- type VHInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Router *mux.Router
Handler http.Handler
DB common.DBInterface
// contains filtered or unexported fields
}
func (*App) AdminCreateDynamicConfig ¶
func (a *App) AdminCreateDynamicConfig(w http.ResponseWriter, r *http.Request)
func (*App) AdminCreateRoom ¶
func (a *App) AdminCreateRoom(w http.ResponseWriter, r *http.Request)
func (*App) AdminDeleteDynamicConfig ¶
func (a *App) AdminDeleteDynamicConfig(w http.ResponseWriter, r *http.Request)
func (*App) AdminDeleteRoom ¶
func (a *App) AdminDeleteRoom(w http.ResponseWriter, r *http.Request)
func (*App) AdminDeleteRoomsStatistics ¶
func (a *App) AdminDeleteRoomsStatistics(w http.ResponseWriter, r *http.Request)
func (*App) AdminGatewaysHandleInfo ¶
func (a *App) AdminGatewaysHandleInfo(w http.ResponseWriter, r *http.Request)
func (*App) AdminGetDynamicConfig ¶
func (a *App) AdminGetDynamicConfig(w http.ResponseWriter, r *http.Request)
func (*App) AdminGetRoom ¶
func (a *App) AdminGetRoom(w http.ResponseWriter, r *http.Request)
func (*App) AdminListDynamicConfigs ¶
func (a *App) AdminListDynamicConfigs(w http.ResponseWriter, r *http.Request)
func (*App) AdminListGateways ¶
func (a *App) AdminListGateways(w http.ResponseWriter, r *http.Request)
func (*App) AdminListRooms ¶
func (a *App) AdminListRooms(w http.ResponseWriter, r *http.Request)
func (*App) AdminListSessions ¶
func (a *App) AdminListSessions(w http.ResponseWriter, r *http.Request)
func (*App) AdminSetDynamicConfig ¶
func (a *App) AdminSetDynamicConfig(w http.ResponseWriter, r *http.Request)
func (*App) AdminUpdateDynamicConfig ¶
func (a *App) AdminUpdateDynamicConfig(w http.ResponseWriter, r *http.Request)
func (*App) AdminUpdateRoom ¶
func (a *App) AdminUpdateRoom(w http.ResponseWriter, r *http.Request)
func (*App) HealthCheck ¶
func (a *App) HealthCheck(w http.ResponseWriter, r *http.Request)
func (*App) Initialize ¶
func (a *App) Initialize()
func (*App) InitializeWithDeps ¶
func (a *App) InitializeWithDeps(db common.DBInterface, tokenVerifier middleware.OIDCTokenVerifier)
func (*App) V1CreateGroup ¶
func (a *App) V1CreateGroup(w http.ResponseWriter, r *http.Request)
func (*App) V1GetComposite ¶
func (a *App) V1GetComposite(w http.ResponseWriter, r *http.Request)
func (*App) V1HandleEvent ¶
func (a *App) V1HandleEvent(w http.ResponseWriter, r *http.Request)
func (*App) V1HandleProtocol ¶
func (a *App) V1HandleProtocol(w http.ResponseWriter, r *http.Request)
func (*App) V1HandleServiceProtocol ¶
func (a *App) V1HandleServiceProtocol(w http.ResponseWriter, r *http.Request)
func (*App) V1ListComposites ¶
func (a *App) V1ListComposites(w http.ResponseWriter, r *http.Request)
func (*App) V1ListGroups ¶
func (a *App) V1ListGroups(w http.ResponseWriter, r *http.Request)
func (*App) V1ListRooms ¶
func (a *App) V1ListRooms(w http.ResponseWriter, r *http.Request)
func (*App) V1ListUsers ¶
func (a *App) V1ListUsers(w http.ResponseWriter, r *http.Request)
func (*App) V1UpdateComposite ¶
func (a *App) V1UpdateComposite(w http.ResponseWriter, r *http.Request)
func (*App) V1UpdateRoom ¶
func (a *App) V1UpdateRoom(w http.ResponseWriter, r *http.Request)
func (*App) V1UpdateSession ¶
func (a *App) V1UpdateSession(w http.ResponseWriter, r *http.Request)
func (*App) V2GetConfig ¶
func (a *App) V2GetConfig(w http.ResponseWriter, r *http.Request)
func (*App) V2GetRoomServer ¶
func (a *App) V2GetRoomServer(w http.ResponseWriter, r *http.Request)
func (*App) V2GetRoomsStatistics ¶
func (a *App) V2GetRoomsStatistics(w http.ResponseWriter, r *http.Request)
func (*App) V2GetVHInfo ¶
func (a *App) V2GetVHInfo(w http.ResponseWriter, r *http.Request)
type DynamicConfigCache ¶
type DynamicConfigCache struct {
// contains filtered or unexported fields
}
func (*DynamicConfigCache) ByKey ¶
func (c *DynamicConfigCache) ByKey(key string) (*models.DynamicConfig, bool)
func (*DynamicConfigCache) LastModified ¶
func (c *DynamicConfigCache) LastModified() time.Time
func (*DynamicConfigCache) Reload ¶
func (c *DynamicConfigCache) Reload(db common.DBInterface) error
func (*DynamicConfigCache) Set ¶
func (c *DynamicConfigCache) Set(kv *models.DynamicConfig)
func (*DynamicConfigCache) Values ¶
func (c *DynamicConfigCache) Values() []*models.DynamicConfig
type DynamicConfigsResponse ¶
type DynamicConfigsResponse struct {
ListResponse
Items []*models.DynamicConfig `json:"data"`
}
type FailoverMapping ¶
type FailoverMapping struct {
FailedServer string // Primary server that failed (e.g., "gxy1")
FailoverServer string // Failover server replacing it (e.g., "gxy12")
FailedAt time.Time // When failover happened
}
FailoverMapping tracks which failover server is serving which failed primary
type GatewayCache ¶
type GatewayCache struct {
// contains filtered or unexported fields
}
func (*GatewayCache) Reload ¶
func (c *GatewayCache) Reload(db common.DBInterface) error
func (*GatewayCache) Set ¶
func (c *GatewayCache) Set(gateway *models.Gateway)
func (*GatewayCache) Values ¶
func (c *GatewayCache) Values() []*models.Gateway
type GatewayDTO ¶
type GatewayDTO struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description null.String `json:"description,omitempty"`
URL string `json:"url"`
Disabled bool `json:"disabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt null.Time `json:"updated_at,omitempty"`
RemovedAt null.Time `json:"removed_at,omitempty"`
Type string `json:"type"`
}
func NewGatewayDTO ¶
func NewGatewayDTO(g *models.Gateway) *GatewayDTO
type GatewayStatus ¶
type GatewayStatus struct {
Name string
Online bool
Sessions int
LastSeen time.Time
OfflineAt time.Time // When server went offline
OfflineTimer *time.Timer // Timer for failover trigger
// contains filtered or unexported fields
}
GatewayStatus holds the status of a Janus gateway
type GatewaysResponse ¶
type GatewaysResponse struct {
ListResponse
Gateways []*GatewayDTO `json:"data"`
}
type JanusAdminResponse ¶
type JanusAdminResponse struct {
Janus string `json:"janus"`
Transaction string `json:"transaction"`
Sessions []int64 `json:"sessions"`
}
JanusAdminResponse represents the response from Janus admin API
type JanusStatusMessage ¶
type JanusStatusMessage struct {
Online bool `json:"online"`
}
JanusStatusMessage represents the status message from Janus gateway
type ListParams ¶
type ListParams struct {
PageNumber int `json:"page_no"`
PageSize int `json:"page_size"`
OrderBy string `json:"order_by"`
GroupBy string `json:"-"`
}
func ParseListParams ¶
func ParseListParams(query url.Values) (*ListParams, error)
type ListResponse ¶
type ListResponse struct {
Total int64 `json:"total"`
}
type MQTTListener ¶
type MQTTListener struct {
SessionManager SessionManager
// contains filtered or unexported fields
}
func NewMQTTListener ¶
func NewMQTTListener(cache *AppCache, sph ServiceProtocolHandler, sm SessionManager, adminSecret string, roomServerAssignmentMgr *domain.RoomServerAssignmentManager) *MQTTListener
func (*MQTTListener) Client ¶
func (l *MQTTListener) Client() mqtt.Client
func (*MQTTListener) Close ¶
func (l *MQTTListener) Close()
func (*MQTTListener) GetGatewayStatuses ¶
func (l *MQTTListener) GetGatewayStatuses() map[string]*common.GatewayStatusInfo
GetGatewayStatuses returns a copy of all gateway statuses (thread-safe) Returns simple structs without mutexes for external use
func (*MQTTListener) HandleEvent ¶
func (l *MQTTListener) HandleEvent(c mqtt.Client, m mqtt.Message)
func (*MQTTListener) HandleGatewayAdminResponse ¶
func (l *MQTTListener) HandleGatewayAdminResponse(c mqtt.Client, m mqtt.Message)
HandleGatewayAdminResponse processes admin responses from Janus gateways (janus/{server}/from-janus-admin)
func (*MQTTListener) HandleGatewayStatus ¶
func (l *MQTTListener) HandleGatewayStatus(c mqtt.Client, m mqtt.Message)
HandleGatewayStatus processes status messages from Janus gateways (janus/{server}/status)
func (*MQTTListener) HandleServiceProtocol ¶
func (l *MQTTListener) HandleServiceProtocol(c mqtt.Client, m mqtt.Message)
func (*MQTTListener) IsGatewayOnline ¶
func (l *MQTTListener) IsGatewayOnline(serverName string) bool
IsGatewayOnline implements domain.GatewayStatusChecker
func (*MQTTListener) SendAdminMessage ¶
func (l *MQTTListener) SendAdminMessage(topic string)
SendAdminMessage sends a list_sessions request to a Janus gateway
func (*MQTTListener) SetAdminClient ¶
func (l *MQTTListener) SetAdminClient(ac *janus.MQTTAdminClient)
func (*MQTTListener) Start ¶
func (l *MQTTListener) Start() error
func (*MQTTListener) Subscribe ¶
func (l *MQTTListener) Subscribe(c mqtt.Client)
func (*MQTTListener) UpdateSession ¶
func (l *MQTTListener) UpdateSession(c mqtt.Client, m mqtt.Message)
type PahoLogAdapter ¶
type PahoLogAdapter struct {
// contains filtered or unexported fields
}
func NewPahoLogAdapter ¶
func NewPahoLogAdapter(level zerolog.Level) *PahoLogAdapter
func (*PahoLogAdapter) Printf ¶
func (a *PahoLogAdapter) Printf(format string, v ...interface{})
func (*PahoLogAdapter) Println ¶
func (a *PahoLogAdapter) Println(v ...interface{})
type PeriodicSessionCleaner ¶
type PeriodicSessionCleaner struct {
// contains filtered or unexported fields
}
func NewPeriodicSessionCleaner ¶
func NewPeriodicSessionCleaner(db common.DBInterface, rsam *domain.RoomServerAssignmentManager) *PeriodicSessionCleaner
func (*PeriodicSessionCleaner) Close ¶
func (psc *PeriodicSessionCleaner) Close()
func (*PeriodicSessionCleaner) Start ¶
func (psc *PeriodicSessionCleaner) Start()
type ProtocolError ¶
type ProtocolError struct {
errs.WithMessage
}
func NewProtocolError ¶
func NewProtocolError(msg string) *ProtocolError
func WrappingProtocolError ¶
func WrappingProtocolError(err error, msg string) *ProtocolError
type RoomsRequest ¶
func ParseRoomsRequest ¶
func ParseRoomsRequest(query url.Values) (*RoomsRequest, error)
type RoomsResponse ¶
type RoomsResponse struct {
ListResponse
Rooms []*models.Room `json:"data"`
}
type ServiceProtocolHandler ¶
func NewV1ServiceProtocolHandler ¶
func NewV1ServiceProtocolHandler(cache *AppCache, rsm *domain.RoomStatisticsManager) ServiceProtocolHandler
type SessionManager ¶
type SessionManager interface {
HandleEvent(context.Context, interface{}) error
HandleProtocol(context.Context, *janus.TextroomPostMsg) error
UpsertSession(context.Context, *V1User) error
Start()
Close()
}
func NewV1SessionManager ¶
func NewV1SessionManager(db common.DBInterface, cache *AppCache, rsam *domain.RoomServerAssignmentManager) SessionManager
type SessionsResponse ¶
type SessionsResponse struct {
ListResponse
Sessions []*V1User `json:"data"`
}
type V1Composite ¶
type V1Composite struct {
VQuad []*V1CompositeRoom `json:"vquad"`
}
type V1CompositeRoom ¶
type V1ProtocolMessageText ¶
type V1RoomInfo ¶
type V1ServiceProtocolHandler ¶
type V1ServiceProtocolHandler struct {
// contains filtered or unexported fields
}
func (*V1ServiceProtocolHandler) HandleMessage ¶
func (h *V1ServiceProtocolHandler) HandleMessage(ctx context.Context, payload string) error
type V1SessionManager ¶
type V1SessionManager struct {
// contains filtered or unexported fields
}
func (*V1SessionManager) Close ¶
func (sm *V1SessionManager) Close()
func (*V1SessionManager) HandleEvent ¶
func (sm *V1SessionManager) HandleEvent(ctx context.Context, event interface{}) error
func (*V1SessionManager) HandleProtocol ¶
func (sm *V1SessionManager) HandleProtocol(ctx context.Context, msg *janus.TextroomPostMsg) error
func (*V1SessionManager) Start ¶
func (sm *V1SessionManager) Start()
func (*V1SessionManager) UpsertSession ¶
func (sm *V1SessionManager) UpsertSession(ctx context.Context, user *V1User) error
type V1User ¶
type V1User struct {
ID string `json:"id"`
Display string `json:"display"`
Email string `json:"email"`
Group string `json:"group"`
IP string `json:"ip"`
Janus string `json:"janus"`
Name string `json:"name"`
Role string `json:"role"`
System string `json:"system"`
Username string `json:"username"`
Room string `json:"room"` // Changed from int to string for Janus string ID support
Timestamp int64 `json:"timestamp"`
Session int64 `json:"session"`
Handle int64 `json:"handle"`
RFID string `json:"rfid"`
TextroomHandle int64 `json:"textroom_handle"`
Camera bool `json:"camera"`
Question bool `json:"question"`
SelfTest bool `json:"self_test"`
SoundTest bool `json:"sound_test"`
Extra map[string]interface{} `json:"extra"`
}
type V2RoomServerRequest ¶
type V2RoomServerRequest struct {
Room string `json:"room"` // Changed from int to string for Janus string ID support
Geo *V2RoomServerRequestGeo `json:"geo,omitempty"`
}
type V2RoomServerRequestGeo ¶
type V2RoomServerRequestGeo struct {
CountryCode string `json:"country_code,omitempty"` // e.g., "US", "RU", "IL"
}
type V2RoomServerResponse ¶
type V2RoomServerResponse struct {
Janus string `json:"janus"`
}
type V2RoomStatistics ¶
type V2RoomStatistics struct {
OnAir int `json:"on_air"`
}