Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Listen int Secret string Version string CacheTTL time.Duration FeedsCfgFilePath string }
Config the server configuration.
type FeedsCache ¶
type FeedsCache struct {
// contains filtered or unexported fields
}
FeedsCache - cache for the latest up-to-date feeds.
func NewFeedsCache ¶
func NewFeedsCache(feeds FeedsRepo, ttl time.Duration) *FeedsCache
NewFeedsCache creates FeedsCache. ttl - duration how often will be refresh cache for gets up-to-date feeds.
func (*FeedsCache) Run ¶
func (f *FeedsCache) Run(ctx context.Context)
Run loads actual feeds to cache and runs background tasks for updates its. When ctx.Done -> all background tasks stopping too.
type FeedsRepo ¶
type FeedsRepo interface { Get(ctx context.Context, feedID string) (feed.Feed, error) IDs() []string }
FeedsRepo interface for gets the latest up-to-date feeds.
Click to show internal directories.
Click to hide internal directories.