repository

package
v0.0.0-...-ded0ebf Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateUser = dao.ErrDuplicateEmail
	ErrUserNotFound  = dao.ErrRecordNotFound
)

Functions

This section is empty.

Types

type CachedUserRepository

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

func (*CachedUserRepository) Create

func (repo *CachedUserRepository) Create(ctx context.Context, u domain.User) error

func (*CachedUserRepository) FindByEmail

func (repo *CachedUserRepository) FindByEmail(ctx context.Context, email string) (domain.User, error)

func (*CachedUserRepository) FindById

func (repo *CachedUserRepository) FindById(ctx context.Context, uid int64) (domain.User, error)

func (*CachedUserRepository) FindByPhone

func (repo *CachedUserRepository) FindByPhone(ctx context.Context, phone string) (domain.User, error)

func (*CachedUserRepository) UpdateNonZeroFields

func (repo *CachedUserRepository) UpdateNonZeroFields(ctx context.Context,
	user domain.User) error

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, u domain.User) error
	FindByEmail(ctx context.Context, email string) (domain.User, error)
	UpdateNonZeroFields(ctx context.Context, user domain.User) error
	FindByPhone(ctx context.Context, phone string) (domain.User, error)
	FindById(ctx context.Context, uid int64) (domain.User, error)
}

func NewCachedUserRepository

func NewCachedUserRepository(dao dao.UserDAO,
	c cache.UserCache) UserRepository

NewCachedUserRepository todo 缓存模式

Directories

Path Synopsis
mocks
Package cachemocks is a generated GoMock package.
Package cachemocks is a generated GoMock package.
dao
mocks
Package daomocks is a generated GoMock package.
Package daomocks is a generated GoMock package.
Package repomocks is a generated GoMock package.
Package repomocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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