biz

package
v0.0.0-...-52a3571 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 8 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

func NewEntDriver

func NewEntDriver(db *sql.DB) *entsql.Driver

Types

type Auth

type Auth struct {
	Hello string
}

Auth is an Auth model.

type AuthRepo

type AuthRepo interface {
	Save(context.Context, *Auth) (*Auth, error)
	Update(context.Context, *Auth) (*Auth, error)
	FindByID(context.Context, int64) (*Auth, error)
	ListByHello(context.Context, string) ([]*Auth, error)
	ListAll(context.Context) ([]*Auth, error)
}

AuthRepo is an Auth repo.

type AuthUsecase

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

AuthUsecase is an Auth usecase.

func NewAuthUsecase

func NewAuthUsecase(repo AuthRepo, logger log.Logger) *AuthUsecase

NewAuthUsecase new an Auth usecase.

func (*AuthUsecase) CreateAuth

func (uc *AuthUsecase) CreateAuth(ctx context.Context, a *Auth) (*Auth, error)

CreateAuth creates an Auth, and returns the new Auth.

func (*AuthUsecase) GetRole

func (uc *AuthUsecase) GetRole(ctx context.Context, role string) (string, error)

type Greeter

type Greeter struct {
	Hello string
}

Greeter is a Greeter model.

type GreeterRepo

type GreeterRepo interface {
	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)
}

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