Documentation
¶
Overview ¶
Package notify is keryx's pluggable alert seam (spec 0010 §6): a Notifier interface with config-selected backends (none, webhook, …). `auth refresh` uses it to surface impending-expiry / refresh-failure alerts; a non-zero exit is the always-on baseline regardless of backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discord ¶ added in v0.24.0
Discord posts {"content": msg} to a channel's incoming webhook. Discord's webhook payload differs from Slack's ("content", not "text"), which is all that separates this from Webhook.
type Email ¶
type Email struct {
Host string
Port int
Username string
Password string
From string
To []string
// contains filtered or unexported fields
}
Email sends alerts over SMTP. host/port/from/to come from config; the credentials come from the environment (ALERT_SMTP_USERNAME / ALERT_SMTP_PASSWORD), falling back to config for headless setups.
type GitLabIssue ¶ added in v0.24.0
type GitLabIssue struct {
Project string // id or path
Token string
API string // e.g. https://gitlab.com/api/v4
HTTP *http.Client
}
GitLabIssue keeps one open issue per alert title in a project: a first alert opens it, a repeat adds a comment, so a token that keeps expiring is one ticket with a history rather than a ticket a day.
func (GitLabIssue) Notify ¶ added in v0.24.0
func (g GitLabIssue) Notify(ctx context.Context, msg string) error
Notify opens or comments on the issue for the message. The title is the message's first clause (up to the first colon after the platform name), so the same platform's alerts collapse onto one issue.
type Multi ¶ added in v0.24.0
type Multi []Notifier
Multi delivers to every sink and reports every failure, so one sink being down does not silence the others.
type None ¶
type None struct{}
None drops alerts — the caller still exits non-zero (red pipeline). Default.