Documentation
¶
Index ¶
Constants ¶
const Version = "unknown"
Version is the current version of the library.
Variables ¶
var ErrSendNotification = errors.New("send notification")
ErrSendNotification signals that the notifier failed to send a notification.
Functions ¶
func Disable ¶
func Disable(n *Notify)
Disable is an Option function that disables the Notify instance. It is enabled by default.
func Enable ¶
func Enable(n *Notify)
Enable is an Option function that enables the Notify instance. This is the default behavior.
func Send ¶
Send calls the underlying notification services to send the given subject and message to their respective endpoints.
func UseServices ¶
func UseServices(services ...Notifier)
UseServices adds the given service(s) to the Notifier's services list.
Types ¶
type Notifier ¶
Notifier defines the behavior for notification services.
The Send function simply sends a subject and a message string to the internal destination Notifier.
E.g. for telegram.Telegram it sends the message to the specified group chat.
type Notify ¶
type Notify struct {
Disabled bool
// contains filtered or unexported fields
}
Notify is the central struct for managing notification services and sending messages to them.
func Default ¶
func Default() *Notify
Default returns the standard Notify instance used by the package-level send function.
func New ¶
func New() *Notify
New returns a new instance of Notify. It returns a new Notify instance with default options. By default, the Notify instance is enabled.
func NewWithOptions ¶
NewWithOptions returns a new instance of Notify with the given options. If no options are provided, it returns a new Notify instance with default options. By default, the Notify instance is enabled.
func NewWithServices ¶
NewWithServices returns a new instance of Notify with the given services. By default, the Notify instance is enabled. If no services are provided, it returns a new Notify instance with default options.
func (*Notify) Send ¶
Send calls the underlying notification services to send the given subject and message to their respective endpoints.
func (*Notify) UseServices ¶
UseServices adds the given service(s) to the Notifier's services list.
func (*Notify) WithOptions ¶
WithOptions applies the given options to the Notify instance. If no options are provided, it returns the Notify instance unchanged.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
notifyd
command
notifyd — Hanzo Notify daemon.
|
notifyd — Hanzo Notify daemon. |
|
internal
|
|
|
boot
Package boot wires the shared dependencies notifyd needs at startup.
|
Package boot wires the shared dependencies notifyd needs at startup. |
|
event
Package event is the catalog layer over the `events` collection.
|
Package event is the catalog layer over the `events` collection. |
|
kmsbridge
Package kmsbridge is notify's direct line to Hanzo KMS, and the ONE place in notify that resolves a secret.
|
Package kmsbridge is notify's direct line to Hanzo KMS, and the ONE place in notify that resolves a secret. |
|
marketing
Package marketing builds the List-Unsubscribe + List-Unsubscribe-Post header pair that every marketing-class email carries per §5 of the notification-preferences paper.
|
Package marketing builds the List-Unsubscribe + List-Unsubscribe-Post header pair that every marketing-class email carries per §5 of the notification-preferences paper. |
|
metering
Package metering writes per-send ledger rows and exposes a query for the billing surface.
|
Package metering writes per-send ledger rows and exposes a query for the billing surface. |
|
preferences
Package preferences holds the wire shape + validation + row-mapper for the notification_preferences collection.
|
Package preferences holds the wire shape + validation + row-mapper for the notification_preferences collection. |
|
router
Package router implements the pure channel-routing function from the notification-preferences paper §4.
|
Package router implements the pure channel-routing function from the notification-preferences paper §4. |
|
routes
Package routes mounts Hanzo Notify's /v1/notify/* HTTP surface on top of hanzoai/base's router.
|
Package routes mounts Hanzo Notify's /v1/notify/* HTTP surface on top of hanzoai/base's router. |
|
schema
Package schema registers Hanzo Notify's domain collections with the underlying hanzoai/base app.
|
Package schema registers Hanzo Notify's domain collections with the underlying hanzoai/base app. |
|
tasks
Package tasks wires Hanzo Notify into hanzoai/tasks as a durable execution substrate.
|
Package tasks wires Hanzo Notify into hanzoai/tasks as a durable execution substrate. |
|
template
Package template renders Notify templates and manages the lifecycle.
|
Package template renders Notify templates and manages the lifecycle. |
|
tenant
Package tenant resolves per-tenant Notifier instances on demand.
|
Package tenant resolves per-tenant Notifier instances on demand. |
|
unsubscribe
Package unsubscribe is the HMAC-signed token primitive that backs the one-click email unsubscribe endpoints from §5.1 of the notification-preferences paper.
|
Package unsubscribe is the HMAC-signed token primitive that backs the one-click email unsubscribe endpoints from §5.1 of the notification-preferences paper. |
|
zaprpc
Package zaprpc is a stub for the native ZAP RPC surface that mirrors the HTTP /v1/notify/* routes.
|
Package zaprpc is a stub for the native ZAP RPC surface that mirrors the HTTP /v1/notify/* routes. |
|
pkg
|
|
|
client
Package client is the thin HTTP consumer SDK for the Hanzo Notify service.
|
Package client is the thin HTTP consumer SDK for the Hanzo Notify service. |
|
types
Package types is the public wire contract for the Hanzo Notify service.
|
Package types is the public wire contract for the Hanzo Notify service. |
|
service
|
|
|
bark
Package bark provides a service for sending messages to bark.
|
Package bark provides a service for sending messages to bark. |
|
fcm
Package fcm provides message notification integration for Firebase Cloud Messaging (FCM).
|
Package fcm provides message notification integration for Firebase Cloud Messaging (FCM). |
|
googlechat
Package googlechat provides message notification integration sent to multiple spaces within a Google Chat Application.
|
Package googlechat provides message notification integration sent to multiple spaces within a Google Chat Application. |
|
http
Package http provides an HTTP service.
|
Package http provides an HTTP service. |
|
lark
Package lark provides message notification integration for Lark.
|
Package lark provides message notification integration for Lark. |
|
matrix
Package matrix provides message notification integration for Matrix.
|
Package matrix provides message notification integration for Matrix. |
|
mattermost
Package mattermost provides message notification integration for mattermost.com.
|
Package mattermost provides message notification integration for mattermost.com. |
|
pagerduty
Package pagerduty provides a notifier implementation that sends notifications via PagerDuty.
|
Package pagerduty provides a notifier implementation that sends notifications via PagerDuty. |
|
plivo
Package plivo provides message notification integration for Plivo.
|
Package plivo provides message notification integration for Plivo. |
|
pushover
Package pushover implements a Pushover notifier, allowing messages to be sent to multiple recipients and supports both users and groups.
|
Package pushover implements a Pushover notifier, allowing messages to be sent to multiple recipients and supports both users and groups. |
|
reddit
Package reddit implements a Reddit notifier, allowing messages to be sent to multiple recipients
|
Package reddit implements a Reddit notifier, allowing messages to be sent to multiple recipients |
|
syslog
Package syslog provides message notification integration for local or remote syslogs.
|
Package syslog provides message notification integration for local or remote syslogs. |
|
twilio
Package twilio provides message notification integration for Twilio (Message Service).
|
Package twilio provides message notification integration for Twilio (Message Service). |
|
twilioemail
Package twilioemail provides email notification integration for Twilio's native Email API (POST https://comms.twilio.com/v1/Emails).
|
Package twilioemail provides email notification integration for Twilio's native Email API (POST https://comms.twilio.com/v1/Emails). |
|
viber
Package viber provides a service for sending messages to viber.
|
Package viber provides a service for sending messages to viber. |
|
webpush
Package webpush provides a service for sending messages to viber.
|
Package webpush provides a service for sending messages to viber. |
|
whatsapp
Package whatsapp is currently a [ NO-OP ] service! We're sorry for the inconveniences.
|
Package whatsapp is currently a [ NO-OP ] service! We're sorry for the inconveniences. |