commands

package
v2.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomFilter added in v2.2.0

func CustomFilter(term string, targets []string) []list.Rank

func GetWslHostName

func GetWslHostName() string

Gets the subsystem host ip If the CLI is running under WSL the localhost url will not work so this function should return the real ip that we should redirect to

func IsWSL

func IsWSL() bool

func IsWayland

func IsWayland() bool

func Render

func Render(items []list.Item, cmds Commands, errors []string) error

Types

type Commands

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

func New

func New(config config.Config, store store.Store) Commands

func (Commands) Add

func (c Commands) Add(url string) error

func (Commands) CleanFeeds

func (c Commands) CleanFeeds() error

func (Commands) FindArticle

func (c Commands) FindArticle(substr string) (item store.Item, err error)

func (Commands) GetAllFeeds

func (c Commands) GetAllFeeds() ([]store.Item, error)

func (Commands) GetArticleByID

func (c Commands) GetArticleByID(ID int) (store.Item, error)

func (Commands) GetGlamourisedArticle

func (c Commands) GetGlamourisedArticle(ID int) (string, error)

func (Commands) List

func (c Commands) List(numResults int) error

func (Commands) OpenInBrowser

func (c Commands) OpenInBrowser(url string) error
func (c Commands) OpenLink(url string) error

func (Commands) TUI

func (c Commands) TUI() error

type ErrorItem added in v2.1.4

type ErrorItem struct {
	FeedURL string
	Err     error
}

type FetchResultError

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

type Filterer added in v2.2.0

type Filterer struct {
	FeedNames []string
	Term      struct {
		Title     string
		FeedNames []string
	}
}

Struct to aid in filtering items into ranks for BubbleTea

func NewFilterer added in v2.2.0

func NewFilterer(term string) Filterer

func (*Filterer) ExtractFiltersFor added in v2.2.0

func (f *Filterer) ExtractFiltersFor(tags ...string) []string

Extracts `tag:.*` from the stored f.Term.Title

func (*Filterer) Filter added in v2.2.0

func (f *Filterer) Filter(targets []string) []fuzzy.Match

Runs all filters

func (*Filterer) FilterBy added in v2.2.0

func (f *Filterer) FilterBy(filterValues []string, targetFilterValues []string, ranks []fuzzy.Match) []fuzzy.Match

Filters by specific filterValue/s on the Filterer.Term

func (*Filterer) GetItem added in v2.2.0

func (f *Filterer) GetItem(filterValue string) TUIItem

Breaks what's returned from TUIItem.FilterValue() into a TUIItem.

type TUIItem

type TUIItem struct {
	ID        int
	Title     string
	FeedName  string
	URL       string
	Read      bool
	Favourite bool
}

func ItemToTUIItem

func ItemToTUIItem(i store.Item) TUIItem

func (TUIItem) FilterValue

func (i TUIItem) FilterValue() string

Jump to

Keyboard shortcuts

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