db

package
v0.0.0-...-2610577 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 10 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
}

DB allows to access feeds database.

func New

func New(sqldb *sql.DB) *DB

New returns new feeds database.

func (*DB) Create

func (db *DB) Create(ctx context.Context, feed *feeds.Feed) error

Create adds a new articles to the database.

func (*DB) Get

func (db *DB) Get(ctx context.Context, id string, userID string) (*feeds.Feed, error)

Get returns article by id.

func (*DB) List

func (db *DB) List(ctx context.Context, userID string, request *feeds.ListFeedsRequest) ([]*feeds.Feed, error)

List returns articles for a user.

func (*DB) ListAll

func (db *DB) ListAll(ctx context.Context) ([]*feeds.Feed, error)

ListAll returns all articles.

func (*DB) Update

func (db *DB) Update(ctx context.Context, feed *feeds.Feed, userID string) error

Update updates a feed.

Jump to

Keyboard shortcuts

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