Documentation ¶
Index ¶
- type Action
- type FeedAggregator
- type FeedHandler
- type FeedStatus
- type Manager
- func (m *Manager) GetFeedAggregator(id string) *FeedAggregator
- func (m *Manager) RegisterFeedAggregator(feed *model.FeedDef, delay time.Duration) *FeedAggregator
- func (m *Manager) RestartFeedAggregator(id string, delay time.Duration)
- func (m *Manager) Shutdown()
- func (m *Manager) UnRegisterFeedAggregator(id string)
- type Status
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 *model.FeedDef, outputs *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.FeedResponse
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 *model.FeedDef, timeout time.Duration) *FeedHandler
NewFeedHandler create new feed handler
func (*FeedHandler) Refresh ¶
func (fh *FeedHandler) Refresh() (FeedStatus, []*model.Article)
Refresh fetch feed items
func (*FeedHandler) ResetStatus ¶
func (fh *FeedHandler) ResetStatus()
ResetStatus reset handler status
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 date 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 NewAggregatorManager ¶
func NewAggregatorManager(outputs *output.Manager, delay time.Duration, timeout time.Duration, callbackURL string) *Manager
NewAggregatorManager creates a new aggregator manager
func (*Manager) GetFeedAggregator ¶
func (m *Manager) GetFeedAggregator(id string) *FeedAggregator
GetFeedAggregator returns a feed aggregator
func (*Manager) RegisterFeedAggregator ¶
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