backend

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteItem

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

DeleteItem is called from a tab to tell the browser that an item needs to be deleted.

func DownloadItem added in v1.1.0

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

DownloadItem is called from a tab to tell the browser that an item needs to be downloaded.

func EditItem added in v1.5.1

func EditItem(sender tab.Tab, fields []string) tea.Cmd

EditItem is called from a tab to tell the browser that an item needs to be edited.

func MakeChoice added in v1.3.0

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

MakeChoice is called from a tab to tell the browser that a binary choice prompt needs to be created.

func MarkAsRead added in v1.5.0

func MarkAsRead(url string) tea.Cmd

MarkAsRead is called from a tab to tell the browser that an item needs to be marked as read.

func MarkAsUnread added in v1.5.0

func MarkAsUnread(url string) tea.Cmd

MarkAsUnread is called from a tab to tell the browser that an item needs to be marked as unread.

func NewItem

func NewItem(sender tab.Tab) tea.Cmd

NewItem is called from a tab to tell the browser that a new item needs to be added.

func SetEnableKeybind added in v1.5.1

func SetEnableKeybind(enable bool) tea.Cmd

SetEnableKeybind is called from a tab to tell the broswer that keybinds should be enabled/disabled.

func StartQuitting added in v1.5.1

func StartQuitting() tea.Cmd

StartQuitting is called from a tab to tell the browser to start quitting.

Types

type ArticleFetcher added in v1.5.2

type ArticleFetcher func(feedname string, refresh bool) tea.Cmd

ArticleFetcher fetches the article data, it is used by tabs to query data.

type ArticleItem added in v1.6.2

type ArticleItem struct {
	list.Item
	ArtTitle        string
	Desc            string
	RawDesc         string
	MarkdownContent string
	FeedURL         string
}

ArticleItem is an item that contains article data.

func (ArticleItem) Description added in v1.6.2

func (a ArticleItem) Description() string

Description fulfills the list.DefaultItem interface

func (ArticleItem) FilterValue added in v1.6.2

func (a ArticleItem) FilterValue() string

FilterValue fulfills the list.Item interface

func (ArticleItem) Title added in v1.6.2

func (a ArticleItem) Title() string

Title fulfills the list.DefaultItem interface

type Backend

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

Backend provides a way of fetching data from the cache and the RSS feed.

func New

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

New creates a new backend and its components.

func (Backend) Close

func (b Backend) Close() error

Close closes the backend and saves its components.

func (Backend) DownloadItem added in v1.1.0

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

DownloadItem downloads an article.

func (Backend) FetchAllArticles added in v1.0.2

func (b Backend) FetchAllArticles(_ string, refresh bool) tea.Cmd

FetchAllArticles gets all the articles from all the feeds.

func (Backend) FetchArticles

func (b Backend) FetchArticles(feedname string, refresh bool) tea.Cmd

FetchArticles gets the articles from a feed.

func (Backend) FetchCategories

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

FetchCategories gets the categories.

func (Backend) FetchDownloadedArticles added in v1.1.0

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

FetchDownloaded gets the downloaded articles.

func (Backend) FetchFeeds

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

FetchFeeds gets the feeds from a category.

type DeleteItemMsg added in v1.3.0

type DeleteItemMsg struct {
	Sender   tab.Tab
	ItemName string
}

DeleteItemMsg contains info the browser needs to know to delete an item.

type DownloadItemMsg added in v1.3.0

type DownloadItemMsg struct {
	FeedName string
	Index    int
}

DownloadItemMsg contains info the browser needs to know to download an item.

type EditItemMsg added in v1.5.1

type EditItemMsg struct {
	Sender    tab.Tab
	OldFields []string
}

EditItemMsg contains info the browser needs to know to edit an item.

type FetchArticleSuccessMsg added in v1.3.0

type FetchArticleSuccessMsg struct {
	Items []list.Item
}

FetchArticleSuccessMsg is sent on article fetch success.

type FetchErrorMsg added in v1.3.0

type FetchErrorMsg struct {
	Err         error
	Description string
}

FetchErrorMsg is sent on fetch error.

type FetchSuccessMsg added in v1.3.0

type FetchSuccessMsg struct{ Items []list.Item }

FetchSuccessMsg is sent on fetch success.

type Fetcher added in v1.3.5

type Fetcher func(feedname string) tea.Cmd

Fetcher fetches the data, it is used by tabs to query data.

type MakeChoiceMsg added in v1.3.0

type MakeChoiceMsg struct {
	Question string
	Default  bool
}

MakeChoiceMsg contains info needed to create a binary choice prompt.

type MarkAsReadMsg added in v1.5.0

type MarkAsReadMsg string

MarkAsReadMsg contains info needed to mark an item as read.

type MarkAsUnreadMsg added in v1.5.0

type MarkAsUnreadMsg string

MarkAsUnreadMsg contains info needed to mark an item as unread.

type NewItemMsg added in v1.3.0

type NewItemMsg struct{ Sender tab.Tab }

NewItemMsg contains info the browser needs to know to add a new item.

type SetEnableKeybindMsg added in v1.5.1

type SetEnableKeybindMsg bool

SetEnableKeybindMsg contains the desired state of the keybinds.

type StartQuittingMsg added in v1.5.1

type StartQuittingMsg struct{}

StartQuittingMsg prompts the browser to start quitting (and perform a last browser redraw).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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