Documentation ¶
Index ¶
- Variables
- func AddFeed(url string, feed *gofeed.Feed) error
- func AddPage(url string, r io.Reader) error
- func AllURLS() []string
- func GetFeed(mediatype, filename string, r io.Reader) (*gofeed.Feed, bool)
- func Init() error
- func IsSubscribed(url string) bool
- func Remove(u string) error
- type PageEntries
- type PageEntry
Constants ¶
This section is empty.
Variables ¶
var ( ErrSaving = errors.New("couldn't save JSON to disk") ErrNotSuccess = errors.New("status 20 not returned") ErrNotFeed = errors.New("not a valid feed") ErrTooManyRedirects = errors.New("redirected more than 5 times") )
var LastUpdated time.Time
LastUpdated is the time when the in-memory data was last updated. It can be used to know if the subscriptions page should be regenerated.
Functions ¶
func AddFeed ¶
AddFeed stores a feed. It can be used to update a feed for a URL, although the package will handle that on its own.
func AddPage ¶
AddPage stores a page to track for changes. It can be used to update the page as well, although the package will handle that on its own.
func GetFeed ¶
GetFeed returns a Feed object and a bool indicating whether the passed content was actually recognized as a feed.
func IsSubscribed ¶
IsSubscribed returns true if the URL is already subscribed to, whether a feed or page.
Types ¶
type PageEntries ¶
type PageEntries struct {
Entries []*PageEntry
}
PageEntries is new-to-old list of Entry structs, used to create a subscriptions page. It should always be assumed to be sorted when used in other packages, by post time, from newest to oldest.
func GetPageEntries ¶
func GetPageEntries() *PageEntries
GetPageEntries returns the current list of PageEntries for use in rendering a page. The contents of the returned entries will never change, so this function needs to be called again to get updates. It always returns sorted entries - by post time, from newest to oldest.
func (*PageEntries) Len ¶
func (e *PageEntries) Len() int
func (*PageEntries) Less ¶
func (e *PageEntries) Less(i, j int) bool
func (*PageEntries) Swap ¶
func (e *PageEntries) Swap(i, j int)