notificationhelper

package
v1.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL