Documentation ¶
Index ¶
- type CategoryRepository
- func (c *CategoryRepository) AddCategory(category _entities.Category) (_entities.Category, error)
- func (c *CategoryRepository) Delete(id int) error
- func (c *CategoryRepository) GetAll() ([]_entities.Category, error)
- func (c *CategoryRepository) GetBooksByCategory(slug string) ([]_entities.Book, error)
- func (c *CategoryRepository) GetByID(id int) (_entities.Category, error)
- func (c *CategoryRepository) GetBySlug(slug string) (_entities.Category, error)
- func (c *CategoryRepository) Update(category _entities.Category) (_entities.Category, error)
- type CategoryRepositoryInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryRepository ¶
type CategoryRepository struct {
// contains filtered or unexported fields
}
func (*CategoryRepository) AddCategory ¶
func (*CategoryRepository) Delete ¶
func (c *CategoryRepository) Delete(id int) error
func (*CategoryRepository) GetAll ¶
func (c *CategoryRepository) GetAll() ([]_entities.Category, error)
func (*CategoryRepository) GetBooksByCategory ¶
func (c *CategoryRepository) GetBooksByCategory(slug string) ([]_entities.Book, error)
func (*CategoryRepository) GetByID ¶
func (c *CategoryRepository) GetByID(id int) (_entities.Category, error)
type CategoryRepositoryInterface ¶
type CategoryRepositoryInterface interface { GetAll() ([]_entities.Category, error) GetBySlug(slug string) (_entities.Category, error) GetBooksByCategory(slug string) ([]_entities.Book, error) AddCategory(category _entities.Category) (_entities.Category, error) Update(category _entities.Category) (_entities.Category, error) Delete(id int) error }
func NewCategoryRepository ¶
func NewCategoryRepository(db *gorm.DB) CategoryRepositoryInterface
Click to show internal directories.
Click to hide internal directories.