repository

package
v0.0.0-...-10283fc Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 15 Imported by: 0

README

Repository

数据访问层: 包含数据库、cache、RPC、HTTP请求等

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(model.Init, NewUser)

ProviderSet is repo providers.

Functions

This section is empty.

Types

type UserRepo

type UserRepo interface {
	CreateUser(ctx context.Context, data *model.UserModel) (id int64, err error)
	UpdateUser(ctx context.Context, id int64, data *model.UserModel) error
	GetUser(ctx context.Context, id int64) (ret *model.UserModel, err error)
	GetUserByUsername(ctx context.Context, username string) (ret *model.UserModel, err error)
	GetUserByEmail(ctx context.Context, email string) (ret *model.UserModel, err error)
	GetUserByPhone(ctx context.Context, phone string) (ret *model.UserModel, err error)
	BatchGetUser(ctx context.Context, ids []int64) (ret []*model.UserModel, err error)
}

UserRepo define a repo interface

func NewUser

func NewUser(db *gorm.DB, cache cache.UserCache) UserRepo

NewUser new a repository and return

Jump to

Keyboard shortcuts

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