Documentation ¶
Index ¶
- Variables
- type CachedCodeRepository
- type CachedUserRepository
- func (ur *CachedUserRepository) Create(ctx context.Context, user domain.User) error
- func (ur *CachedUserRepository) FindByEmail(ctx context.Context, email string) (domain.User, error)
- func (ur *CachedUserRepository) FindById(ctx context.Context, id int64) (domain.User, error)
- func (ur *CachedUserRepository) FindByIdV1(ctx context.Context, id int64) (domain.User, error)
- func (ur *CachedUserRepository) FindByPhone(ctx context.Context, phone string) (domain.User, error)
- type CodeRepository
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCodeVerifyTooManyTimes = cache.ErrCodeVerifyTooManyTimes ErrCodeSendTooMany = cache.ErrCodeSendTooMany )
复用 cache 包中的错误
View Source
var ( ErrUserDuplicateUser = dao.ErrUserDuplicate ErrUserNotFound = dao.ErrDataNotFound )
Functions ¶
This section is empty.
Types ¶
type CachedCodeRepository ¶
type CachedCodeRepository struct {
// contains filtered or unexported fields
}
type CachedUserRepository ¶
type CachedUserRepository struct {
// contains filtered or unexported fields
}
func (*CachedUserRepository) FindByEmail ¶
func (*CachedUserRepository) FindByIdV1 ¶
func (*CachedUserRepository) FindByPhone ¶
type CodeRepository ¶
type CodeRepository interface { Store(ctx context.Context, biz, phone, code string) error Verify(ctx context.Context, biz, phone, inputCode string) (bool, error) }
func NewCodeRepository ¶
func NewCodeRepository(cache cache.CodeCache) CodeRepository
type UserRepository ¶
type UserRepository interface { Create(ctx context.Context, user domain.User) error FindById(ctx context.Context, id int64) (domain.User, error) FindByEmail(ctx context.Context, email string) (domain.User, error) FindByPhone(ctx context.Context, phone string) (domain.User, error) }
func NewUserRepository ¶
func NewUserRepository(dao dao.UserDAO, cache cache.UserCache) UserRepository
Directories ¶
Path | Synopsis |
---|---|
mocks
Package cachemocks is a generated GoMock package.
|
Package cachemocks is a generated GoMock package. |
redismocks
Package redismocks is a generated GoMock package.
|
Package redismocks 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.