Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewController ¶
func NewController(service *categoryService) categoryController
func NewService ¶
func NewService(repository *CategoryRepository) categoryService
func RegisterRoutes ¶
func RegisterRoutes(r *chi.Mux)
Types ¶
type CategoryRepository ¶
type CategoryRepository interface { GetAllCategories() []categoryModel CreateCategory(name string) (id uint, err error) }
func NewPostgresRepository ¶
func NewPostgresRepository(db *sql.DB) CategoryRepository
type CreateCategoryDto ¶
type CreateCategoryDto struct {
Name string `json:"name"`
}
type CreateCategoryResponse ¶
type CreateCategoryResponse struct {
ID uint `json:"id"`
}
Click to show internal directories.
Click to hide internal directories.