repository

package
v0.0.0-...-d13da26 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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
}

func (*CachedCodeRepository) Store

func (repo *CachedCodeRepository) Store(ctx context.Context, biz string,
	phone string, code string) error

func (*CachedCodeRepository) Verify

func (repo *CachedCodeRepository) Verify(ctx context.Context, biz, phone, inputCode string) (bool, error)

type CachedUserRepository

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

func (*CachedUserRepository) Create

func (*CachedUserRepository) FindByEmail

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

func (*CachedUserRepository) FindById

func (r *CachedUserRepository) FindById(ctx context.Context, id int64) (domain.User, error)

func (*CachedUserRepository) FindByPhone

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

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) GetFirst

func (s *SmsDbRepository) GetFirst(ctx context.Context) (domain.Sms, error)

func (*SmsDbRepository) SaveSms

func (s *SmsDbRepository) SaveSms(ctx context.Context, sms domain.Sms) (domain.Sms, error)

func (*SmsDbRepository) UpdateStatusAsProcessFailed

func (s *SmsDbRepository) UpdateStatusAsProcessFailed(ctx context.Context, id int64) (int64, error)

func (*SmsDbRepository) UpdateStatusAsProcessed

func (s *SmsDbRepository) UpdateStatusAsProcessed(ctx context.Context, id int64) (int64, error)

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

Directories

Path Synopsis
Package repositorymock is a generated GoMock package.
Package repositorymock is a generated GoMock package.

Jump to

Keyboard shortcuts

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