Documentation ¶
Index ¶
- Variables
- func HTMLToMarkdown(content string) (string, error)
- func HTMLToText(content string) (string, error)
- func YassifyItem(item *gofeed.Item) string
- type Category
- type Feed
- type Rss
- func (rss *Rss) AddCategory(name string, description string) error
- func (rss *Rss) AddFeed(category string, name string, url string) error
- func (rss *Rss) ExportOPML(path string) error
- func (rss Rss) GetAllURLs() []string
- func (rss Rss) GetFeedURL(feedName string) (string, error)
- func (rss Rss) GetFeeds(categoryName string) ([]Feed, error)
- func (rss *Rss) Load() error
- func (rss *Rss) LoadOPML(path string) error
- func (rss *Rss) RemoveCategory(name string) error
- func (rss *Rss) RemoveFeed(category string, name string) error
- func (rss Rss) Save() error
- func (rss *Rss) UpdateCategory(key, name, desc string) error
- func (rss *Rss) UpdateFeed(category, key, name, url string) error
Constants ¶
This section is empty.
Variables ¶
var AllFeedsName = "All Feeds"
AllFeedsName is the name of the all feeds category
var Default = Rss{ Categories: []Category{{ Name: AllFeedsName, Description: "All feeds", Subscriptions: []Feed{{ Name: "BBC", Description: "News from the BBC", URL: "http://feeds.bbci.co.uk/news/rss.xml", }}, }, { Name: "News", Description: "News from around the world", Subscriptions: []Feed{{ Name: "Wired", Description: "News from the wired team", URL: "https://www.wired.com/feed/rss", }}, }, { Name: "Tech", Description: "Tech news", Subscriptions: []Feed{{ Name: "Chris Titus Tech (virtualization)", Description: "Chris Titus Tech on virtualization", URL: "https://christitus.com/categories/virtualization/index.xml", }}, }}, }
Default is the default rss structure
var DefaultCategoryDescription = "News from around the world"
DefaultCategoryDescription is the description of the default category
var DefaultCategoryName = "News"
DefaultCategoryName is the name of the default category
var DownloadedFeedsName = "Saved"
DownloadedFeedsName is the name of the downloaded feeds category
var ErrAlreadyExists = errors.New("already exists")
var ErrEmptyName = errors.New("empty name")
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when a feed or category is not found
var ErrReservedName = errors.New("reserved name")
var ErrTooManyItems = errors.New("too many items")
Functions ¶
func HTMLToMarkdown ¶
HTMLToMarkdown converts html to markdown using the html-to-markdown library
func HTMLToText ¶
HTMLToText converts html to text using the goquery library
func YassifyItem ¶
YassifyItem will return a yassified string which is used in the viewport to view a single item
Types ¶
type Category ¶
type Category struct { Name string `yaml:"name"` Description string `yaml:"desc"` Subscriptions []Feed `yaml:"subscriptions"` }
Category will be used to structurize the rss feeds
type Feed ¶
type Feed struct { Name string `yaml:"name"` Description string `yaml:"desc"` URL string `yaml:"url"` }
Feed is a single rss feed
type Rss ¶
type Rss struct { Categories []Category `yaml:"categories"` // contains filtered or unexported fields }
Rss will be used to structurize the rss feeds and categories
func (*Rss) AddCategory ¶
AddCategory will add a category to the Rss structure
func (*Rss) ExportOPML ¶ added in v1.5.1
ExportOPML will export the urls to an opml file.
func (Rss) GetAllURLs ¶
GetAllURLs will return a list of all the urls
func (Rss) GetFeedURL ¶
GetFeedURL will return the url of a feed denoted by the name
func (*Rss) RemoveCategory ¶
RemoveCategory will remove a category from the Rss structure
func (*Rss) RemoveFeed ¶
RemoveFeed will remove a feed from the Rss structure
func (*Rss) UpdateCategory ¶
UpdateCategory will change the name/description of a category by a string key
func (*Rss) UpdateFeed ¶
UpdateFeed will change the name/url of a feed by a string key and a category