Documentation
¶
Overview ¶
Package notify provides the notification dispatcher interface and registry.
Index ¶
- Constants
- func GatewaySend(ctx context.Context, uid types.Uid, templateID string, channels []string, ...) error
- func GetNotifyStore() *store.NotifyStore
- func IsConnectivityTestTemplate(templateID string) bool
- func List() map[string]Notifyer
- func ParseSchema(testString string) (string, error)
- func ParseTemplate(testString string, templates []string) (types.KV, error)
- func Register(id string, notifyer Notifyer)
- func Send(text string, message Message) error
- func SendToProtocol(protocol, uri string, message Message) error
- func Unregister(id string)
- func UserNotifyChannels(ctx context.Context, uid types.Uid) ([]string, error)
- func WaitForRecordAsyncForTest()
- type Message
- type Notifyer
- type Priority
Constants ¶
const ConnectivityTestTemplateID = "test"
ConnectivityTestTemplateID is the template ID written by web UI channel connectivity tests. Retry for these records re-runs the channel probe instead of GatewaySend.
const (
// PayloadKeySummary is the key in the GatewaySend payload map for the summary text.
PayloadKeySummary = "summary"
)
Variables ¶
This section is empty.
Functions ¶
func GatewaySend ¶ added in v0.92.0
func GatewaySend(ctx context.Context, uid types.Uid, templateID string, channels []string, payload map[string]any) error
GatewaySend is the central notification gateway entry point. It renders a notification template and dispatches the message to the specified channels. If uid is not zero, it looks up the user's channel configuration from the store. Rules (throttle, mute, aggregate) are applied before sending (when rule engine is initialized).
func GetNotifyStore ¶ added in v0.92.0
func GetNotifyStore() *store.NotifyStore
GetNotifyStore returns the NotifyStore from the global database adapter, or nil if the store is not available.
func IsConnectivityTestTemplate ¶ added in v0.96.1
IsConnectivityTestTemplate reports whether templateID identifies a connectivity-test record.
func ParseSchema ¶
func SendToProtocol ¶ added in v0.96.0
SendToProtocol dispatches a message using an explicit notify protocol. Unlike Send, the URI scheme (for example http/https used by ntfy endpoints) is not used for provider lookup — protocol selects the Notifyer.
func Unregister ¶ added in v0.96.0
func Unregister(id string)
Unregister removes a previously registered Notifyer. It is a no-op if the id is not found. Intended primarily for test teardown.
func UserNotifyChannels ¶ added in v0.96.0
UserNotifyChannels returns channel names configured for the user under notify:<channel> keys.
func WaitForRecordAsyncForTest ¶ added in v0.96.0
func WaitForRecordAsyncForTest()
WaitForRecordAsyncForTest blocks until all in-flight recordAsync goroutines finish.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package messagepusher implements the Message Pusher notification provider.
|
Package messagepusher implements the Message Pusher notification provider. |
|
Package ntfy implements the ntfy notification provider.
|
Package ntfy implements the ntfy notification provider. |
|
Package pushover implements Pushover notification provider.
|
Package pushover implements Pushover notification provider. |
|
Package rules provides the notification rule engine for throttling, aggregation, and mute/DND.
|
Package rules provides the notification rule engine for throttling, aggregation, and mute/DND. |
|
Package slack implements the Slack notification provider.
|
Package slack implements the Slack notification provider. |
|
Package template provides notification template rendering using Go text/template with Sprig function library support.
|
Package template provides notification template rendering using Go text/template with Sprig function library support. |