notifier

package
v0.0.0-...-01b0788 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package notifier groups methods for notifications handling in flemzerd. Multiple notifier types can be registered. Sending a notification will then send it with all registered notifiers. Helper methods are available to send notifications for specific purposes (download start, new item from watchlist, ...)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNotifier

func AddNotifier(notifier Notifier)

AddNotifier registers a new notifier

func NotifyDownloadStart

func NotifyDownloadStart(d downloadable.Downloadable) error

NotifyMovieDownloadStart sends a notification to alert that torrents have been found for movie and that download process is starting.

func NotifyDownloadedItem

func NotifyDownloadedItem(d downloadable.Downloadable) error

NotifyDownloadedItem sends notification on registered notifiers to alert that the movie has been successfully downloaded

func NotifyFailedDownload

func NotifyFailedDownload(d downloadable.Downloadable) error

NotifyFailedDownload sends notification on registered notifiers to alert that the movie could not be downloaded. A movie is marked as failed when more that TorrentDownloadAttempts configuration parameter) torrent downloads have failed

func NotifyNewMovie

func NotifyNewMovie(m *Movie) error

NotifyNewMovie sends a notification on all registered notifiers to alert that a new movie has been add in watchlists The movie is then marked as notified and the notification will not be sent again if this method is called twice on the same episode.

func NotifyRecentEpisode

func NotifyRecentEpisode(episode *Episode) error

NotifyRecentEpisode sends a notification on all registered notifiers to alert that a new episode for a tracked show has been released. The episode is then marked as notified and the notification will not be sent again if this method is called twice on the same episode.

func NotifyTorrentsNotFound

func NotifyTorrentsNotFound(d downloadable.Downloadable) error

NotifyTorrentNotFound sends notification on registered notifiers to alert that torrents could not be found (either no torrents found or no available indexers)

func Reset

func Reset()

Reset empties registered notifiers list

func SendNotification

func SendNotification(notif Notification) error

SendNotification sends the notification with title and content using all registered notifiers. If at least one notifier returns an error when sending the notification, the method exists with a non nil error

func Status

func Status() ([]Module, error)

Status checks registered notifiers status. A module list is returned, each module corresponds to a registered notifier. A non nil error is returned if at least one registered notifier is in error

Types

type Notifier

type Notifier interface {
	Status() (Module, error)
	GetName() string
	Send(notif Notification) error
}

Notifier is the generic interface that a struct has to implement in order to be used as a notifier in flemzerd

func GetNotifier

func GetNotifier(name string) (Notifier, error)

GetNotifier returns the registered notifier with name "name". An non-nil error is returned if no registered notifier are found with the required name

Directories

Path Synopsis
impl

Jump to

Keyboard shortcuts

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