Documentation ¶
Index ¶
- func CreateCategoryRepo(conn *gorm.DB) categoryItems.Repository
- func ToListDomain(data []Category) (result []categoryItems.Domain)
- type Category
- type CategoryRepo
- func (rep *CategoryRepo) Create(ctx context.Context, catC *categoryItems.Domain) (categoryItems.Domain, error)
- func (rep *CategoryRepo) Delete(ctx context.Context, id int) error
- func (rep *CategoryRepo) GetAll(ctx context.Context) ([]categoryItems.Domain, error)
- func (rep *CategoryRepo) GetById(ctx context.Context, id int) (categoryItems.Domain, error)
- func (rep *CategoryRepo) Update(ctx context.Context, userU categoryItems.Domain) (categoryItems.Domain, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCategoryRepo ¶
func CreateCategoryRepo(conn *gorm.DB) categoryItems.Repository
func ToListDomain ¶
func ToListDomain(data []Category) (result []categoryItems.Domain)
Types ¶
type Category ¶
type Category struct { Id int `gorm:"primaryKey"` Name string Svg string CreatedAt time.Time UpdatedAt time.Time }
func FromDomain ¶
func FromDomain(domain categoryItems.Domain) Category
func (*Category) ToDomain ¶
func (user *Category) ToDomain() categoryItems.Domain
type CategoryRepo ¶
func (*CategoryRepo) Create ¶
func (rep *CategoryRepo) Create(ctx context.Context, catC *categoryItems.Domain) (categoryItems.Domain, error)
func (*CategoryRepo) GetAll ¶
func (rep *CategoryRepo) GetAll(ctx context.Context) ([]categoryItems.Domain, error)
func (*CategoryRepo) GetById ¶
func (rep *CategoryRepo) GetById(ctx context.Context, id int) (categoryItems.Domain, error)
func (*CategoryRepo) Update ¶
func (rep *CategoryRepo) Update(ctx context.Context, userU categoryItems.Domain) (categoryItems.Domain, error)
Click to show internal directories.
Click to hide internal directories.