Documentation
¶
Index ¶
- func Publish(e Event)
- func PublishWithPayload(eventType EventType, payload any) error
- func Subscribe(buffer int) (string, <-chan Event, func())
- type CleanupTriggeredPayload
- type DiskLowPayload
- type Event
- type EventType
- type FreeEndedPayload
- type FreeEndingSoonPayload
- type NotificationDeliveredPayload
- type NotificationFailedPayload
- type SiteLoginExpiredPayload
- type SiteScrapedDailyPayload
- type TorrentAddedPayload
- type TorrentCompletedPayload
- type TorrentFailedPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PublishWithPayload ¶ added in v0.31.0
Types ¶
type CleanupTriggeredPayload ¶ added in v0.31.0
type DiskLowPayload ¶ added in v0.31.0
type EventType ¶
type EventType string
const EvtCleanupTriggered EventType = "cleanup.triggered"
EvtCleanupTriggered: Published when auto-cleanup (auto-delete) is triggered. Triggered by scheduler/cleanup_monitor.go after removing torrents.
const EvtDiskLow EventType = "disk.low"
EvtDiskLow: Published when disk space falls below minimum threshold (CleanupMinDiskSpaceGB). Triggered by internal/push.go disk protection check and scheduler/cleanup_monitor.go.
const EvtFreeEnded EventType = "free.ended"
EvtFreeEnded: Published when a free torrent's free period has ended. Triggered by scheduler/free_end_monitor.go at deadline; may trigger auto-pause or auto-delete.
const EvtFreeEndingSoon EventType = "free.ending_soon"
EvtFreeEndingSoon: Published when a free torrent's free period is ending soon (< 1 hour remaining). Triggered by scheduler/free_end_monitor.go before deadline.
const EvtNotificationDelivered EventType = "notification.delivered"
EvtNotificationDelivered: Published when a notification is successfully delivered via a channel. Triggered by internal/notify/outbox.go after successful send to Telegram/QQ/Webhook/etc.
const EvtNotificationFailed EventType = "notification.failed"
EvtNotificationFailed: Published when a notification fails to deliver. Triggered by internal/notify/outbox.go after exhausting retries or immediate send error.
const EvtSiteLoginExpired EventType = "site.login_expired"
EvtSiteLoginExpired: Published when a site login/cookie has expired or is invalid. Triggered by site drivers when authentication fails (HTTP 401/403 or login page redirect).
const EvtSiteScrapedDaily EventType = "site.scraped_daily"
EvtSiteScrapedDaily: Published as a daily summary event after scraping a site. Triggered by internal/common.go RSS fetch pipeline (if implemented) or site drivers.
const EvtTorrentAdded EventType = "torrent.added"
EvtTorrentAdded: Published when a torrent is successfully added to a downloader. Triggered by the RSS pipeline after pushing to a downloader via internal/push.go or manual download.
const EvtTorrentCompleted EventType = "torrent.completed"
EvtTorrentCompleted: Published when a torrent download completes (100% downloaded). Triggered by downloader status update monitors (future integration with downloader APIs).
const EvtTorrentFailed EventType = "torrent.failed"
EvtTorrentFailed: Published when a torrent fails to download (error state in downloader). Triggered by downloader status monitors and error handlers.