Documentation ¶
Index ¶
- Constants
- func NewBookRepository(db *sqlx.DB) domain.BookRepository
- type BooksRepo
- func (r *BooksRepo) DeleteBook(ctx context.Context, id int64) error
- func (r *BooksRepo) GetAll(ctx context.Context, p *pagination.PaginationQuery) ([]domain.Books, error)
- func (r *BooksRepo) GetByCategory(ctx context.Context, category string, p *pagination.PaginationQuery) ([]domain.Books, error)
- func (r *BooksRepo) GetByID(ctx context.Context, id int64) (*domain.Book, error)
- func (r *BooksRepo) InsertBook(ctx context.Context, book *domain.Book) (int64, error)
- func (r *BooksRepo) UpdateBook(ctx context.Context, id int64) error
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) GetAll ¶
func (r *BooksRepo) GetAll(ctx context.Context, p *pagination.PaginationQuery) ([]domain.Books, error)
func (*BooksRepo) GetByCategory ¶
func (r *BooksRepo) GetByCategory(ctx context.Context, category string, p *pagination.PaginationQuery) ([]domain.Books, error)
func (*BooksRepo) InsertBook ¶
Click to show internal directories.
Click to hide internal directories.