categorymanager

package
v0.0.0-...-83f3c07 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 9 Imported by: 0

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 Category

type Category struct {
	Id        uint
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
}

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"`
}

Jump to

Keyboard shortcuts

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