config

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECORDER_BOT = "RECORDER_BOT"
	RTMP_BOT     = "RTMP_BOT"
)

Variables

This section is empty.

Functions

func SetAppConfig

func SetAppConfig(a *AppConfig)

func ValidateId

func ValidateId(fl validator.FieldLevel) bool

Types

type AppConfig

type AppConfig struct {
	DB  *sql.DB
	RDS *redis.Client

	sync.RWMutex

	ClientFiles map[string][]string

	Client              ClientInfo                 `yaml:"client"`
	RoomDefaultSettings *utils.RoomDefaultSettings `yaml:"room_default_settings"`
	LogSettings         LogSettings                `yaml:"log_settings"`
	LivekitInfo         LivekitInfo                `yaml:"livekit_info"`
	RedisInfo           *factory.RedisInfo         `yaml:"redis_info"`
	MySqlInfo           *factory.MySqlInfo         `yaml:"mysql_info"`
	UploadFileSettings  UploadFileSettings         `yaml:"upload_file_settings"`
	RecorderInfo        RecorderInfo               `yaml:"recorder_info"`
	SharedNotePad       SharedNotePad              `yaml:"shared_notepad"`
	// contains filtered or unexported fields
}
var AppCnf *AppConfig

func (*AppConfig) AddChatUser

func (a *AppConfig) AddChatUser(roomId string, participant ChatParticipant)

func (*AppConfig) AddRoomWithDurationMap

func (a *AppConfig) AddRoomWithDurationMap(roomId string, r RoomWithDuration)

func (*AppConfig) DeleteChatRoom

func (a *AppConfig) DeleteChatRoom(roomId string)

func (*AppConfig) DeleteRoomFromRoomWithDurationMap

func (a *AppConfig) DeleteRoomFromRoomWithDurationMap(roomId string)

func (*AppConfig) DoValidateReq

func (a *AppConfig) DoValidateReq(r interface{}) []*ErrorResponse

func (*AppConfig) FormatDBTable

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

func (*AppConfig) GetChatParticipants

func (a *AppConfig) GetChatParticipants(roomId string) map[string]ChatParticipant

func (*AppConfig) GetRoomsWithDurationMap

func (a *AppConfig) GetRoomsWithDurationMap() map[string]RoomWithDuration

func (*AppConfig) IncreaseRoomDuration

func (a *AppConfig) IncreaseRoomDuration(roomId string, duration uint64) uint64

func (*AppConfig) RemoveChatParticipant

func (a *AppConfig) RemoveChatParticipant(roomId, userId string)

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"`
	WebhookConf    WebhookConf              `yaml:"webhook_conf"`
	PrometheusConf PrometheusConf           `yaml:"prometheus"`
	ProxyHeader    string                   `yaml:"proxy_header"`
	CopyrightConf  *plugnmeet.CopyrightConf `yaml:"copyright_conf"`
}

type ErrorResponse

type ErrorResponse struct {
	FailedField string
	Tag         string
}

type EtherpadInfo

type EtherpadInfo struct {
	Id     string `yaml:"id"`
	Host   string `yaml:"host"`
	ApiKey string `yaml:"api_key"`
}

type LivekitInfo

type LivekitInfo struct {
	Host          string        `yaml:"host"`
	ApiKey        string        `yaml:"api_key"`
	Secret        string        `yaml:"secret"`
	TokenValidity time.Duration `yaml:"token_validity"`
}

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"`
}

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 RoomWithDuration

type RoomWithDuration struct {
	RoomSid   string
	Duration  uint64
	StartedAt uint64
}

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"`
	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