psql

package
v0.0.0-...-8227220 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() (*sql.DB, error)

Types

type Author

type Author struct{ *sql.DB }

func NewAuthor

func NewAuthor(db *sql.DB) *Author

func (Author) GetByID

func (a Author) GetByID(ctx context.Context, author models.Author) (models.Author, error)

type Book

type Book struct{ *sql.DB }

func NewBook

func NewBook(db *sql.DB) *Book

func (Book) Add

func (b Book) Add(ctx context.Context, book models.Book) error

func (Book) AddToFavorites

func (b Book) AddToFavorites(ctx context.Context, reader models.Reader, book models.Book) error

func (Book) AddToWishlist

func (b Book) AddToWishlist(ctx context.Context, reader models.Reader, book models.Book) error

func (Book) GetByID

func (b Book) GetByID(ctx context.Context, book models.Book) (models.Book, error)

func (Book) GetMany

func (b Book) GetMany(ctx context.Context, filter models.DataFilter) ([]models.Book, error)

type Reader

type Reader struct{ *sql.DB }

func NewReader

func NewReader(db *sql.DB) *Reader

func (Reader) Add

func (r Reader) Add(ctx context.Context, reader models.Reader) error

Add adds models.Reader entity.

func (Reader) GetByEmail

func (r Reader) GetByEmail(ctx context.Context, reader models.Reader) (models.Reader, error)

GetByEmail retrieves models.Reader email.

func (Reader) GetByID

func (r Reader) GetByID(ctx context.Context, reader models.Reader) (models.Reader, error)

GetByID retrieves models.Reader by given UserID.

Jump to

Keyboard shortcuts

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