repository

package
v0.0.0-...-da803b4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InsertBookQuery = `` /* 204-byte string literal not displayed */

	DeleteBookQuery = `
	DELETE FROM
		books
	WHERE
		id = $1;
	`
)

Variables

This section is empty.

Functions

func NewBookRepository

func NewBookRepository(db *sqlx.DB) domain.BookRepository

Types

type BooksRepo

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

func (*BooksRepo) DeleteBook

func (r *BooksRepo) DeleteBook(ctx context.Context, id int64) error

func (*BooksRepo) GetAll

func (*BooksRepo) GetByCategory

func (r *BooksRepo) GetByCategory(ctx context.Context, category string, p *pagination.PaginationQuery) ([]domain.Books, error)

func (*BooksRepo) GetByID

func (r *BooksRepo) GetByID(ctx context.Context, id int64) (*domain.Book, error)

func (*BooksRepo) InsertBook

func (r *BooksRepo) InsertBook(ctx context.Context, book *domain.Book) (int64, error)

func (*BooksRepo) UpdateBook

func (r *BooksRepo) UpdateBook(ctx context.Context, id int64) error

Jump to

Keyboard shortcuts

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