pg

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(url string) (*DB, error)

func (*DB) AddArticle

func (db *DB) AddArticle(ctx context.Context, a storage.Article) (int, error)

func (*DB) AddArticles

func (db *DB) AddArticles(ctx context.Context, articles []storage.Article) error

func (*DB) AddRSSFeed

func (db *DB) AddRSSFeed(ctx context.Context, feed storage.RSSFeed) (int, error)

func (*DB) Article

func (db *DB) Article(ctx context.Context, aid int) (storage.Article, error)

func (*DB) Articles

func (db *DB) Articles(ctx context.Context, pageNum, pageSize int) ([]storage.Article, error)

func (*DB) CountArticles

func (db *DB) CountArticles(ctx context.Context, search string) (int, error)

func (*DB) DeleteArticle

func (db *DB) DeleteArticle(ctx context.Context, a storage.Article) error

func (*DB) DeleteRSSFeed

func (db *DB) DeleteRSSFeed(ctx context.Context, feed storage.RSSFeed) error

func (*DB) Feeds

func (db *DB) Feeds(ctx context.Context) ([]storage.RSSFeed, error)

func (*DB) LoadRSSFeeds

func (db *DB) LoadRSSFeeds(ctx context.Context, cfg *config.Config) error

func (*DB) SearchArticles

func (db *DB) SearchArticles(ctx context.Context, search string, pageNum, pageSize int) ([]storage.Article, error)

Jump to

Keyboard shortcuts

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