config

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogLevel string

	UserAgent string
)

Functions

func SetLogLevel added in v0.31.0

func SetLogLevel(level logrus.Level)

func SetLogger added in v0.31.0

func SetLogger(l *logrus.Entry)

Types

type AIConfig added in v0.32.0

type AIConfig struct {
	Enabled            bool
	Provider           string // "gemini" (default) or "copilot"
	Token              string // GitHub token for Copilot
	ServiceAccountFile string // Gemini / Vertex AI
	Project            string
	Location           string
	Model              string            // Fallback model if not specified in Models map
	Models             map[string]string // Provider-specific models, e.g. { "gemini": "gemini-3.8-flash", "copilot": "gpt-4o-mini" }
	Prompt             string
	DefaultPostLimit   int
	MaxPostLimit       int
}

type BridgeConfig added in v0.31.0

type BridgeConfig struct {
	Restrict []string

	JoinOnly    []string
	JoinExclude []string
	JoinInclude []string
	JoinDM      bool

	ShowJoinPart   bool
	ShowOnlyJoined bool
	PartFake       bool

	// Threading / context related
	PrefixContext    bool
	SuffixContext    bool
	ThreadContext    string
	ShowContextMulti bool
}

type Config

type Config struct {
	// contains filtered or unexported fields
}

func Load added in v0.31.0

func Load(cfgfile string, flags *pflag.FlagSet) (*Config, error)

func (*Config) AI added in v0.32.0

func (c *Config) AI() *AIConfig

func (*Config) Current added in v0.31.0

func (c *Config) Current() *RuntimeConfig

func (*Config) Mastodon added in v0.31.0

func (c *Config) Mastodon() *MastodonConfig

func (*Config) Mattermost added in v0.17.0

func (c *Config) Mattermost() *MattermostConfig

func (*Config) RegisterReloadHook added in v0.31.0

func (c *Config) RegisterReloadHook(hook func(rc *RuntimeConfig))

RegisterReloadHook allows other packages to execute logic when the config file changes.

func (*Config) Reload added in v0.31.0

func (c *Config) Reload() error

Reload re-reads the config file, updates the atomic pointer, and triggers hooks.

func (*Config) Slack added in v0.17.0

func (c *Config) Slack() *SlackConfig

type FormatterConfig added in v0.31.0

type FormatterConfig struct {
	DisableEmoji bool
	CustomEmoji  map[string]string

	DisableMarkdown           bool
	DisableMarkdownBlockQuote bool
	MarkdownBlockQuoteChar    string
	MarkdownInlineCode        string

	SyntaxHighlighting     string
	DisableCodeBlockPrefix bool
	CodeBlockPrefix        string
	CodeBlockSeparator     string

	Unicode bool

	EnableIRCHexColors bool

	PreserveNewLines string
}

type GlobalConfig added in v0.31.0

type GlobalConfig struct {
	Bind string

	Debug         bool
	Trace         bool
	Gops          bool
	Profiling     bool
	ProfilingBind string

	TLSBind string
	TLSDir  string
	TLSKey  string
	TLSCert string

	HandshakeTimeout int
	ClientTimeout    int

	PasteBufferTimeout int

	EnableTyping      bool
	DisableSendTyping bool
}

type MastodonConfig added in v0.31.0

type MastodonConfig struct {
	Bridge    BridgeConfig
	Formatter FormatterConfig

	Server string

	ClientID     string
	ClientSecret string
	AccessToken  string
}

type MattermostConfig added in v0.31.0

type MattermostConfig struct {
	Bridge    BridgeConfig
	Formatter FormatterConfig

	MatterclientLogLevel string

	DefaultServer string
	DefaultTeam   string

	Insecure            bool
	IgnoreServerVersion bool

	CollapseScrollback bool

	SkipTLSVerify bool

	PrefixMainTeam bool

	ForceAntiIdle    bool
	AntiIdleChannel  string
	AntiIdleInterval int

	PreferNickname bool

	HideReplies      bool
	ShortenRepliesTo int

	HideReactions    bool
	ShowOwnReactions bool

	ShowMentions bool

	DisableDefaultMentions bool
	DisableShowOwnModified bool

	DisableAutoView      bool
	LastViewedSaveFile   string
	ReplayStrategy       string
	EnableLazyJoin       bool
	LazyJoinExclude      []string
	ReplayExclude        []string
	ForceSyncOnReconnect bool

	JoinReplayDuration        time.Duration
	MaxReplayDuration         time.Duration
	LazyJoinDuration          time.Duration
	DefaultDMOfflineThreshold time.Duration
	HeavySyncThreshold        time.Duration

	MessageAttachmentShortFieldMaxLineLength int
	MessageAttachmentOmitFieldTitles         bool
}

type RuntimeConfig added in v0.31.0

type RuntimeConfig struct {
	GlobalConfig

	AI AIConfig

	Mattermost MattermostConfig
	Slack      SlackConfig
	Mastodon   MastodonConfig
}

RuntimeConfig is immutable.

A new RuntimeConfig is constructed whenever the configuration is reloaded and atomically published. Callers must never modify it.

type SlackConfig added in v0.31.0

type SlackConfig struct {
	Bridge    BridgeConfig
	Formatter FormatterConfig

	Disable bool

	DenyUsers      []string
	UseDisplayName bool
	PreferNickname bool
}

Jump to

Keyboard shortcuts

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