biz

package
v0.0.0-...-04dd80b Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 5 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotFound is user not found.
	ErrUserNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found")
)

ProviderSet is biz providers.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID      int64
	Content string
	Title   string
}

type ArticleRepo

type ArticleRepo interface {
	CreateArticle(context.Context, *Article) (*Article, error)
	UpdateArticle(context.Context, *Article) (*Article, error)
	DeleteArticle(context.Context, int64) (bool, error)
	GetArticle(context.Context) ([]*Article, error)
	ListById(context.Context, int64) (*Article, error)
}

type ArticleUseCase

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

ArticleUseCase case.

func NewArticleUsecase

func NewArticleUsecase(poll ArticleRepo, logger log.Logger) *ArticleUseCase

func (*ArticleUseCase) CreateArticle

func (a *ArticleUseCase) CreateArticle(ctx context.Context, g Article) (*Article, error)

func (*ArticleUseCase) DeleteArticle

func (a *ArticleUseCase) DeleteArticle(ctx context.Context, g Article) (bool, error)

func (*ArticleUseCase) GetArticle

func (a *ArticleUseCase) GetArticle(ctx context.Context, g Article) ([]*Article, error)

func (*ArticleUseCase) ListArticleById

func (a *ArticleUseCase) ListArticleById(ctx context.Context, g Article) (*Article, error)

func (*ArticleUseCase) UpdateArticle

func (a *ArticleUseCase) UpdateArticle(ctx context.Context, g Article) (*Article, error)

type Greeter

type Greeter struct {
	Hello string
	Id    int64
}

Greeter is a Greeter model.

type GreeterRepo

type GreeterRepo interface {

	//db
	Save(context.Context, *Greeter) (*Greeter, error)
	Update(context.Context, *Greeter) (*Greeter, error)
	FindByID(context.Context, int64) (*Greeter, error)
	ListByHello(context.Context, string) ([]*Greeter, error)
	ListAll(context.Context) ([]*Greeter, error)

	//redis
	GetHelloLike(context.Context, string) (int64, error)
}

GreeterRepo is a Greater repo.

type GreeterUsecase

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

GreeterUsecase is a Greeter usecase.

func NewGreeterUsecase

func NewGreeterUsecase(repo GreeterRepo, logger log.Logger) *GreeterUsecase

NewGreeterUsecase new a Greeter usecase.

func (*GreeterUsecase) CreateGreeter

func (uc *GreeterUsecase) CreateGreeter(ctx context.Context, g *Greeter) (*Greeter, error)

CreateGreeter creates a Greeter, and returns the new Greeter.

Jump to

Keyboard shortcuts

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