config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpacedBlocks = [][]string{
	{"homeserver", "software"},
	{"appservice"},
	{"appservice", "hostname"},
	{"appservice", "database"},
	{"appservice", "id"},
	{"appservice", "as_token"},
	{"analytics"},
	{"google_messages"},
	{"bridge"},
	{"bridge", "command_prefix"},
	{"bridge", "management_room_text"},
	{"bridge", "encryption"},
	{"bridge", "provisioning"},
	{"bridge", "permissions"},
	{"logging"},
}

Functions

func DoUpgrade

func DoUpgrade(helper *up.Helper)

Types

type BridgeConfig

type BridgeConfig struct {
	UsernameTemplate    string `yaml:"username_template"`
	DisplaynameTemplate string `yaml:"displayname_template"`

	PersonalFilteringSpaces bool `yaml:"personal_filtering_spaces"`

	DeliveryReceipts    bool `yaml:"delivery_receipts"`
	MessageStatusEvents bool `yaml:"message_status_events"`
	MessageErrorNotices bool `yaml:"message_error_notices"`
	PortalMessageBuffer int  `yaml:"portal_message_buffer"`

	SyncDirectChatList   bool `yaml:"sync_direct_chat_list"`
	InitialChatSyncCount int  `yaml:"initial_chat_sync_count"`

	Backfill struct {
		InitialLimit int `yaml:"initial_limit"`
		MissedLimit  int `yaml:"missed_limit"`
	} `yaml:"backfill"`

	DoublePuppetConfig bridgeconfig.DoublePuppetConfig `yaml:",inline"`

	PrivateChatPortalMeta string `yaml:"private_chat_portal_meta"`
	BridgeNotices         bool   `yaml:"bridge_notices"`
	ResendBridgeInfo      bool   `yaml:"resend_bridge_info"`
	MuteBridging          bool   `yaml:"mute_bridging"`
	ArchiveTag            string `yaml:"archive_tag"`
	PinnedTag             string `yaml:"pinned_tag"`
	TagOnlyOnCreate       bool   `yaml:"tag_only_on_create"`
	FederateRooms         bool   `yaml:"federate_rooms"`
	CaptionInMessage      bool   `yaml:"caption_in_message"`
	BeeperGalleries       bool   `yaml:"beeper_galleries"`

	DisableBridgeAlerts bool `yaml:"disable_bridge_alerts"`

	CommandPrefix string `yaml:"command_prefix"`

	ManagementRoomText bridgeconfig.ManagementRoomTexts `yaml:"management_room_text"`

	Encryption bridgeconfig.EncryptionConfig `yaml:"encryption"`

	Provisioning struct {
		Prefix         string `yaml:"prefix"`
		SharedSecret   string `yaml:"shared_secret"`
		DebugEndpoints bool   `yaml:"debug_endpoints"`
	} `yaml:"provisioning"`

	Permissions bridgeconfig.PermissionConfig `yaml:"permissions"`

	ParsedUsernameTemplate *template.Template `yaml:"-"`
	// contains filtered or unexported fields
}

func (BridgeConfig) EnableMessageErrorNotices

func (bc BridgeConfig) EnableMessageErrorNotices() bool

func (BridgeConfig) EnableMessageStatusEvents

func (bc BridgeConfig) EnableMessageStatusEvents() bool

func (BridgeConfig) FormatDisplayname

func (bc BridgeConfig) FormatDisplayname(phone, fullName, firstName string) string

func (BridgeConfig) FormatUsername

func (bc BridgeConfig) FormatUsername(username string) string

func (BridgeConfig) GetCommandPrefix

func (bc BridgeConfig) GetCommandPrefix() string

func (BridgeConfig) GetDoublePuppetConfig added in v0.2.0

func (bc BridgeConfig) GetDoublePuppetConfig() bridgeconfig.DoublePuppetConfig

func (BridgeConfig) GetEncryptionConfig

func (bc BridgeConfig) GetEncryptionConfig() bridgeconfig.EncryptionConfig

func (BridgeConfig) GetManagementRoomTexts

func (bc BridgeConfig) GetManagementRoomTexts() bridgeconfig.ManagementRoomTexts

func (BridgeConfig) GetResendBridgeInfo

func (bc BridgeConfig) GetResendBridgeInfo() bool

func (*BridgeConfig) UnmarshalYAML

func (bc *BridgeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

func (BridgeConfig) Validate

func (bc BridgeConfig) Validate() error

type Config

type Config struct {
	*bridgeconfig.BaseConfig `yaml:",inline"`

	Analytics struct {
		Host   string `yaml:"host"`
		Token  string `yaml:"token"`
		UserID string `yaml:"user_id"`
	}

	GoogleMessages struct {
		OS      string `yaml:"os"`
		Browser string `yaml:"browser"`
		Device  string `yaml:"device"`

		AggressiveReconnect bool `yaml:"aggressive_reconnect"`
	} `yaml:"google_messages"`

	Bridge BridgeConfig `yaml:"bridge"`
}

func (*Config) CanAutoDoublePuppet

func (config *Config) CanAutoDoublePuppet(userID id.UserID) bool

type DisplaynameTemplateArgs

type DisplaynameTemplateArgs struct {
	PhoneNumber string
	FullName    string
	FirstName   string
}

Jump to

Keyboard shortcuts

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