api

package
v0.0.0-...-736f05d Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 40 Imported by: 0

Documentation

Index

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) 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) Notify

func (a *App) Notify(event interface{})

func (*App) Run

func (a *App) Run()

func (*App) Shutdown

func (a *App) Shutdown()

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) V1GetRoom

func (a *App) V1GetRoom(w http.ResponseWriter, r *http.Request)

func (*App) V1GetUser

func (a *App) V1GetUser(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) V2GetRoomsStatistics

func (a *App) V2GetRoomsStatistics(w http.ResponseWriter, r *http.Request)

type AppCache

type AppCache struct {
	// contains filtered or unexported fields
}

func (*AppCache) Close

func (c *AppCache) Close()

func (*AppCache) Init

func (c *AppCache) Init(db common.DBInterface) error

func (*AppCache) ReloadAll

func (c *AppCache) ReloadAll(db common.DBInterface) error

type DynamicConfigCache

type DynamicConfigCache struct {
	// contains filtered or unexported fields
}

func (*DynamicConfigCache) ByKey

func (*DynamicConfigCache) LastModified

func (c *DynamicConfigCache) LastModified() time.Time

func (*DynamicConfigCache) Reload

func (*DynamicConfigCache) Set

func (*DynamicConfigCache) Values

func (c *DynamicConfigCache) Values() []*models.DynamicConfig

type DynamicConfigsResponse

type DynamicConfigsResponse struct {
	ListResponse
	Items []*models.DynamicConfig `json:"data"`
}

type GatewayCache

type GatewayCache struct {
	// contains filtered or unexported fields
}

func (*GatewayCache) ByID

func (c *GatewayCache) ByID(id int64) (*models.Gateway, bool)

func (*GatewayCache) ByName

func (c *GatewayCache) ByName(name string) (*models.Gateway, bool)

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 GatewayTokenCache

type GatewayTokenCache struct {
	// contains filtered or unexported fields
}

func (*GatewayTokenCache) ByID

func (c *GatewayTokenCache) ByID(id int64) (string, bool)

func (*GatewayTokenCache) Reload

func (c *GatewayTokenCache) Reload(db common.DBInterface) error

type GatewaysResponse

type GatewaysResponse struct {
	ListResponse
	Gateways []*GatewayDTO `json:"data"`
}

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 {
	// contains filtered or unexported fields
}

func NewMQTTListener

func NewMQTTListener(cache *AppCache, sph ServiceProtocolHandler) *MQTTListener

func (*MQTTListener) Close

func (l *MQTTListener) Close()

func (*MQTTListener) HandleServiceProtocol

func (l *MQTTListener) HandleServiceProtocol(c mqtt.Client, m mqtt.Message)

func (*MQTTListener) Start

func (l *MQTTListener) Start() error

func (*MQTTListener) Subscribe

func (l *MQTTListener) Subscribe(c mqtt.Client)

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) *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 RoomCache

type RoomCache struct {
	// contains filtered or unexported fields
}

func (*RoomCache) ByGatewayUID

func (c *RoomCache) ByGatewayUID(uid int) (*models.Room, bool)

func (*RoomCache) Reload

func (c *RoomCache) Reload(db common.DBInterface) error

func (*RoomCache) Set

func (c *RoomCache) Set(room *models.Room)

func (*RoomCache) Values

func (c *RoomCache) Values() []*models.Room

type RoomsRequest

type RoomsRequest struct {
	Gateways []int64
	Disabled null.Bool
	Removed  null.Bool
	Term     string
}

func ParseRoomsRequest

func ParseRoomsRequest(query url.Values) (*RoomsRequest, error)

type RoomsResponse

type RoomsResponse struct {
	ListResponse
	Rooms []*models.Room `json:"data"`
}

type ServiceProtocolHandler

type ServiceProtocolHandler interface {
	HandleMessage(string) error
}

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) SessionManager

type UserCache

type UserCache struct {
	// contains filtered or unexported fields
}

func (*UserCache) ByAccountsID

func (c *UserCache) ByAccountsID(id string) (*models.User, bool)

func (*UserCache) Reload

func (c *UserCache) Reload(db common.DBInterface) error

func (*UserCache) Set

func (c *UserCache) Set(user *models.User)

type V1Composite

type V1Composite struct {
	VQuad []*V1CompositeRoom `json:"vquad"`
}

type V1CompositeRoom

type V1CompositeRoom struct {
	V1Room
	Position int `json:"queue"`
}

type V1ProtocolMessageText

type V1ProtocolMessageText struct {
	Type   string
	Status bool
	Room   int
	User   V1User
}

type V1Room

type V1Room struct {
	V1RoomInfo
	Questions bool                   `json:"questions"`
	NumUsers  int                    `json:"num_users"`
	Users     []*V1User              `json:"users"`
	Region    string                 `json:"region"`
	Extra     map[string]interface{} `json:"extra"`
	// contains filtered or unexported fields
}

type V1RoomInfo

type V1RoomInfo struct {
	Room        int    `json:"room"`
	Janus       string `json:"janus"`
	Description string `json:"description"`
}

type V1ServiceProtocolHandler

type V1ServiceProtocolHandler struct {
	// contains filtered or unexported fields
}

func (*V1ServiceProtocolHandler) HandleMessage

func (h *V1ServiceProtocolHandler) HandleMessage(payload string) error

type V1ServiceProtocolMessageText

type V1ServiceProtocolMessageText struct {
	Type        string
	Status      bool
	Room        *int
	Column      *int `json:"col"`
	Index       *int `json:"i"`
	Transaction *string
}

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           int                    `json:"room"`
	Timestamp      int64                  `json:"timestamp"`
	Session        int64                  `json:"session"`
	Handle         int64                  `json:"handle"`
	RFID           int64                  `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 V2Config

type V2Config struct {
	Gateways      map[string]map[string]*V2Gateway `json:"gateways"`
	IceServers    map[string][]string              `json:"ice_servers"`
	DynamicConfig map[string]string                `json:"dynamic_config"`
	LastModified  time.Time                        `json:"last_modified"`
}

type V2Gateway

type V2Gateway struct {
	Name  string `json:"name"`
	URL   string `json:"url"`
	Type  string `json:"type"`
	Token string `json:"token"`
}

type V2RoomStatistics

type V2RoomStatistics struct {
	OnAir int `json:"on_air"`
}

Jump to

Keyboard shortcuts

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