notification

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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