Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Watch ¶
func Watch(db *core.AlarmDB, onEvent func(source, message string), notify func(title, body string)) func()
Watch subscribes to db and, for every state change that represents an active raised alarm, records an audit event via onEvent(tag, message) and raises a user notification via notify(title, message). Both sinks are optional; a nil sink is skipped. Cleared/inactive states and bare acknowledgements are filtered out (see the package doc). The returned func unsubscribes and is safe to call more than once (it wraps core.AlarmDB's idempotent CancelFunc).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.