notify

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Kind  string `json:"kind"`  // run_end / repeat / budget
	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 通道(macOS osascript / Linux notify-send,找不到命令静默降级为仅 slog);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