notifications

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationSettings added in v0.1.1

type NotificationSettings struct {
	NotificationUrls    []string `json:"notification-urls"`
	NotifyJobStarted    bool     `json:"notify-job-started"`
	NotifyJobCompleted  bool     `json:"notify-job-completed"`
	NotifyJobError      bool     `json:"notify-job-error"`
	NotifyTaskStarted   bool     `json:"notify-task-started"`
	NotifyTaskCompleted bool     `json:"notify-task-completed"`
	NotifyTaskError     bool     `json:"notify-task-error"`
}

type Notifier

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

func New

func New(action string, settings *NotificationSettings) (*Notifier, *errors.E)

func (*Notifier) JobCompleted

func (n *Notifier) JobCompleted(ctx context.Context, action string, id string, volumes []string, started time.Time, err *errors.E)

func (*Notifier) JobStarted

func (n *Notifier) JobStarted(
	ctx context.Context,
	action string,
	id string,
	volumes []string,
)

func (*Notifier) NextBackupSchedule

func (n *Notifier) NextBackupSchedule(ctx context.Context, next time.Time)

func (*Notifier) Send

func (n *Notifier) Send(ctx context.Context, msg string)

func (*Notifier) TaskCompleted

func (n *Notifier) TaskCompleted(ctx context.Context, action string, id string, volume string, started time.Time, err *errors.E)

func (*Notifier) TaskStarted

func (n *Notifier) TaskStarted(ctx context.Context, id string, volume string)

Jump to

Keyboard shortcuts

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