Documentation
¶
Index ¶
- Variables
- func SetLogLevel(level logrus.Level)
- func SetLogger(l *logrus.Entry)
- type AIConfig
- type BridgeConfig
- type Config
- func (c *Config) AI() *AIConfig
- func (c *Config) Current() *RuntimeConfig
- func (c *Config) Mastodon() *MastodonConfig
- func (c *Config) Matrix() *MatrixConfig
- func (c *Config) Mattermost() *MattermostConfig
- func (c *Config) RegisterReloadHook(hook func(rc *RuntimeConfig)) func()
- func (c *Config) Reload() error
- func (c *Config) Slack() *SlackConfig
- type FormatterConfig
- type GlobalConfig
- type MastodonConfig
- type MatrixConfig
- type MattermostConfig
- type RuntimeConfig
- type SharedConfig
- type SlackConfig
Constants ¶
This section is empty.
Variables ¶
var ( LogLevel string UserAgent string )
Functions ¶
func SetLogLevel ¶ added in v0.31.0
Types ¶
type AIConfig ¶ added in v0.32.0
type AIConfig struct {
Enabled bool
Provider string // "gemini" (default), "copilot", or "openai"
Token string // Default token for configured Provider
ClaudeToken string // API key for Anthropic Claude
CopilotToken string // GitHub token for Copilot
DeepSeekToken string // API key for DeepSeek
GeminiToken string // API key for Google AI Studio
HetznerToken string // API key for Hetzner
MuseToken string // API key for Meta Muse
OpenAIToken string // API key for OpenAI
OpenRouterToken string // API key for OpenRouter
XAIToken string // API key for xAI (Grok)
URL string // Fallback base URL for configured Provider
URLs map[string]string // Provider-specific base URLs
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-4-hydrogen", "copilot": "gpt-6-luna" }
Prompt string
DefaultPostLimit int
MaxPostLimit int
}
func (*AIConfig) GetBaseURL ¶ added in v0.35.0
GetBaseURL resolves the endpoint base URL for the requested provider, ensuring credentials and requests are not dispatched to unrelated endpoints.
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
DirectoryURL string
}
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
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) Matrix ¶ added in v0.35.0
func (c *Config) Matrix() *MatrixConfig
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)) func()
RegisterReloadHook allows other packages to execute logic when the config file changes.
The returned function unregisters the hook again. A hook keeps everything it references alive, so hooks of things with a limited lifetime (like a login session) must be unregistered when that lifetime ends.
func (*Config) Reload ¶ added in v0.31.0
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
HardLineSplit bool
MaxLineLength int
EnableTyping bool
DisableSendTyping bool
ServerTime bool
AwayCooldown time.Duration
}
type MastodonConfig ¶ added in v0.31.0
type MastodonConfig struct {
Bridge BridgeConfig
Formatter FormatterConfig
Server string
ClientID string
ClientSecret string
AccessToken string
}
type MatrixConfig ¶ added in v0.35.0
type MatrixConfig struct {
Bridge BridgeConfig
Formatter FormatterConfig
MatrixclientLogLevel string
// DefaultProvider is left out of channel names, e.g. "ubuntu.com".
DefaultProvider string
// ReplaceColonChar separates localpart and homeserver in the nick of remote
// users instead of Matrix's ':', e.g. "/" gives hloeung/matrix.org. The
// special value "[]" gives hloeung[matrix.org].
ReplaceColonChar string
// Encrypted rooms, needs a build with -tags goolm and cgo.
EncryptionDir string
EncryptionPickleKey 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
SkipTLSVerify bool
PrefixMainTeam bool
ForceAntiIdle bool
AntiIdleChannel string
AntiIdleInterval int
ForceSyncOnReconnect bool
}
type RuntimeConfig ¶ added in v0.31.0
type RuntimeConfig struct {
GlobalConfig
AI AIConfig
Mattermost MattermostConfig
Slack SlackConfig
Mastodon MastodonConfig
Matrix MatrixConfig
}
RuntimeConfig is immutable.
A new RuntimeConfig is constructed whenever the configuration is reloaded and atomically published. Callers must never modify it.
type SharedConfig ¶ added in v0.35.0
type SharedConfig struct {
}
SharedConfig holds the options that apply to the Mattermost, Matrix, and Slack bridges.
type SlackConfig ¶ added in v0.31.0
type SlackConfig struct {
Bridge BridgeConfig
Formatter FormatterConfig
Disable bool
SlackclientLogLevel string
DenyUsers []string
UseDisplayName bool
UseRealName bool
DefaultWorkspace string
}