categoryItems

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryItemsUsecase

type CategoryItemsUsecase struct {
	Repo Repository

	ConfigJWT middlewares.ConfigJWT
	// contains filtered or unexported fields
}

func (*CategoryItemsUsecase) Create

func (pc *CategoryItemsUsecase) Create(ctx context.Context, domain Domain) (Domain, error)

func (*CategoryItemsUsecase) Delete

func (uc *CategoryItemsUsecase) Delete(ctx context.Context, id int) error

func (*CategoryItemsUsecase) GetAll

func (uc *CategoryItemsUsecase) GetAll(ctx context.Context) ([]Domain, error)

func (*CategoryItemsUsecase) GetById

func (uc *CategoryItemsUsecase) GetById(ctx context.Context, id int) (Domain, error)

func (*CategoryItemsUsecase) Update

func (uc *CategoryItemsUsecase) Update(ctx context.Context, domain Domain, id int) (Domain, error)

type Domain

type Domain struct {
	Id        int
	Name      string
	Svg       string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Repository

type Repository interface {
	Create(ctx context.Context, domain *Domain) (Domain, error)
	Update(ctx context.Context, domain Domain) (Domain, error)
	GetAll(ctx context.Context) ([]Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
	Delete(ctx context.Context, id int) error
}

type Usecase

type Usecase interface {
	Create(ctx context.Context, domain Domain) (Domain, error)
	Update(ctx context.Context, domain Domain, id int) (Domain, error)
	GetAll(ctx context.Context) ([]Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
	Delete(ctx context.Context, id int) error
}

func NewCategoryUsecase

func NewCategoryUsecase(repo Repository, timeout time.Duration, configJWT middlewares.ConfigJWT) Usecase

Jump to

Keyboard shortcuts

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