Documentation
¶
Index ¶
- Variables
- type CachedUserRepository
- func (repo *CachedUserRepository) Create(ctx context.Context, u domain.User) error
- func (repo *CachedUserRepository) FindByEmail(ctx context.Context, email string) (domain.User, error)
- func (repo *CachedUserRepository) FindById(ctx context.Context, uid int64) (domain.User, error)
- func (repo *CachedUserRepository) FindByPhone(ctx context.Context, phone string) (domain.User, error)
- func (repo *CachedUserRepository) UpdateNonZeroFields(ctx context.Context, user domain.User) error
- type UserRepository
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) FindByEmail ¶
func (*CachedUserRepository) FindByPhone ¶
func (*CachedUserRepository) UpdateNonZeroFields ¶
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. |
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. |
Click to show internal directories.
Click to hide internal directories.