feed

package
v0.0.0-...-7b59e1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFeed

func GetFeed(ctx context.Context, url string, timeout time.Duration) (*gofeed.Feed, error)

func ProcessFeeds

func ProcessFeeds(ctx context.Context, feedGroups map[string][]config.SourceConfig, storage ArticleSaver, continuous bool)

Types

type Article

type Article struct {
	Resource    string    `json:"resource"`
	Url         string    `json:"url"`
	Title       string    `json:"title"`
	Published   time.Time `json:"published"`
	Description string    `json:"description"`
	ItemJSON    string    `json:"-"`
}

func ExtractArticles

func ExtractArticles(feed *gofeed.Feed, resource string) ([]Article, error)

func (Article) String

func (a Article) String() string

type ArticleSaver

type ArticleSaver interface {
	SaveArticles(context.Context, []Article) error
}

type ArticleStats

type ArticleStats struct {
	Resource      string
	TotalArticles int
	FirstDate     time.Time
	LastDate      time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL