lib

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: GPL-3.0, GPL-3.0 Imports: 38 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 {
	*readability.Article
	Card     *Card
	TopImage imgproc.ImageResizer
}

type Callbacks

type Callbacks interface {
	Redraw()
	SelectedCard() *Card
	SelectedCardPos() image.Point
	State() states.Enum
	ArticleChanged(*Article)
	Move() Move
}

type Card

type Card struct {
	Item       *gofeed.Item
	ItemImage  imgproc.ImageResizer
	Feed       *gofeed.Feed
	FeedImage  imgproc.ImageResizer
	Article    *Article
	Media      *media.Media
	Foreground int
	Background int
	// contains filtered or unexported fields
}

func (*Card) DownloadImage

func (card *Card) DownloadImage()
func (card *Card) DownloadLink()

func (*Card) DownloadMedia

func (card *Card) DownloadMedia()

func (*Card) GetMedia

func (card *Card) GetMedia() (*media.Media, error)

func (*Card) OpenArticle

func (card *Card) OpenArticle(ctx context.Context)

func (*Card) OpenBrowser

func (card *Card) OpenBrowser() error

func (*Card) RunMedia

func (card *Card) RunMedia()

func (*Card) SaveImage

func (card *Card) SaveImage() func(image.Image)

type Cards

type Cards []*Card

func (Cards) Len

func (cards Cards) Len() int

func (Cards) Less

func (cards Cards) Less(i, k int) bool

func (Cards) Swap

func (cards Cards) Swap(i, k int)

type ImageCache

type ImageCache interface {
	Load(any) (any, bool)
	Store(any, any)
}

type ImgDownloader

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

func (*ImgDownloader) Download

func (d *ImgDownloader) Download(url string, callback func(any))

type Move

type Move interface {
	Left()
	Right()
	Up()
	Down()
}

used for moving the selected card

type Option

type Option func(*Photon)

func WithDownloadPath

func WithDownloadPath(downloadPath string) Option

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

func WithImageCache

func WithImageCache(ic ImageCache) Option

func WithMediaExtractor

func WithMediaExtractor(extractor string) Option

func WithMediaImageCmd

func WithMediaImageCmd(imageCmd string) Option

func WithMediaTorrentCmd

func WithMediaTorrentCmd(torrentCmd string) Option

func WithMediaVideoCmd

func WithMediaVideoCmd(videoCmd string) Option

type Photon

type Photon struct {
	ImgDownloader *ImgDownloader

	KeyBindings *keybindings.Registry

	Cards        Cards
	VisibleCards Cards

	OpenedArticle *Article
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cb Callbacks, paths []string, options ...Option) (*Photon, error)

func (*Photon) DownloadFeeds

func (p *Photon) DownloadFeeds()

func (*Photon) GetStatus

func (p *Photon) GetStatus() string

func (*Photon) SearchQuery

func (p *Photon) SearchQuery(q string)

func (*Photon) SetStatus

func (p *Photon) SetStatus(text string)

func (*Photon) SetStatusWithSpinner

func (p *Photon) SetStatusWithSpinner(text string)

func (*Photon) StatusWithTimeout

func (p *Photon) StatusWithTimeout(text string, d time.Duration)

type Status

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

status line text and state

Directories

Path Synopsis
Package ls implements a key-value store for lua (like localStorage in js)
Package ls implements a key-value store for lua (like localStorage in js)

Jump to

Keyboard shortcuts

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