notificationhelper

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 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                 `mapstructure:"nats_address" docs:";The NATS server address."`
	NatsToken   string                 `mapstructure:"nats_token" docs:";The token to authenticate against the NATS server"`
	NatsStream  string                 `mapstructure:"nats_stream" docs:"reva-notifications;The notifications NATS stream."`
	Templates   map[string]interface{} `mapstructure:"templates" docs:";Notification templates for the service."`
}

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, m map[string]interface{}, 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