db

package
v0.0.0-...-cbf6487 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFound = errors.New("feed already exists in the database")

Functions

This section is empty.

Types

type DB

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

func Open

func Open(ctrPath, feedsPath, itemsPath string) (*DB, error)

func (*DB) AddFeed

func (db *DB) AddFeed(host, feedURL string) (int, error)

func (*DB) AddItems

func (db *DB) AddItems(feedID int, items []Item) error

func (*DB) AllFeeds

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

func (*DB) Close

func (db *DB) Close() error

func (*DB) EditFeedHost

func (db *DB) EditFeedHost(id int, newHost string) error

func (*DB) ItemCount

func (db *DB) ItemCount() (int, error)

func (*DB) Newest

func (db *DB) Newest(offset, limit uint) ([]ItemWithHost, error)

func (*DB) RemoveFeed

func (db *DB) RemoveFeed(id int) error

type Feed

type Feed struct {
	ID          int
	Host        string
	FeedURL     string
	LastChecked sql.NullTime
	LastUpdated sql.NullTime
}

type Item

type Item struct {
	FeedID int
	Title  string
	URL    string
	Added  time.Time
}

type ItemWithHost

type ItemWithHost struct {
	Item
	Host string
}

Jump to

Keyboard shortcuts

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