notification

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidNotificationError

type InvalidNotificationError struct {
	Ref string
	Msg string
	Err error
}

InvalidNotificationError is the error returned when a notification has invalid data.

func (InvalidNotificationError) Error

func (i InvalidNotificationError) Error() string

Error returns the string error msg for InvalidNotificationError.

type Manager

type Manager interface {
	// UpsertNotification insert or updates a notification.
	UpsertNotification(n Notification) error
	// GetNotification reads a notification.
	GetNotification(ref string) (*Notification, error)
	// DeleteNotification deletes a notifcation.
	DeleteNotification(ref string) error
}

Manager is the interface notification storage managers have to implement.

type NotFoundError

type NotFoundError struct {
	Ref string
}

NotFoundError is the error returned when a notification does not exist.

func (NotFoundError) Error

func (n NotFoundError) Error() string

Error returns the string error msg for NotFoundError.

type Notification

type Notification struct {
	TemplateName string
	Template     template.Template
	Ref          string
	Recipients   []string
}

Notification is the representation of a notification.

func (*Notification) CheckNotification

func (n *Notification) CheckNotification() error

CheckNotification checks if a notification has correct data.

func (*Notification) Send

func (n *Notification) Send(sender string, templateData map[string]interface{}) error

Send is the method run when a notification is triggered.

Directories

Path Synopsis
manager
sql
Package utils contains utilities related to the notifications service and helper.
Package utils contains utilities related to the notifications service and helper.

Jump to

Keyboard shortcuts

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