alertwire

package
v1.146.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package alertwire assembles the platform's own alerts from the stores the platform holds (#803, #1694, #1724): the review-queue staleness check, the connection-revocation alert and its escalation, the scheduled-run failure alert's channels, and the admin API's view of all three beside the notification settings.

It was split from notifywire, which assembles the delivery substrate the alerts send through: the two share the delivery handle and nothing of each other's.

Index

Constants

View Source
const EnvReviewAlertInterval = "MCP_PLATFORM_REVIEW_ALERT_INTERVAL"

EnvReviewAlertInterval overrides how often the review queue is checked (default hourly), as a Go duration. It is an environment knob beside the other MCP_PLATFORM_* cadences rather than YAML: the hourly default is right for every deployment, and the knob exists so a local stack can be proved against in seconds rather than an hour.

Variables

This section is empty.

Functions

func AdminDeps

func AdminDeps(deps *admin.Deps, p *platform.Platform, notify *notifydelivery.Handle)

AdminDeps fills the admin API's notification dependencies: the SMTP settings and test send, the delivery history, the three alerts' settings, and the notification channels with their test send and activity. Every accessor is nil-safe, so a deployment with no database leaves the routes that need them unregistered.

func BuildReviewAlert

func BuildReviewAlert(p *platform.Platform, notify *notifydelivery.Handle) *reviewalert.Checker

BuildReviewAlert assembles the scheduled knowledge review-queue staleness check. Returns nil (a no-op checker) when anything it needs is absent: no database, notifications off, no knowledge insight store -- an alert with nowhere to send is not an alert.

func ConnAlertSettings

func ConnAlertSettings(p *platform.Platform) connalert.SettingsStore

ConnAlertSettings narrows the store to the half the admin settings surface needs, or nil when the alert cannot exist here. A nil result unmounts the admin routes: an operator must not be able to name recipients for an alert nothing will ever send. The explicit nil check keeps a typed nil out of the interface.

func ConnAlertStore

func ConnAlertStore(p *platform.Platform) *connalert.PostgresStore

ConnAlertStore builds the connection-revocation alert's persistence (#1694), or nil when the alert cannot exist in this deployment: no database, or notifications turned off in YAML. Like the review alert's store it is stateless over the pool, so the admin API and the sweep each build one rather than sharing a handle whose lifecycle it does not have.

func ReviewAlertSettings

func ReviewAlertSettings(p *platform.Platform, target reviewalert.Target) reviewalert.SettingsStore

ReviewAlertSettings narrows one queue's store to the half the admin settings surface needs, or nil when the alert cannot exist here. A nil result unmounts the admin routes, matching what the SMTP section already does in the same states: an operator must not be able to configure an alert nothing will ever send. The explicit nil check keeps a typed nil out of the interface.

func ScriptRunAlertSettings

func ScriptRunAlertSettings(p *platform.Platform) scriptalert.SettingsStore

ScriptRunAlertSettings is the scheduled-run failure alert's channel list (#1724), or nil when the alert cannot exist here. The explicit nil check keeps a typed nil out of the interface.

func WireConnRevocationAlert

func WireConnRevocationAlert(p *platform.Platform, notify *notifydelivery.Handle) *connalert.Escalator

WireConnRevocationAlert tells the auth-event writer where to announce a discarded credential (#1694), and returns the sweep that escalates one nobody has acted on. Both are nil when the alert cannot exist here.

The writer is built with the token store, long before the notification substrate exists, so the sink is attached here rather than at construction. It is the one dependency every connoauth.Source already carries, which is why the announcement rides it instead of being threaded a second time through every toolkit that wires OAuth.

Types

This section is empty.

Jump to

Keyboard shortcuts

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