book

package
v0.0.0-...-d4bccd0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookRepository

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

func (*BookRepository) AddBook

func (br *BookRepository) AddBook(book _entities.Book) (_entities.Book, error)

func (*BookRepository) Count

func (br *BookRepository) Count() (int, error)

func (*BookRepository) Delete

func (br *BookRepository) Delete(id int) error

func (*BookRepository) GetAll

func (br *BookRepository) GetAll() ([]_entities.Book, error)

func (*BookRepository) GetByID

func (br *BookRepository) GetByID(id int) (_entities.Book, error)

func (*BookRepository) GetByQuery

func (br *BookRepository) GetByQuery(page int, limit int, category string) ([]_entities.Book, error)

func (*BookRepository) Update

func (br *BookRepository) Update(book _entities.Book) (_entities.Book, error)

type BookRepositoryInterface

type BookRepositoryInterface interface {
	GetAll() ([]_entities.Book, error)
	GetByQuery(page int, limit int, category string) ([]_entities.Book, error)
	Count() (int, error)
	GetByID(id int) (_entities.Book, error)
	AddBook(book _entities.Book) (_entities.Book, error)
	Update(book _entities.Book) (_entities.Book, error)
	Delete(id int) error
}

func NewBookRepository

func NewBookRepository(db *gorm.DB) BookRepositoryInterface

Jump to

Keyboard shortcuts

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