Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Upgrader = up.SimpleUpgrader(doUpgrade)
Upgrader is a config upgrader that copies the default fields in the homeserver, appservice and logging blocks.
Functions ¶
func RegisterPermissionLevel ¶
func RegisterPermissionLevel(name string, level PermissionLevel)
Types ¶
type AppserviceConfig ¶
type AppserviceConfig struct { Address string `yaml:"address"` Hostname string `yaml:"hostname"` Port uint16 `yaml:"port"` Database DatabaseConfig `yaml:"database"` ID string `yaml:"id"` Bot BotUserConfig `yaml:"bot"` ASToken string `yaml:"as_token"` HSToken string `yaml:"hs_token"` EphemeralEvents bool `yaml:"ephemeral_events"` }
func (*AppserviceConfig) GetRegistration ¶
func (asc *AppserviceConfig) GetRegistration() *appservice.Registration
GetRegistration copies the data from the bridge config into an *appservice.Registration struct. This can't be used with the homeserver, see GenerateRegistration for generating files for the homeserver.
type BaseConfig ¶
type BaseConfig struct { Homeserver HomeserverConfig `yaml:"homeserver"` AppService AppserviceConfig `yaml:"appservice"` Bridge BridgeConfig `yaml:"-"` Logging appservice.LogConfig `yaml:"logging"` }
func (*BaseConfig) GenerateRegistration ¶
func (config *BaseConfig) GenerateRegistration() *appservice.Registration
GenerateRegistration generates a registration file for the homeserver.
func (*BaseConfig) MakeAppService ¶
func (config *BaseConfig) MakeAppService() *appservice.AppService
func (*BaseConfig) MakeUserIDRegex ¶
func (config *BaseConfig) MakeUserIDRegex() *regexp.Regexp
type BotUserConfig ¶
type BotUserConfig struct { Username string `yaml:"username"` Displayname string `yaml:"displayname"` Avatar string `yaml:"avatar"` ParsedAvatar id.ContentURI `yaml:"-"` }
func (*BotUserConfig) UnmarshalYAML ¶
func (buc *BotUserConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type BridgeConfig ¶
type BridgeConfig interface { FormatUsername(username string) string GetEncryptionConfig() EncryptionConfig GetCommandPrefix() string GetManagementRoomTexts() ManagementRoomTexts GetResendBridgeInfo() bool EnableMessageStatusEvents() bool EnableMessageErrorNotices() bool Validate() error }
type DatabaseConfig ¶
type EncryptionConfig ¶
type EncryptionConfig struct { Allow bool `yaml:"allow"` Default bool `yaml:"default"` Require bool `yaml:"require"` Appservice bool `yaml:"appservice"` VerificationLevels struct { Receive id.TrustState `yaml:"receive"` Send id.TrustState `yaml:"send"` Share id.TrustState `yaml:"share"` } `yaml:"verification_levels"` AllowKeySharing bool `yaml:"allow_key_sharing"` Rotation struct { EnableCustom bool `yaml:"enable_custom"` Milliseconds int64 `yaml:"milliseconds"` Messages int `yaml:"messages"` } `yaml:"rotation"` }
type HomeserverConfig ¶
type HomeserverConfig struct { Address string `yaml:"address"` Domain string `yaml:"domain"` AsyncMedia bool `yaml:"async_media"` Asmux bool `yaml:"asmux"` StatusEndpoint string `yaml:"status_endpoint"` MessageSendCheckpointEndpoint string `yaml:"message_send_checkpoint_endpoint"` WSProxy string `yaml:"websocket_proxy"` WSPingInterval int `yaml:"ping_interval_seconds"` }
type ManagementRoomTexts ¶
type PermissionConfig ¶
type PermissionConfig map[string]PermissionLevel
func (PermissionConfig) Get ¶
func (pc PermissionConfig) Get(userID id.UserID) PermissionLevel
func (*PermissionConfig) UnmarshalYAML ¶
func (pc *PermissionConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type PermissionLevel ¶
type PermissionLevel int
const ( PermissionLevelBlock PermissionLevel = 0 PermissionLevelRelay PermissionLevel = 5 PermissionLevelUser PermissionLevel = 10 PermissionLevelAdmin PermissionLevel = 100 )
Click to show internal directories.
Click to hide internal directories.