store

package
v2.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: GPL-3.0 Imports: 8 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
	GUID        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 NewInMemorySQLiteStore added in v2.19.0

func NewInMemorySQLiteStore() (*SQLiteStore, error)

func NewSQLiteStore

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

func (*SQLiteStore) BeginBatch added in v2.16.0

func (sls *SQLiteStore) BeginBatch() error

Begin a transaction. UpsertItem will use this transaction until client code calls EndBatch().

func (SQLiteStore) CountUnread added in v2.13.0

func (sls SQLiteStore) CountUnread() (int, error)

func (SQLiteStore) DeleteByFeedURL

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

func (*SQLiteStore) EndBatch added in v2.16.0

func (sls *SQLiteStore) EndBatch() error

Commit a transaction. This commits any changes made since BeginBatch() and reset sls.batch to nil so that subsequent calls to UpsertItem() will not use a transaction.

func (SQLiteStore) GetAllFeedURLs

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

func (SQLiteStore) GetAllItems

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

TODO: pagination

func (SQLiteStore) GetItemByID added in v2.5.0

func (sls SQLiteStore) GetItemByID(ID int) (Item, error)

func (SQLiteStore) MarkAllRead added in v2.5.0

func (sls SQLiteStore) MarkAllRead() error

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
	BeginBatch() error
	EndBatch() error
	GetAllItems(ordering string) ([]Item, error)
	GetItemByID(ID int) (Item, error)
	GetAllFeedURLs() ([]string, error)
	ToggleRead(ID int) error
	MarkAllRead() error
	ToggleFavourite(ID int) error
	DeleteByFeedURL(feedurl string, incFavourites bool) error
	CountUnread() (int, error)
}

Jump to

Keyboard shortcuts

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