Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeedAggregator ¶
type FeedAggregator struct {
// contains filtered or unexported fields
}
FeedAggregator aggregator
func NewFeedAggregator ¶
func NewFeedAggregator(feed *app.Feed, om *output.Manager, delay time.Duration, timeout time.Duration, callbackURL string) *FeedAggregator
NewFeedAggregator creats a new feed aggregator
func (*FeedAggregator) GetFeedWithAggregationStatus ¶
func (fa *FeedAggregator) GetFeedWithAggregationStatus() *app.Feed
GetFeedWithAggregationStatus get a copy of the aggregator feed hydrated with aggregation status.
func (*FeedAggregator) StartWithDelay ¶
func (fa *FeedAggregator) StartWithDelay(delay time.Duration)
StartWithDelay starts feed aggregator with a delay.
type FeedHandler ¶
type FeedHandler struct {
// contains filtered or unexported fields
}
FeedHandler handles feed refresh
func NewFeedHandler ¶
func NewFeedHandler(feed *app.Feed, timeout time.Duration) *FeedHandler
NewFeedHandler creats new feed handler
func (*FeedHandler) Refresh ¶
func (fh *FeedHandler) Refresh() (FeedStatus, []*model.Article)
Refresh fetch feed items
type FeedStatus ¶
type FeedStatus struct {
CheckedAt time.Time `json:"checked_at"`
EtagHeader string `json:"etag_header"`
LastModifiedHeader string `json:"last_modified_header"`
ExpiresHeader string `json:"expires_header"`
ErrorMsg string `json:"error_message"`
ErrorCount int `json:"error_count"`
}
FeedStatus status of a feed
func (*FeedStatus) ComputeNextCheckDate ¶
func (fs *FeedStatus) ComputeNextCheckDate(base time.Duration) time.Time
ComputeNextCheckDate computes next dat to check regarding some rules The duration is multiply the number of error. The limit is h24
func (*FeedStatus) Err ¶
func (fs *FeedStatus) Err(err error)
Err set error status message and counter Reset if err is null
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager of the feed aggregators
func NewManager ¶
func NewManager(db store.DB, om *output.Manager, delay time.Duration, timeout time.Duration, callbackURL string) (*Manager, error)
NewManager creates a new manager
func (*Manager) GetFeedAggregator ¶
func (m *Manager) GetFeedAggregator(id string) *FeedAggregator
GetFeedAggregator returns a feed aggregator
func (*Manager) RegisterFeedAggregator ¶
func (m *Manager) RegisterFeedAggregator(feed *app.Feed) *FeedAggregator
RegisterFeedAggregator register and start a new feed aggregator
func (*Manager) RestartFeedAggregator ¶
RestartFeedAggregator restart feed aggregator with delay
func (*Manager) Shutdown ¶
func (m *Manager) Shutdown()
Shutdown stop the manager (aka. stop and unregister all feed aggregator)
func (*Manager) UnRegisterFeedAggregator ¶
UnRegisterFeedAggregator stop and un-register a feed aggregator