Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator orchestrates the creation and running of aggregation jobs
func NewAggregator ¶
func NewAggregator(jobs []Job, delayStarts bool, msgBus *nats.Conn, providerRepo storage.ProviderRepository, articles storage.ArticleRepository) (Aggregator, error)
NewAggregator returns a new instance of Aggregator, which is used for aggregating news providers that implement `aggregator.NewProvider`
type Job ¶
type Job struct { Label string // contains filtered or unexported fields }
Job is a runnable task that will retrieve news articles
func BuildJobs ¶
func BuildJobs(provRepo storage.ProviderRepository, artRepo storage.ArticleRepository) ([]Job, error)
BuildJobs take an instance of `storage.ProviderRepository` and will return a slice of `Job` based on all valid providers that are available
func NewJob ¶
func NewJob(label string, provider NewsProvider, articleRepo storage.ArticleRepository) (Job, error)
NewJob returns a job based on the specified NewsProvider
Click to show internal directories.
Click to hide internal directories.