Documentation
¶
Overview ¶
Package config manages server and repository configurations.
Index ¶
- type Manager
- func (m *Manager) CacheStats() (hits, misses int64)
- func (m *Manager) ChannelsForRepo(org, repo string) []string
- func (m *Manager) Config(org string) (*RepoConfig, bool)
- func (m *Manager) DailyRemindersEnabled(org string) bool
- func (m *Manager) Domain(org string) string
- func (m *Manager) InvalidateAllConfigs()
- func (m *Manager) InvalidateConfig(org string)
- func (m *Manager) IsChannelMuted(org, channel string) bool
- 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) SetWorkspaceName(workspaceName string)
- func (m *Manager) When(org, channel string) string
- func (m *Manager) WorkspaceName(org string) string
- type RepoConfig
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages repository configurations.
func (*Manager) CacheStats ¶
CacheStats returns cache hit and miss statistics for monitoring performance.
func (*Manager) ChannelsForRepo ¶
ChannelsForRepo returns the Slack channels configured for a specific repo. It first checks explicit YAML configuration, then falls back to auto-discovery where a repo named "goose" would automatically map to channel "#goose".
func (*Manager) Config ¶
func (m *Manager) Config(org string) (*RepoConfig, bool)
Config returns the configuration for a GitHub org.
func (*Manager) DailyRemindersEnabled ¶
DailyRemindersEnabled returns whether daily reminders are enabled for an org.
func (*Manager) Domain ¶
Domain returns the email domain for GitHub-to-Slack user mapping for the given organization.
func (*Manager) InvalidateAllConfigs ¶
func (m *Manager) InvalidateAllConfigs()
InvalidateAllConfigs removes all cached configurations. This can be useful during testing or major configuration changes.
func (*Manager) InvalidateConfig ¶
InvalidateConfig removes the cached configuration for a specific organization. This is used when .codeGROOVE repository events are received to ensure fresh config loading.
func (*Manager) IsChannelMuted ¶
IsChannelMuted checks if a specific channel is muted for an org.
func (*Manager) LoadConfig ¶
LoadConfig loads the configuration for a GitHub org with retry logic.
func (*Manager) ReloadConfig ¶
ReloadConfig reloads the configuration for an org (e.g., when .codeGROOVE repo is updated).
func (*Manager) ReminderDMDelay ¶
ReminderDMDelay returns the follow-up reminder delay in minutes for a specific channel. Returns the channel-specific delay if set, otherwise the global delay (default: 65 minutes). A value of 0 means the feature is disabled.
func (*Manager) SetGitHubClient ¶
SetGitHubClient sets the GitHub client for a specific org.
func (*Manager) SetWorkspaceName ¶
SetWorkspaceName sets the Slack workspace name for validation.
func (*Manager) When ¶
When returns the posting threshold for a channel. Returns "immediate" (default), "assigned", "blocked", or "passing".
func (*Manager) WorkspaceName ¶
WorkspaceName returns the Slack workspace team_id for an organization. Returns empty string if no workspace is configured.
type RepoConfig ¶
type RepoConfig struct {
Channels map[string]struct {
ReminderDMDelay *int `yaml:"reminder_dm_delay"`
When *string `yaml:"when"` // Optional: when to post threads ("immediate", "assigned", "blocked", "passing")
Repos []string `yaml:"repos"` // Optional: override global delay for this channel (0 = disabled)
Mute bool `yaml:"mute"`
} `yaml:"channels"`
Users map[string]string `yaml:"users"`
Global struct {
TeamID string `yaml:"team_id"`
EmailDomain string `yaml:"email_domain"`
ReminderDMDelay int `yaml:"reminder_dm_delay"`
When string `yaml:"when"` // When to post threads: "immediate" (default), "assigned", "blocked", "passing"
DisableDailyReport bool `yaml:"disable_daily_report"` // Default false (reports enabled)
} `yaml:"global"` // Minutes to wait before sending DM if user tagged in channel (0 = disabled)
}
RepoConfig represents the slack.yaml configuration for a GitHub org.
type ServerConfig ¶
type ServerConfig struct {
DataDir string
SlackSigningSecret string
GitHubAppID string
GitHubPrivateKey string
SprinklerURL string
AllowPersonalAccounts bool // Allow processing GitHub personal accounts (default: false for DoS protection)
}
ServerConfig holds the server configuration from environment variables.