Documentation
¶
Overview ¶
Package sinks fans notifications out to web-push, a Discord webhook and ntfy, best-effort and never blocking the caller.
ntfy approval notifications carry real approve/deny HTTP action buttons, so a phone can decide without opening the app (and without VAPID setup).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Keys = []string{"discord_webhook", "ntfy_server", "ntfy_topic"}
Keys are the settings rows this package owns. Anything else is rejected by the settings endpoint so a typo cannot silently disable notifications.
Functions ¶
Types ¶
type Extra ¶
Extra carries the notification's context — which is what turns an ntfy message into one with decision buttons.
type Notifier ¶
type Notifier struct {
DB *store.DB
BaseURL string
Push *push.Sender
Log *slog.Logger
Client *http.Client
// Hook, when set, replaces real delivery. Tests assert on the built payloads
// without any network at all — the same seam the Python suite used.
Hook func([]Payload)
// contains filtered or unexported fields
}
Notifier owns the sink fan-out.
func (*Notifier) Notify ¶
Notify sends to every configured sink. Delivery happens on a goroutine: a sink outage must never slow a dispatch down, let alone fail one.