category

package
v0.0.0-...-902682f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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

type CategoryRepo struct {
	DB *gorm.DB
}

func (*CategoryRepo) Create

func (*CategoryRepo) Delete

func (rep *CategoryRepo) Delete(ctx context.Context, id int) 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

Jump to

Keyboard shortcuts

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