internal

package
v0.0.0-...-a65ac1c Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	// contains filtered or unexported fields
}

Article is for

type Config

type Config struct {
	// only exported fields will be encoded/decoded in JSON,
	// fields must start with capital letters to be exported.
	OPML                      string              `json:"opml"`
	Feeds                     []map[string]string `json:"feeds"`
	KeyMoveDown               string              `json:"keyMoveDown"`
	KeyMoveUp                 string              `json:"keyMoveUp"`
	KeySwitchWindows          string              `json:"keySwitchWindows"`
	KeyQuit                   string              `json:"keyQuit"`
	KeyHelp                   string              `json:"keyHelp"`
	KeyPreview                string              `json:"keyPreview"`
	KeyMarkArticle            string              `json:"keyMarkArticle"`
	KeyOpenLink               string              `json:"keyOpenLink"`
	DaysKeepDeletedArticle    int                 `json:"daysKeepDeletedArticle"`
	DaysKeepReadArticle       int                 `json:"daysKeepReadArticle"`
	SkipArticlesOlderThanDays int                 `json:"skipArticlesOlderThanDays"`
	SecondsBetweenUpdates     int                 `json:"secondsBetweenUpdates"`
}

func (*Config) GetConfigKeys

func (c *Config) GetConfigKeys() map[string]string

func (*Config) LoadConfig

func (c *Config) LoadConfig(file string)

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func (*Controller) GetAllArticlesFromDB

func (c *Controller) GetAllArticlesFromDB()

func (*Controller) GetArticleForSelection

func (c *Controller) GetArticleForSelection() *Article

func (*Controller) GetSelectedArticle

func (c *Controller) GetSelectedArticle() *Article

func (*Controller) Init

func (c *Controller) Init(cfg, theme, dbFile string)

func (*Controller) InputFunc

func (c *Controller) InputFunc(event *tcell.EventKey) *tcell.EventKey

func (*Controller) MarkArticle

func (c *Controller) MarkArticle()
func (c *Controller) OpenLink(link string)

func (*Controller) Quit

func (c *Controller) Quit()

func (*Controller) SelectArticle

func (c *Controller) SelectArticle(row, col int)

func (*Controller) SelectFeed

func (c *Controller) SelectFeed(row, col int)

func (*Controller) UpdateFeeds

func (c *Controller) UpdateFeeds()

UpdateFeeds will update all rss and save the result to database

func (*Controller) UpdateLoop

func (c *Controller) UpdateLoop()

type DB

type DB struct {
	// contains filtered or unexported fields
}

func (*DB) All

func (d *DB) All() map[string][]Article

All will return map of article, key:feed titile, value:article

func (*DB) CleanUp

func (d *DB) CleanUp()

CleanUp will remove deleted and read articles from database

func (*DB) CreateTables

func (d *DB) CreateTables(rss *RSS)

func (*DB) Delete

func (d *DB) Delete(a Article)

func (*DB) Init

func (d *DB) Init(c *Controller, dbFile string)

func (*DB) MarkAllRead

func (d *DB) MarkAllRead(a Article)

func (*DB) MarkAllUnread

func (d *DB) MarkAllUnread(a Article)

func (*DB) MarkRead

func (d *DB) MarkRead(a *Article)

func (*DB) MarkUnread

func (d *DB) MarkUnread(a *Article)

func (*DB) Save

func (d *DB) Save(a Article)

type RSS

type RSS struct {
	// contains filtered or unexported fields
}

func (*RSS) FetchURL

func (r *RSS) FetchURL(fp *gofeed.Parser, url string) (*gofeed.Feed, error)

FetchURL will send a request to url and use gofeed parse response's body.

func (*RSS) GetTitleURLFromConfig

func (r *RSS) GetTitleURLFromConfig()

func (*RSS) GetTitleURLFromOPML

func (r *RSS) GetTitleURLFromOPML(opmlFile string)

func (*RSS) Init

func (r *RSS) Init(c *Controller)

func (*RSS) Update

func (r *RSS) Update()

Update will fetch all content from rss

type Theme

type Theme struct {
	FeedNames          []string `json:"feedNames"`
	Date               string   `json:"date"`
	Time               string   `json:"time"`
	ArticleBorder      string   `json:"articleBorder"`
	PreviewBorder      string   `json:"previewBorder"`
	FeedBorder         string   `json:"feedBorder"`
	ArticleBorderTitle string   `json:"articleBorderTitle"`
	FeedBorderTitle    string   `json:"feedBorderTitle"`
	PreviewBorderTitle string   `json:"previewBorderTitle"`
	Highlights         string   `json:"highlights"`
	TableHead          string   `json:"tableHead"`
	Title              string   `json:"title"`
	UnreadFeedName     string   `json:"unreadFeedName"`
	TotalColumn        string   `json:"totalColumn"`
	UnreadColumn       string   `json:"unreadColumn"`
	PreviewText        string   `json:"previewText"`
	PreviewLink        string   `json:"previewLink"`
	ReadMarker         string   `json:"readMarker"`
	FeedIcon           string   `json:"feedIcon"`
	ArticleIcon        string   `json:"articleIcon"`
	PreviewIcon        string   `json:"previewIcon"`
	StatusBackground   string   `json:"statusBackground"`
	StatusText         string   `json:"statusText"`
	StatusKey          string   `json:"statusKey"`
	StatusBrackets     string   `json:"statusBrackets"`
}

func (*Theme) LoadTheme

func (t *Theme) LoadTheme(file string)

type Window

type Window struct {
	// contains filtered or unexported fields
}

func (*Window) AddToArticles

func (w *Window) AddToArticles(a *Article)

func (*Window) AddToFeeds

func (w *Window) AddToFeeds(title string, unread, total int, ref string)

func (*Window) AddToPreview

func (w *Window) AddToPreview(a *Article)

func (*Window) ArticleSelectedFunc

func (w *Window) ArticleSelectedFunc(f func(r, c int))

func (*Window) ArticlesHasFocus

func (w *Window) ArticlesHasFocus() bool

func (*Window) ClearArticles

func (w *Window) ClearArticles()

func (*Window) ClearFeeds

func (w *Window) ClearFeeds()

ClearFeeds will clear the feed window and reset it

func (*Window) FeedSelectedFunc

func (w *Window) FeedSelectedFunc(f func(r, c int))

func (*Window) Init

func (w *Window) Init(c *Controller, inputFunc func(event *tcell.EventKey) *tcell.EventKey)

func (*Window) InitFlex

func (w *Window) InitFlex()

func (*Window) InitHelpWindow

func (w *Window) InitHelpWindow()

func (*Window) InitStatusWindow

func (w *Window) InitStatusWindow()

func (*Window) MoveDown

func (w *Window) MoveDown()

func (*Window) MoveUp

func (w *Window) MoveUp()

func (*Window) Start

func (w *Window) Start()

func (*Window) SwitchFocus

func (w *Window) SwitchFocus()

SwitchFocus feeds->article->preview->feeds

func (*Window) TriggerHelp

func (w *Window) TriggerHelp()

func (*Window) TriggerPreview

func (w *Window) TriggerPreview()

func (*Window) UpdateStatus

func (w *Window) UpdateStatus()

func (*Window) UpdateStatusTicker

func (w *Window) UpdateStatusTicker()

Jump to

Keyboard shortcuts

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