adUC

package
v0.0.0-...-09378e2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdRepo

type AdUC

type AdUC struct {
	// contains filtered or unexported fields
}

func New

func New(db DBXT, repo AdRepo, cache Cache) *AdUC

func (*AdUC) Create

func (uc *AdUC) Create(ctx context.Context, adv *entity.Adv) (*entity.AdvResp, error)

func (*AdUC) Delete

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

func (*AdUC) Get

func (uc *AdUC) Get(ctx context.Context, params usecase.PageParams) (*entity.AdsResp, error)

func (*AdUC) GetWithFilter

func (uc *AdUC) GetWithFilter(ctx context.Context, params usecase.AdvFilterParams) ([]*entity.AdvResp, error)

func (*AdUC) Update

func (uc *AdUC) Update(ctx context.Context, id int, adv *entity.AdvUpdate) (*entity.AdvResp, error)

type Cache

type Cache interface {
	Set(ctx context.Context, key string, value any) error
	Get(ctx context.Context, key string) (string, error)
	Delete(ctx context.Context, prefix string) error
}

type DBXT

type DBXT interface {
	DB() repository.Querier
	InTransaction(ctx context.Context, fn repository.TransactionFunc) error
}

Jump to

Keyboard shortcuts

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