store

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 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
	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) error

func (SQLiteStore) GetAllFeedURLs

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

func (SQLiteStore) GetAllItems

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

TODO: pagination

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
	DeleteByFeedURL(feedurl string) error
}

Jump to

Keyboard shortcuts

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