Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Current = DefaultConfig()
Current loaded configuration.
Functions ¶
func LoadSettings ¶
func LoadSettings() error
LoadSettings reads a settings.toml from disk if available.
func WriteSettings ¶
func WriteSettings() error
WriteSettings will commit the settings.toml to disk.
Types ¶
type Channel ¶
type Channel struct { ID string // Like "lobby" Name string // Like "Main Chat Room" Icon string `toml:",omitempty"` // CSS class names for room icon (optional) VIP bool // For VIP users only PermitPhotos bool // photos are allowed to be shared // ChatServer messages to send to the user immediately upon connecting. WelcomeMessages []string }
Channel config for a default public room.
type Config ¶
type Config struct { Version int // will re-save your settings.toml on migrations JWT struct { Enabled bool Strict bool SecretKey string LandingPageURL string } Title string Branding string WebsiteURL string CORSHosts []string AdminAPIKey string PermitNSFW bool BlockableAdmins bool UseXForwardedFor bool WebSocketReadLimit int64 WebSocketSendTimeout int MaxImageWidth int PreviewImageWidth int TURN TurnConfig PublicChannels []Channel WebhookURLs []WebhookURL VIP VIP MessageFilters []*MessageFilter ModerationRule []*ModerationRule DirectMessageHistory DirectMessageHistory Strings Strings Logging Logging }
Config for your BareRTC app.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns sensible defaults and will write the initial settings.toml file to disk.
func (Config) GetChannel ¶
GetChannel looks up and returns a channel by ID.
func (Config) GetChannels ¶
GetChannels returns a JavaScript safe array of the default PublicChannels.
func (Config) GetModerationRule ¶
func (c Config) GetModerationRule(username string) *ModerationRule
GetModerationRule returns a matching ModerationRule for the given user, or nil if no rule is found.
type DirectMessageHistory ¶
type MessageFilter ¶
type MessageFilter struct { Enabled bool PublicChannels bool PrivateChannels bool KeywordPhrases []string CensorMessage bool ForwardMessage bool ReportMessage bool ChatServerResponse string // contains filtered or unexported fields }
MessageFilter configures censored or auto-flagged messages in chat.
func (*MessageFilter) IterPhrases ¶
func (mf *MessageFilter) IterPhrases() []*regexp.Regexp
IterPhrases returns the keyword phrases as regular expressions.
type ModerationRule ¶
type ModerationRule struct { Username string CameraAlwaysNSFW bool NoBroadcast bool NoVideo bool NoImage bool }
ModerationRule applies certain rules to moderate specific users.
type Strings ¶
type Strings struct { ModRuleErrorCameraAlwaysNSFW string ModRuleErrorNoBroadcast string ModRuleErrorNoVideo string ModRuleErrorNoImage string }
Strings config for customizing certain user-facing messaging around the app.
type TurnConfig ¶
type WebhookURL ¶
WebhookURL allows tighter integration with your website.