notify

package
v1.0.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package notify carries reconcile events to whoever is listening.

This seam is additive where the others replace, and the asymmetry is deliberate. A Business Edition notifier posting to Slack must not remove the log notifier — and, the case that actually forces it, the HTTP API's event stream is itself a notifier. If registering replaced, loading the companion would silently kill the UI's live updates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active() []string

Active names every registered notifier, for startup logging.

func Dispatch

func Dispatch(ctx context.Context, e Event)

Dispatch delivers e to every registered notifier.

func Register

func Register(name string, n Notifier)

Register appends a notifier. It removes nothing. Call it from an init().

Types

type Event

type Event struct {
	Application string
	Type        EventType
	Revision    string // the resolved commit, where one applies
	Message     string
	At          time.Time
}

Event is one thing that happened to one application.

type EventType

type EventType string

EventType names what happened.

const (
	SyncStarted   EventType = "sync-started"
	SyncSucceeded EventType = "sync-succeeded"
	SyncFailed    EventType = "sync-failed"
	DriftDetected EventType = "drift-detected"
)

type Notifier

type Notifier interface {
	Notify(ctx context.Context, e Event)
}

Notifier receives events.

Notify returns nothing and must not block. A notification that cannot be delivered is not a reason to fail a sync, so implementations report their own delivery failures; an error return would only make every caller write the same log-and-continue.

func All

func All() []Notifier

All returns every registered notifier.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL