db

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 8 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 {
	ID          int64
	FeedID      int64
	GUID        string
	Title       string
	Link        string
	Content     string
	Summary     string
	PublishedAt time.Time
	Read        bool
}

type DB

type DB struct {
	*sql.DB
}

func Open

func Open() (*DB, error)

func (*DB) AddFeed

func (db *DB) AddFeed(url, title, description string) (int64, error)

func (*DB) AddFolder

func (db *DB) AddFolder(name, color string) (int64, error)

func (*DB) DeleteFeed

func (db *DB) DeleteFeed(id int64) error

func (*DB) DeleteFolder

func (db *DB) DeleteFolder(id int64) error

func (*DB) GetFeed

func (db *DB) GetFeed(id int64) (Feed, error)

func (*DB) ListArticles

func (db *DB) ListArticles(feedID int64) ([]Article, error)

func (*DB) ListFeeds

func (db *DB) ListFeeds() ([]Feed, error)

func (*DB) ListFolders

func (db *DB) ListFolders() ([]Folder, error)

func (*DB) ListRemoteFeedFolders

func (db *DB) ListRemoteFeedFolders() (map[int64]int64, error)

func (*DB) ListRemoteFeedPrefs

func (db *DB) ListRemoteFeedPrefs() (map[int64]RemoteFeedPref, error)

func (*DB) ListUnreadArticles

func (db *DB) ListUnreadArticles(feedID int64) ([]Article, error)

func (*DB) MarkAllRead

func (db *DB) MarkAllRead(feedID int64) error

func (*DB) MarkRead

func (db *DB) MarkRead(id int64, read bool) error

func (*DB) RenameFolder

func (db *DB) RenameFolder(id int64, name string) error

func (*DB) ReorderFolder

func (db *DB) ReorderFolder(id int64, position int) error

func (*DB) SaveSummary

func (db *DB) SaveSummary(id int64, summary string) error

func (*DB) SetFeedFolder

func (db *DB) SetFeedFolder(feedID, folderID int64) error

func (*DB) SetFolderColor

func (db *DB) SetFolderColor(id int64, color string) error

func (*DB) SetRemoteFeedFolder

func (db *DB) SetRemoteFeedFolder(remoteFeedID, folderID int64) error

func (*DB) SetRemoteFeedTitle

func (db *DB) SetRemoteFeedTitle(remoteFeedID int64, title string) error

func (*DB) TouchFeedFetched

func (db *DB) TouchFeedFetched(id int64, lastFetched time.Time) error

func (*DB) UpdateArticleContent

func (db *DB) UpdateArticleContent(id int64, content string) error

func (*DB) UpdateFeed

func (db *DB) UpdateFeed(id int64, title, url string) error

func (*DB) UpdateFeedMeta

func (db *DB) UpdateFeedMeta(id int64, title, description, faviconURL string, lastFetched time.Time) error

func (*DB) UpdateFeedURL

func (db *DB) UpdateFeedURL(id int64, url string) error

func (*DB) UpsertArticle

func (db *DB) UpsertArticle(a Article) error

type Feed

type Feed struct {
	ID          int64
	URL         string
	Title       string
	Description string
	FaviconURL  string
	LastFetched time.Time
	UnreadCount int64
	FolderID    int64
}

type Folder

type Folder struct {
	ID       int64
	Name     string
	Position int
	Color    string
}

type RemoteFeedPref

type RemoteFeedPref struct {
	FolderID int64
	Title    string
}

Jump to

Keyboard shortcuts

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