Documentation
¶
Index ¶
- Variables
- func DeleteItem(itemType ItemType, key string) tea.Cmd
- func DownloadItem(key string, index int) tea.Cmd
- func NewItem(itemType ItemType, newItem bool, itemPath []string, oldFields []string) tea.Cmd
- type Backend
- func (b Backend) Close() error
- func (b Backend) DownloadItem(key string, index int) tea.Cmd
- func (b Backend) FetchAllArticles(_ string) tea.Cmd
- func (b Backend) FetchArticles(feedName string) tea.Cmd
- func (b Backend) FetchCategories() tea.Cmd
- func (b Backend) FetchDownloadedArticles(_ string) tea.Cmd
- func (b Backend) FetchFeeds(catName string) tea.Cmd
- type Cache
- type DeleteItemMessage
- type DownloadItemMessage
- type FetchErrorMessage
- type FetchSuccessMessage
- type Item
- type ItemType
- type NewItemMessage
Constants ¶
This section is empty.
Variables ¶
var DefaultCacheDuration = 24 * time.Hour
DefaultCacheDuration is the default duration for which an item is cached
var DefaultCacheSize = 100
DefaultCacheSize is the default size of the cache
Functions ¶
func DeleteItem ¶
DeleteItem is a function to tell the main model that a new item needs to be removed from the list
func DownloadItem ¶ added in v1.1.0
DownloadItem is a function to tell the main model that a new item needs to be downloaded
Types ¶
type Backend ¶
Backend uses a local cache to get all the feeds and their articles
func (Backend) DownloadItem ¶ added in v1.1.0
DownloadItem returns a tea.Cmd which downloads an item
func (Backend) FetchAllArticles ¶ added in v1.0.2
FetchAllArticles returns a tea.Cmd which gets all the articles from the backend
func (Backend) FetchArticles ¶
FetchArticles returns a tea.Cmd which gets the articles from the backend via a string key
func (Backend) FetchCategories ¶
FetchCategories returns a tea.Cmd which gets the category list from the backend
func (Backend) FetchDownloadedArticles ¶ added in v1.1.0
FetchDownloaded returns a tea.Cmd which gets all the downloaded articles from the backend
type Cache ¶
type Cache struct {
Content map[string]Item `json:"content"`
// contains filtered or unexported fields
}
Cache is a basic cache to read and write gofeed.Items based on the URL
func (*Cache) AddToDownloaded ¶ added in v1.1.0
AddToDownloaded adds an item to the downloaded list
func (*Cache) GetAllArticles ¶ added in v1.0.1
GetAllArticles returns an article list from the cache or fetches it from the internet if it is not cached and updates the cache, it also updates expired items and sorts the items by publish date
func (*Cache) GetArticle ¶
GetArticle returns an article list from the cache or fetches it from the internet if it is not cached and updates the cache, it also updates expired items
func (*Cache) GetDownloaded ¶ added in v1.1.0
GetDownloaded returns a list of downloaded items
type DeleteItemMessage ¶
DeleteItemMessage is a message to tell the main model that a new item needs to be removed from the list
type DownloadItemMessage ¶ added in v1.1.0
DownloadItemMessage is a message to tell the main model that a new item needs to be downloaded
type FetchErrorMessage ¶
FetchErrorMessage is a message that is sent when the fetching of the categories or feeds failed
type FetchSuccessMessage ¶
FetchSuccessMessage is a message that is sent when the fetching of the categories or feeds was successful
type Item ¶
type Item struct {
Expire time.Time `json:"expire"`
Items []gofeed.Item `json:"items"`
IsDownloaded bool `json:"is_downloaded" default:"false" omitempty:"true"`
}
Item is an item in the cache