backend

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteItem

func DeleteItem(sender tab.Tab, key string) tea.Cmd

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

func DownloadItem(key string, index int) tea.Cmd

DownloadItem is a function to tell the main model that a new item needs to be downloaded

func MakeChoice added in v1.3.0

func MakeChoice(question string, defaultChoice bool) tea.Cmd

MakeChoice is a function to tell the main model that a choice needs to be made

func MarkAsRead added in v1.5.0

func MarkAsRead(key string, index int) tea.Cmd

MarkAsRead is a function to tell the main model that a new item needs to be marked as read

func MarkAsUnread added in v1.5.0

func MarkAsUnread(key string, index int) tea.Cmd

MarkAsUnread is a function to tell the main model that a new item needs to be marked as unread

func NewItem

func NewItem(sender tab.Tab, editing bool, fields []string) tea.Cmd

NewItem is a function to tell the main model that a new item needs to be added to the list

Types

type Backend

type Backend struct {
	Rss        *rss.Rss
	Cache      *cache.Cache
	ReadStatus *cache.ReadStatus
}

Backend uses a local cache to get all the feeds and their articles

func New

func New(urlPath, cachePath string, resetCache bool) (*Backend, error)

New creates a new Cache Backend

func (Backend) Close

func (b Backend) Close() error

Close closes the backend

func (Backend) DownloadItem added in v1.1.0

func (b Backend) DownloadItem(key string, index int) tea.Cmd

DownloadItem returns a tea.Cmd which downloads an item

func (Backend) FetchAllArticles added in v1.0.2

func (b Backend) FetchAllArticles(_ string) tea.Cmd

FetchAllArticles returns a tea.Cmd which gets all the articles

func (Backend) FetchArticles

func (b Backend) FetchArticles(feedName string) tea.Cmd

FetchArticles returns a tea.Cmd which gets the articles

func (Backend) FetchCategories

func (b Backend) FetchCategories(_ string) tea.Cmd

FetchCategories returns a tea.Cmd which gets the category list

func (Backend) FetchDownloadedArticles added in v1.1.0

func (b Backend) FetchDownloadedArticles(_ string) tea.Cmd

FetchDownloaded returns a tea.Cmd which gets the downloaded articles

func (Backend) FetchFeeds

func (b Backend) FetchFeeds(catName string) tea.Cmd

FetchFeeds returns a tea.Cmd which gets the feeds for a category

func (Backend) MarkAsRead added in v1.5.0

func (b Backend) MarkAsRead(key string, index int) tea.Cmd

MarkAsRead marks an article as read

func (Backend) MarkAsUnread added in v1.5.0

func (b Backend) MarkAsUnread(key string, index int) tea.Cmd

MarkAsUnread marks an article as unread

func (Backend) RemoveDownload added in v1.2.0

func (b Backend) RemoveDownload(key string) error

RemoveDownload tries to remove a download from the backend

func (*Backend) SetOfflineMode added in v1.2.0

func (b *Backend) SetOfflineMode(mode bool)

SetOfflineMode sets the offline mode of the backend

type DeleteItemMsg added in v1.3.0

type DeleteItemMsg struct {
	Sender tab.Tab
	Key    string
}

DeleteItemMsg is a message to tell the main model that a new item needs to be removed from the list

type DownloadItemMsg added in v1.3.0

type DownloadItemMsg struct {
	Key   string
	Index int
}

DownloadItemMsg is a message to tell the main model that a new item needs to be downloaded

type FetchArticleSuccessMsg added in v1.3.0

type FetchArticleSuccessMsg struct {
	Items           []list.Item
	ArticleContents []string
}

FetchArticleSuccessMsg is a message that is sent when the fetching of the articles was successful

type FetchErrorMsg added in v1.3.0

type FetchErrorMsg struct {
	Err         error
	Description string
}

FetchErrorMsgssage that is sent when the fetching of the categories or feeds failed

type FetchSuccessMsg added in v1.3.0

type FetchSuccessMsg struct {
	Items []list.Item
}

FetchSuccessMsg is a message that is sent when the fetching of the categories or feeds was successful

type Fetcher added in v1.3.5

type Fetcher func(string) tea.Cmd

Fetcher is a function that fetches the items

type MakeChoiceMsg added in v1.3.0

type MakeChoiceMsg struct {
	Question string
	Default  bool
}

MakeChoiceMsg is a message to tell the main model that a choice needs to be made

type MarkAsReadMsg added in v1.5.0

type MarkAsReadMsg struct {
	Key   string
	Index int
}

MarkAsRead is a message to tell the main model that a new item needs to be marked as read

type MarkAsUnreadMsg added in v1.5.0

type MarkAsUnreadMsg struct {
	Key   string
	Index int
}

MarkAsUnread is a message to tell the main model that a new item needs to be marked as unread

type NewItemMsg added in v1.3.0

type NewItemMsg struct {
	Sender    tab.Tab
	OldFields []string
	Editing   bool
}

NewItemMsg is a message to tell the main model that a new item needs to be added to the list

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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