Documentation
¶
Overview ¶
Package config manages server and repository configurations.
Index ¶
- type ChannelConfig
- type DiscordConfig
- type GlobalConfig
- type Manager
- func (m *Manager) CacheStats() (hits, misses int64)
- func (m *Manager) ChannelType(org, channel string) string
- func (m *Manager) ChannelsForRepo(org, repo string) []string
- func (m *Manager) Config(org string) (*DiscordConfig, bool)
- func (m *Manager) DiscordUserID(org, githubUsername string) string
- func (m *Manager) GuildID(org string) string
- func (m *Manager) LoadConfig(ctx context.Context, org string) error
- func (m *Manager) ReloadConfig(ctx context.Context, org string) error
- func (m *Manager) ReminderDMDelay(org, channel string) int
- func (m *Manager) SetGitHubClient(org string, client any)
- func (m *Manager) When(org, channel string) string
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelConfig ¶
type ChannelConfig struct {
ReminderDMDelay *int `yaml:"reminder_dm_delay"`
When *string `yaml:"when"`
Type string `yaml:"type"`
Repos []string `yaml:"repos"`
Mute bool `yaml:"mute"`
}
ChannelConfig holds per-channel settings.
type DiscordConfig ¶
type DiscordConfig struct {
Channels map[string]ChannelConfig `yaml:"channels"`
Users map[string]string `yaml:"users"` // GitHub username -> Discord ID
Global GlobalConfig `yaml:"global"`
}
DiscordConfig represents the discord.yaml configuration for a GitHub org.
func (*DiscordConfig) UserMappings ¶
func (c *DiscordConfig) UserMappings() map[string]string
UserMappings returns the user mappings (for reverse lookup interface).
type GlobalConfig ¶
type GlobalConfig struct {
GuildID string `yaml:"guild_id"`
When string `yaml:"when"`
ReminderDMDelay int `yaml:"reminder_dm_delay"`
}
GlobalConfig holds global settings for the org.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages repository configurations.
func (*Manager) CacheStats ¶
CacheStats returns cache statistics.
func (*Manager) ChannelType ¶
ChannelType returns the channel type ("forum" or "text").
func (*Manager) ChannelsForRepo ¶
ChannelsForRepo returns the Discord channels configured for a specific repo.
func (*Manager) Config ¶
func (m *Manager) Config(org string) (*DiscordConfig, bool)
Config returns the configuration for a GitHub org.
func (*Manager) DiscordUserID ¶
DiscordUserID returns the mapped Discord ID for a GitHub username.
func (*Manager) LoadConfig ¶
LoadConfig loads discord.yaml configuration for a GitHub org with retry logic.
func (*Manager) ReloadConfig ¶
ReloadConfig reloads the configuration for an org.
func (*Manager) ReminderDMDelay ¶
ReminderDMDelay returns the DM delay in minutes for a channel.
func (*Manager) SetGitHubClient ¶
SetGitHubClient sets the GitHub client for a specific org.