notifier

package
v0.0.0-...-26b8432 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

The notifier package

This is the interface a plugin has to implement to be usable by this
project as notification provider. The plugin has to expose an already
initialized symbol called Provider that implements the Notifier interface
here defined.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationEvent

type NotificationEvent int
const (
	NotifyAccountCreated NotificationEvent = iota
	NotifyAccountUpdated
	NotifyAccountRemoved
)

func (NotificationEvent) MarshalJSON

func (n NotificationEvent) MarshalJSON() ([]byte, error)

func (NotificationEvent) String

func (n NotificationEvent) String() string

type Notifier

type Notifier interface {
	// Init has to be invoked before the Notifier becomes available to send notifications.
	Init(ctx context.Context) error
	// Notify is the method to invoke in order to send notifications. It might either
	// be blocking, for reliable notifications, or non blocking, for fire-and-forget
	// notifications.
	Notify(ctx context.Context, event NotificationEvent, metadata map[string]string) error
}

Jump to

Keyboard shortcuts

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