Documentation
¶
Overview ¶
Package notify defines the notification seam fired on finding deltas (new blocker, became-ready, add-on entering the EOL window) — never on every snapshot. Implementations (Slack, generic webhook) live here too.
The server computes *what* changed (delta rules live in internal/server); this package only knows how to deliver an Event somewhere. All notifiers are best-effort: delivery failures must never block snapshot ingestion, so Multi logs individual failures and always returns nil.
Index ¶
Constants ¶
const ( KindNewBlocker = "new-blocker" KindEOLApproaching = "eol-approaching" KindBecameReady = "became-ready" )
Kind values for Event.Kind (the only three the delta rules emit).
Variables ¶
This section is empty.
Functions ¶
func FormatLine ¶
FormatLine renders the canonical one-line notification text:
[upgradescope] <cluster> → <target>: <kind>: <title>
Types ¶
type GenericWebhook ¶
GenericWebhook POSTs the raw Event as JSON to any HTTP endpoint.
func NewGenericWebhook ¶
func NewGenericWebhook(url string) *GenericWebhook
NewGenericWebhook returns a GenericWebhook with the 2s delivery timeout.
type NopNotifier ¶
type NopNotifier struct{}
NopNotifier discards every event. Useful default when no webhook is configured.
type Notifier ¶
type SlackNotifier ¶
type SlackNotifier struct {
URL string
Client *http.Client // exported so tests shorten the timeout; never nil from NewSlack
}
SlackNotifier posts events to a Slack incoming webhook as plain text.
func NewSlack ¶
func NewSlack(url string) *SlackNotifier
NewSlack returns a SlackNotifier with the 2s delivery timeout.