Documentation ¶
Index ¶
- Constants
- Variables
- type CachedCodeRepository
- type CachedUserRepository
- func (r *CachedUserRepository) Create(ctx context.Context, u domain.User) error
- func (r *CachedUserRepository) FindByEmail(ctx context.Context, email string) (domain.User, error)
- func (r *CachedUserRepository) FindById(ctx context.Context, id int64) (domain.User, error)
- func (r *CachedUserRepository) FindByPhone(ctx context.Context, phone string) (domain.User, error)
- type CodeRepository
- type SmsDbRepository
- func (s *SmsDbRepository) GetFirst(ctx context.Context) (domain.Sms, error)
- func (s *SmsDbRepository) SaveSms(ctx context.Context, sms domain.Sms) (domain.Sms, error)
- func (s *SmsDbRepository) UpdateStatusAsProcessFailed(ctx context.Context, id int64) (int64, error)
- func (s *SmsDbRepository) UpdateStatusAsProcessed(ctx context.Context, id int64) (int64, error)
- type SmsRepository
- type UserRepository
Constants ¶
View Source
const Delimiter = dao.Delimiter
Variables ¶
View Source
var ( ErrCodeSendTooMany = cache.ErrCodeSendTooMany ErrCodeVerifyTooManyTimes = cache.ErrCodeVerifyTooManyTimes )
View Source
var ( ErrUserDuplicate = dao.ErrUserDuplicate ErrUserNotFound = dao.ErrUserNotFound )
View Source
var ErrCompetitionFailed = dao.ErrCompetitionFailed
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) FindByPhone ¶
type CodeRepository ¶
type CodeRepository interface { Store(ctx context.Context, biz string, phone string, code string) error Verify(ctx context.Context, biz, phone, inputCode string) (bool, error) }
func NewCodeRepository ¶
func NewCodeRepository(c cache.CodeCache) CodeRepository
type SmsDbRepository ¶
type SmsDbRepository struct {
// contains filtered or unexported fields
}
func (*SmsDbRepository) UpdateStatusAsProcessFailed ¶
func (*SmsDbRepository) UpdateStatusAsProcessed ¶
type SmsRepository ¶
type SmsRepository interface { GetFirst(ctx context.Context) (domain.Sms, error) SaveSms(ctx context.Context, sms domain.Sms) (domain.Sms, error) UpdateStatusAsProcessed(ctx context.Context, id int64) (int64, error) UpdateStatusAsProcessFailed(ctx context.Context, id int64) (int64, error) }
func NewSmsDbRepository ¶
func NewSmsDbRepository(dao dao.SmsDao) SmsRepository
type UserRepository ¶
type UserRepository interface { FindByEmail(ctx context.Context, email string) (domain.User, error) FindByPhone(ctx context.Context, phone string) (domain.User, error) Create(ctx context.Context, u domain.User) error FindById(ctx context.Context, id int64) (domain.User, error) }
func NewUserRepository ¶
func NewUserRepository(dao dao.UserDAO, c cache.UserCache) UserRepository
Click to show internal directories.
Click to hide internal directories.