notify

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package notify 提供无人值守告警通道。

合宪定位(architecture.md §2.3):纯观察层动作——告警永不介入控制流 (不重试、不改派、不停机),只是把 TUI 内已有的事件"喊"到屏幕之外。 Send 异步执行、永不阻塞 Host、失败只记 slog。

Index

Constants

View Source
const (
	KindRunEnd        = "run_end"
	KindBudget        = "budget"
	KindAdvanceGate   = "advance_gate"
	KindStopGuard     = "stop_guard"
	KindPlanStart     = "plan_start"
	KindDeadlock      = "deadlock"
	KindWorkerFailure = "worker_failure"
)

Variables

This section is empty.

Functions

func IsKnownKind added in v0.7.0

func IsKnownKind(kind string) bool

func Kinds added in v0.7.0

func Kinds() []string

Kinds 返回当前版本可用于 notify.events 的全部事件名。 这里是通知事件契约的唯一事实源。

Types

type Notification

type Notification struct {
	Kind  string `json:"kind"`  // Kinds 返回的稳定事件名
	Level string `json:"level"` // info / warn / error
	Title string `json:"title"`
	Body  string `json:"body"`
}

Notification 一条告警的全部事实。

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

Notifier 按配置分发通知。零值不可用,必须经 New 创建;nil 安全(Send noop)。

func New

func New(command string, events []string) *Notifier

New 创建 Notifier。command 为空走内置 system 通道(Windows 通知气泡 / macOS osascript / Linux notify-send);events 非空时只放行列出的 kind。

func (*Notifier) Send

func (n *Notifier) Send(nt Notification)

Send 异步发送一条通知。过滤、执行、失败处理全部不影响调用方。

Jump to

Keyboard shortcuts

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