Documentation ¶
Index ¶
- type DB
- type Fetcher
- func (fetcher *Fetcher) FetchAllFeeds() error
- func (fetcher *Fetcher) FetchAllPages() error
- func (fetcher *Fetcher) FetchFeed(feedURL string) error
- func (fetcher *Fetcher) FetchPage(config *data.UserPagemonitor) error
- func (fetcher *Fetcher) ParseFeed(feedURL string, reader io.Reader) ([]*data.Feeditem, error)
- func (fetcher *Fetcher) Refresh()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { GetPage(*data.UserPagemonitor) (*data.PagemonitorPage, error) SavePage(*data.PagemonitorPage) error SaveFeeditems(...*data.Feeditem) (err error) SetFetchStatus([]byte, *data.FetchStatus) error SetReadStatusForAll(k []byte, read bool) error GetUsers() ([]string, error) GetUser(username string) (*data.User, error) }
DB provides functions to read and write items in the database.
type Fetcher ¶
type Fetcher struct { DB DB Client *http.Client TagsPolicy *bluemonday.Policy }
Fetcher contains services needed to fetch items and save them into a database.
func NewFetcher ¶
NewFetcher creates a new Fetcher instance with db.
func (*Fetcher) FetchAllFeeds ¶
FetchAllFeeds calls FetchFeed for all feeds for all users.
func (*Fetcher) FetchAllPages ¶
FetchAllPages calls FetchPage for all pages for all users.
func (*Fetcher) FetchFeed ¶
FetchFeed fetches a feed from feedURL and saves it into the database if fetching was successful.
func (*Fetcher) FetchPage ¶
func (fetcher *Fetcher) FetchPage(config *data.UserPagemonitor) error
FetchPage fetches a page and performs a diff based on config. On success, it's saved into the database.
Click to show internal directories.
Click to hide internal directories.