config

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecorderBot                          = "RECORDER_BOT"
	RtmpBot                              = "RTMP_BOT"
	IngressUserIdPrefix                  = "ingres_"
	MaxPreloadedWhiteboardFileSize int64 = 5 * 1000000 // limit to 5MB

	// all the time.Sleep() values
	WaitBeforeTriggerOnAfterRoomEnded        = 10 * time.Second
	WaitBeforeSpeechServicesOnAfterRoomEnded = 3 * time.Second
	WaitBeforeBreakoutRoomOnAfterRoomStart   = 2 * time.Second
	WaitBeforeAnalyticsStartProcessing       = 40 * time.Second
	MaxDurationWaitBeforeCleanRoomWebhook    = 1 * time.Minute
	WaitDurationIfRoomCreationLocked         = 1 * time.Second

	DefaultWebhookQueueSize = 200
)
View Source
const (
	RequestedRoomNotExist            = "requested room does not exist"
	OnlyAdminCanRequest              = "only admin can send this request"
	NoRoomIdInToken                  = "no roomId in token"
	UserNotActive                    = "user isn't active now"
	CanNotDemotePresenter            = "can't demote current presenter"
	CanNotChangeAlternativePresenter = "can't change alternative presenter"
	CanNotPromoteToPresenter         = "can't promote to presenter"
	InvalidConsumerKey               = "invalid consumer_key"
	VerificationFailed               = "verification failed"
	UserIdOrEmailRequired            = "either value of user_id or lis_person_contact_email_primary  required"
)

Variables

This section is empty.

Functions

func GetLogger added in v1.5.6

func GetLogger() *logrus.Logger

func New added in v1.7.1

func New(a *AppConfig)

Types

type AnalyticsSettings added in v1.5.0

type AnalyticsSettings struct {
	Enabled        bool           `yaml:"enabled"`
	FilesStorePath *string        `yaml:"files_store_path"`
	TokenValidity  *time.Duration `yaml:"token_validity"`
}

type AppConfig

type AppConfig struct {
	RDS         *redis.Client
	DB          *gorm.DB
	NatsConn    *nats.Conn
	JetStream   jetstream.JetStream
	ClientFiles map[string][]string

	RootWorkingDir               string
	Client                       ClientInfo                   `yaml:"client"`
	RoomDefaultSettings          *utils.RoomDefaultSettings   `yaml:"room_default_settings"`
	LogSettings                  LogSettings                  `yaml:"log_settings"`
	LivekitInfo                  LivekitInfo                  `yaml:"livekit_info"`
	RedisInfo                    RedisInfo                    `yaml:"redis_info"`
	DatabaseInfo                 DatabaseInfo                 `yaml:"database_info"`
	UploadFileSettings           UploadFileSettings           `yaml:"upload_file_settings"`
	RecorderInfo                 RecorderInfo                 `yaml:"recorder_info"`
	SharedNotePad                SharedNotePad                `yaml:"shared_notepad"`
	AzureCognitiveServicesSpeech AzureCognitiveServicesSpeech `yaml:"azure_cognitive_services_speech"`
	AnalyticsSettings            *AnalyticsSettings           `yaml:"analytics_settings"`
	NatsInfo                     NatsInfo                     `yaml:"nats_info"`
}

func GetConfig added in v1.7.1

func GetConfig() *AppConfig

func (*AppConfig) FormatDBTable

func (a *AppConfig) FormatDBTable(table string) string

type AzureCognitiveServicesSpeech added in v1.4.0

type AzureCognitiveServicesSpeech struct {
	Enabled                       bool                   `yaml:"enabled"`
	MaxNumTranLangsAllowSelecting int32                  `yaml:"max_num_tran_langs"`
	SubscriptionKeys              []AzureSubscriptionKey `yaml:"subscription_keys"`
}

type AzureSubscriptionKey added in v1.4.0

type AzureSubscriptionKey struct {
	Id              string `yaml:"id"`
	SubscriptionKey string `yaml:"subscription_key"`
	ServiceRegion   string `yaml:"service_region"`
	MaxConnection   int64  `yaml:"max_connection"`
}

type ChatParticipant

type ChatParticipant struct {
	RoomSid string
	RoomId  string
	Name    string
	UserSid string
	UserId  string
	UUID    string
	IsAdmin bool
}

type ClientInfo

type ClientInfo struct {
	Port           int            `yaml:"port"`
	Debug          bool           `yaml:"debug"`
	Path           string         `yaml:"path"`
	ApiKey         string         `yaml:"api_key"`
	Secret         string         `yaml:"secret"`
	TokenValidity  *time.Duration `yaml:"token_validity"`
	WebhookConf    WebhookConf    `yaml:"webhook_conf"`
	PrometheusConf PrometheusConf `yaml:"prometheus"`
	ProxyHeader    string         `yaml:"proxy_header"`
	CopyrightConf  *CopyrightConf `yaml:"copyright_conf"`
	BBBJoinHost    *string        `yaml:"bbb_join_host"`
}

type CopyrightConf added in v1.6.0

type CopyrightConf struct {
	Display       bool   `yaml:"display"`
	AllowOverride bool   `yaml:"allow_override"`
	Text          string `yaml:"text"`
}

type DatabaseInfo added in v1.7.1

type DatabaseInfo struct {
	DriverName      string         `yaml:"driver_name"`
	Host            string         `yaml:"host"`
	Port            int32          `yaml:"port"`
	Username        string         `yaml:"username"`
	Password        string         `yaml:"password"`
	DBName          string         `yaml:"db"`
	Prefix          string         `yaml:"prefix"`
	Charset         *string        `yaml:"charset"`
	Loc             *string        `yaml:"loc"`
	ConnMaxLifetime *time.Duration `yaml:"conn_max_lifetime"`
	MaxOpenConns    *int           `yaml:"max_open_conns"`
}

type ErrorResponse

type ErrorResponse struct {
	FailedField string
	Tag         string
}

type EtherpadInfo

type EtherpadInfo struct {
	Id           string `yaml:"id"`
	Host         string `yaml:"host"`
	ClientId     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
}

type LivekitInfo

type LivekitInfo struct {
	Host   string `yaml:"host"`
	ApiKey string `yaml:"api_key"`
	Secret string `yaml:"secret"`
}

type LogSettings

type LogSettings struct {
	LogFile    string  `yaml:"log_file"`
	MaxSize    int     `yaml:"max_size"`
	MaxBackups int     `yaml:"max_backups"`
	MaxAge     int     `yaml:"max_age"`
	LogLevel   *string `yaml:"log_level"`
}

type NatsInfo added in v1.7.1

type NatsInfo struct {
	NatsUrls                 []string         `yaml:"nats_urls"`
	NatsWSUrls               []string         `yaml:"nats_ws_urls"`
	Account                  string           `yaml:"account"`
	User                     string           `yaml:"user"`
	Password                 string           `yaml:"password"`
	AuthCalloutIssuerPrivate string           `yaml:"auth_callout_issuer_private"`
	NumReplicas              int              `yaml:"num_replicas"`
	Subjects                 NatsSubjects     `yaml:"subjects"`
	Recorder                 NatsInfoRecorder `yaml:"recorder"`
}

type NatsInfoRecorder added in v1.7.1

type NatsInfoRecorder struct {
	RecorderChannel string `yaml:"recorder_channel"`
	RecorderInfoKv  string `yaml:"recorder_info_kv"`
}

type NatsSubjects added in v1.7.1

type NatsSubjects struct {
	SystemApiWorker string `yaml:"system_api_worker"`
	SystemJsWorker  string `yaml:"system_js_worker"`
	SystemPublic    string `yaml:"system_public"`
	SystemPrivate   string `yaml:"system_private"`
	Chat            string `yaml:"chat"`
	Whiteboard      string `yaml:"whiteboard"`
	DataChannel     string `yaml:"data_channel"`
}

type PrometheusConf

type PrometheusConf struct {
	Enable      bool   `yaml:"enable"`
	MetricsPath string `yaml:"metrics_path"`
}

type RecorderInfo

type RecorderInfo struct {
	RecordingFilesPath string        `yaml:"recording_files_path"`
	TokenValidity      time.Duration `yaml:"token_validity"`
}

type RedisInfo

type RedisInfo struct {
	Host              string   `yaml:"host"`
	Username          string   `yaml:"username"`
	Password          string   `yaml:"password"`
	DBName            int      `yaml:"db"`
	UseTLS            bool     `yaml:"use_tls"`
	MasterName        string   `yaml:"sentinel_master_name"`
	SentinelUsername  string   `yaml:"sentinel_username"`
	SentinelPassword  string   `yaml:"sentinel_password"`
	SentinelAddresses []string `yaml:"sentinel_addresses"`
}

type SharedNotePad

type SharedNotePad struct {
	Enabled       bool           `yaml:"enabled"`
	EtherpadHosts []EtherpadInfo `yaml:"etherpad_hosts"`
}

type UploadFileSettings

type UploadFileSettings struct {
	Path                  string   `yaml:"path"`
	MaxSize               uint64   `yaml:"max_size"`
	MaxSizeWhiteboardFile uint64   `yaml:"max_size_whiteboard_file"`
	KeepForever           bool     `yaml:"keep_forever"`
	AllowedTypes          []string `yaml:"allowed_types"`
}

type WebhookConf

type WebhookConf struct {
	Enable              bool   `yaml:"enable"`
	Url                 string `yaml:"url,omitempty"`
	EnableForPerMeeting bool   `yaml:"enable_for_per_meeting"`
}

Jump to

Keyboard shortcuts

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