notification

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 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

Overview

Package notification sends user notifications through the notifier and copies them to developer-notifications, in the format process-incident-api uses today (INC-02), and is the task type "notification" of processes (Task, BPMN-09).

Index

Constants

View Source
const DuplicateWindowInput = "ignore_duplicates_within_seconds"

DuplicateWindowInput names the optional input with the seconds within which the notifier drops a notification the owner already has with the same title and message (SNRGY-3911). Without it every notification is delivered, as with process-deployment.

View Source
const SilentInput = "silent"

SilentInput names the optional input that delivers the notification without sound or vibration.

View Source
const TagInput = "tag"

TagInput names the optional input with a key that identifies the notification of the owner: the notifier replaces the notification it has with that tag instead of adding another one, so that a process keeps one notification up to date, e.g. the remaining time of a dryer.

View Source
const TaskType = "notification"
View Source
const Topic = "processes"

Topic of process notifications in the notifier, as before.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

func New

func New(notifierUrl string, developerNotificationsUrl string, logger *slog.Logger) *Notifier

New creates a notifier; an empty URL disables the respective target.

func (*Notifier) Notify

func (this *Notifier) Notify(ctx context.Context, n store.Notification) error

Notify returns an error if the notifier did not accept the message, so that it is retried. developer-notifications gets a copy, best effort, except of the notifications a process sends (BPMN-09): they are what the owner asked for, not a fault.

func (*Notifier) Send

func (this *Notifier) Send(ctx context.Context, n store.Notification) error

Send delivers to the notifier only.

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task is the task type "notification" (BPMN-09): it sends a notification to the owner of the instance, which process-deployment did by filling an http-connector. The notification goes into the queue of the engine that also carries the incident notifications, so that a notifier out of reach, e.g. the cloud behind the cloud-proxy of an offline gateway, delays it instead of ending the process with an incident (FOG-05). The queue retries for a day.

func NewTask

func NewTask(s *store.Store) *Task

func (*Task) Execute

func (this *Task) Execute(ctx context.Context, task engine.Task) (engine.TaskResult, error)

Execute queues title and message. The id follows from the job, so that executing the job again, after a completion that did not reach the database, queues nothing a second time.

Jump to

Keyboard shortcuts

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