category

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: 2 Imported by: 0

Documentation

Index

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 (c *CategoryRepository) AddCategory(category _entities.Category) (_entities.Category, error)

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)

func (*CategoryRepository) GetBySlug

func (c *CategoryRepository) GetBySlug(slug string) (_entities.Category, error)

func (*CategoryRepository) Update

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

Jump to

Keyboard shortcuts

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