Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { NatsAddress string `docs:";The NATS server address." mapstructure:"nats_address"` NatsToken string `docs:";The token to authenticate against the NATS server" mapstructure:"nats_token"` NatsStream string `docs:"reva-notifications;The notifications NATS stream." mapstructure:"nats_stream"` Templates map[string]interface{} `docs:";Notification templates for the service." mapstructure:"templates"` }
Config contains the configuration for the Notification Helper.
type NotificationHelper ¶
type NotificationHelper struct { Name string Conf *Config Log *zerolog.Logger // contains filtered or unexported fields }
NotificationHelper is the type used in services to work with notifications.
func New ¶
func New(name string, log *zerolog.Logger) *NotificationHelper
New creates a new Notification Helper.
func (*NotificationHelper) RegisterNotification ¶
func (nh *NotificationHelper) RegisterNotification(n *notification.Notification)
RegisterNotification registers a notification in the notification service.
func (*NotificationHelper) Stop ¶
func (nh *NotificationHelper) Stop()
Stop stops the notification helper.
func (*NotificationHelper) TriggerNotification ¶
func (nh *NotificationHelper) TriggerNotification(tr *trigger.Trigger)
TriggerNotification sends a notification trigger to the notifications service.
func (*NotificationHelper) UnregisterNotification ¶
func (nh *NotificationHelper) UnregisterNotification(ref string)
UnregisterNotification unregisters a notification in the notification service.
Click to show internal directories.
Click to hide internal directories.