store

package
v2.2.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID          int
	Author      string
	Title       string
	Favourite   bool
	FeedURL     string
	FeedName    string // added from config if set
	Link        string
	Content     string
	ReadAt      time.Time
	PublishedAt time.Time
	UpdatedAt   time.Time
	CreatedAt   time.Time
}

func (Item) Read

func (i Item) Read() bool

type SQLiteStore

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

func NewSQLiteStore

func NewSQLiteStore(basePath string) (*SQLiteStore, error)

func (SQLiteStore) DeleteByFeedURL

func (sls SQLiteStore) DeleteByFeedURL(feedurl string, incFavourites bool) error

func (SQLiteStore) GetAllFeedURLs

func (sls SQLiteStore) GetAllFeedURLs() ([]string, error)

func (SQLiteStore) GetAllItems

func (sls SQLiteStore) GetAllItems() ([]Item, error)

TODO: pagination

func (SQLiteStore) ToggleFavourite added in v2.1.5

func (sls SQLiteStore) ToggleFavourite(ID int) error

func (SQLiteStore) ToggleRead

func (sls SQLiteStore) ToggleRead(ID int) error

func (SQLiteStore) UpsertItem

func (sls SQLiteStore) UpsertItem(item Item) error

type Store

type Store interface {
	UpsertItem(item Item) error
	GetAllItems() ([]Item, error)
	GetAllFeedURLs() ([]string, error)
	ToggleRead(ID int) error
	ToggleFavourite(ID int) error
	DeleteByFeedURL(feedurl string, incFavourites bool) error
}

Jump to

Keyboard shortcuts

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