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 ¶
- func AddNotifier(notifier Notifier)
- func NotifyDownloadStart(d downloadable.Downloadable) error
- func NotifyDownloadedItem(d downloadable.Downloadable) error
- func NotifyFailedDownload(d downloadable.Downloadable) error
- func NotifyNewMovie(m *Movie) error
- func NotifyRecentEpisode(episode *Episode) error
- func NotifyTorrentsNotFound(d downloadable.Downloadable) error
- func Reset()
- func SendNotification(notif Notification) error
- func Status() ([]Module, error)
- type Notifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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
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 ¶
GetNotifier returns the registered notifier with name "name". An non-nil error is returned if no registered notifier are found with the required name