data

package
v0.0.0-...-f0a7105 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 20 Imported by: 0

README

data

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewEntClient

func NewEntClient(cfg *conf.Bootstrap, logger log.Logger) *entgo.Client[*ent.Client]

NewEntClient Create Ent ORM database client

func NewRedisClient

func NewRedisClient(cfg *conf.Bootstrap, _ log.Logger) *redis.Client

NewRedisClient create redis client

Types

type Data

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

Data .

func NewData

func NewData(entClient *entgo.Client[*ent.Client], redisClient *redis.Client, logger log.Logger) (*Data, func(), error)

NewData .

type UserRepo

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

func NewUserRepo

func NewUserRepo(data *Data, logger log.Logger) *UserRepo

func (*UserRepo) Count

func (r *UserRepo) Count(ctx context.Context, whereCond []func(s *sql.Selector)) (int, error)

func (*UserRepo) Create

func (r *UserRepo) Create(ctx context.Context, req *userv1.CreateUserRequest) (*userv1.User, error)

func (*UserRepo) Delete

func (r *UserRepo) Delete(ctx context.Context, req *userv1.DeleteUserRequest) (bool, error)

func (*UserRepo) Get

func (r *UserRepo) Get(ctx context.Context, req *userv1.GetUserRequest) (*userv1.User, error)

func (*UserRepo) GetUserByUserName

func (r *UserRepo) GetUserByUserName(ctx context.Context, userName string) (*userv1.User, error)

func (*UserRepo) List

func (*UserRepo) Update

func (r *UserRepo) Update(ctx context.Context, req *userv1.UpdateUserRequest) (*userv1.User, error)

func (*UserRepo) VerifyPassword

func (r *UserRepo) VerifyPassword(ctx context.Context, req *userv1.VerifyPasswordRequest) (bool, error)

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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