Documentation
¶
Index ¶
Constants ¶
View Source
const (
MaxItemContentSize = 5 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrawlerPool ¶
type CrawlerPool interface {
Submit(crawler.CrawlRequest)
}
CrawlerPool defines the interface for submitting crawl requests.
type MailerPool ¶
type MailerPool interface {
Submit(mailer.MailRequest)
}
MailerPool defines the interface for submitting mail requests.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages multiple watchers and routes crawl responses.
func NewRegistry ¶
NewRegistry creates a new watcher registry.
func (*Registry) GetActiveFeedIDs ¶
GetActiveFeedIDs returns a list of all currently registered feed IDs.
func (*Registry) GetWatcher ¶
GetWatcher retrieves a watcher by feed ID.
func (*Registry) Unregister ¶
Unregister removes a watcher from the registry.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher manages the polling of a single feed.
func New ¶
func New(feed models.Feed, store db.Store, c CrawlerPool, m MailerPool, interval, jitter time.Duration, logger *slog.Logger) *Watcher
New creates a new feed watcher.
func (*Watcher) FormatItem ¶
FormatItem sanitizes and formats a feed item for an email.
func (*Watcher) HandleResponse ¶
func (w *Watcher) HandleResponse(ctx context.Context, resp crawler.CrawlResponse)
HandleResponse processes a crawl result. This is called by the orchestrator which listens to the crawler pool.
Click to show internal directories.
Click to hide internal directories.