notifier

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationSender

type NotificationSender interface {
	Send(title, message string) (err error)
}

NotificationSender provides an interface to send notifications (e.g. to Shoutrrr)

type Notifier

type Notifier interface {
	Notify(entries []models.CountryEntry) (err error)
}

Notifier will send notifications when we receive new updates for selected countries

type RealNotifier

type RealNotifier struct {
	Sender NotificationSender
	// contains filtered or unexported fields
}

RealNotifier will send notifications when we receive new updates for selected countries

func NewNotifier

func NewNotifier(sender NotificationSender, countries []string, db store.CovidStore) *RealNotifier

NewNotifier creates a new RealNotifier

func (*RealNotifier) Notify

func (notifier *RealNotifier) Notify(entries []models.CountryEntry) (err error)

Notify sends notification when we receive updates for selected countries

type ShoutrrrSender

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

ShoutrrrSender implements the NotificationSender interface for Shoutrrr

func NewNotificationSender

func NewNotificationSender(url string) *ShoutrrrSender

NewNotificationSender creates a new ShoutrrrSender

func (*ShoutrrrSender) Send

func (s *ShoutrrrSender) Send(title, message string) (err error)

Send a notification

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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