Documentation
¶
Overview ¶
Package config loads runtime configuration from a single config.yaml file. Secrets are read separately from the environment (optionally via a .env file in development) and never appear in the YAML.
All secret values use the Secret type so they cannot leak through logging.
Index ¶
Constants ¶
const DefaultConfigFile = "./config.yaml"
DefaultConfigFile is used when NOTIFYCAT_CONFIG_FILE is unset.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ConfigFile is the path config.yaml was loaded from; the sibling
// config.lock is derived from it.
ConfigFile string
Addr string
LogLevel string
LogFormat string
DatabaseURL string
SlackBaseURL string
GitHubBaseURL string
Domain string
MessageTTLDays int
IgnoreAIReviews bool
DependabotFormat bool
Reactions Reactions
Digest *mappings.DigestConfig
Mappings map[string]mappings.Org
// DigestTimezone is the resolved timezone the digest scheduler and reporter
// run in. Derived from Digest.Timezone at Load (default UTC); never nil.
DigestTimezone *time.Location
GitHubWebhookSecret Secret
SlackBotToken Secret
GitHubToken Secret
// SlackSigningSecret gates the inbound Slack interactivity endpoint
// (POST /webhook/slack/interactions). Optional: when empty the endpoint is
// not registered and notifycat behaves exactly as an outbound-only service.
SlackSigningSecret Secret
}
Config is the parsed runtime configuration. Field names are flat so consumers read cfg.Addr, cfg.Reactions.NewPR, etc.; the nested config.yaml shape is an internal detail of Load (see fileSchema).
type MissingVarError ¶
type MissingVarError struct{ Var string }
MissingVarError is returned when a required secret env var is unset or empty.
func (*MissingVarError) Error ¶
func (e *MissingVarError) Error() string
type Reactions ¶
type Reactions struct {
Enabled bool
NewPR string
MergedPR string
ClosedPR string
Approved string
Commented string
RequestChange string
BotReview string
}
Reactions configures Slack reaction emoji names per PR lifecycle event.
type Secret ¶
type Secret string
Secret wraps a sensitive string (API token, webhook secret, password).
Its zero value is the empty string. Stringer, formatting verbs, and slog rendering all return a redaction placeholder so the raw value never reaches logs by accident. Use Reveal when handing the value to an external system.
func (Secret) Format ¶
Format intercepts every Sprintf verb (%v, %s, %q, %+v, …) so we cannot leak the raw value through an unfamiliar verb.