Documentation
¶
Overview ¶
Package notify delivers short operational messages (SSH login alerts, audit denials, task failures) to one or more user-configured channels. It is deliberately dependency-free: every channel is a plain HTTPS POST built on the standard library, so the server keeps its zero-dependency footprint.
Index ¶
Constants ¶
const ( BarkDefaultLevel = "active" BarkDefaultGroup = "lattice" )
Variables ¶
var BarkLevels = []string{"active", "timeSensitive", "passive", "critical"}
BarkLevels lists the interruption levels bark-server accepts.
Functions ¶
This section is empty.
Types ¶
type Bark ¶
type Bark struct {
BaseURL string // e.g. https://api.day.app
Key string
Level string // Bark interruption level; defaults to BarkDefaultLevel
Group string // Bark notification group; defaults to BarkDefaultGroup
URL string // optional URL opened when the notification is tapped
Client *http.Client
}
Bark pushes to a Bark server (iOS push). It sends the v2 JSON form, POST <base>/push {device_key, title, body, level, group, url}, and falls back to the legacy path form GET <base>/<key>/<title>/<body> when the server answers 404 or 405 (bark-server 1.x has no /push route).
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher fans a message out to every configured channel, isolating failures so one broken channel does not suppress the others.
func NewDispatcher ¶
func NewDispatcher(channels ...Channel) *Dispatcher