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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeSendTooMany        = cache.ErrCodeSendTooMany
	ErrCodeVerifyTooManyTimes = cache.ErrCodeVerifyTooManyTimes
)
View Source
var (
	ErrUserDuplicateEmail = dao.ErrUserDuplicateEmail
	ErrUserNotFound       = dao.ErrUserNotFound
	ErrUserDuplicate      = dao.ErrUserDuplicate
)

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)

func (*CachedUserRepository) FindProfileByEmail

func (r *CachedUserRepository) FindProfileByEmail(ctx context.Context, email string) (domain.Profile, error)

func (*CachedUserRepository) UpdateProfile

func (r *CachedUserRepository) UpdateProfile(ctx context.Context, profile domain.Profile) 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 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)
	UpdateProfile(ctx context.Context, profile domain.Profile) error
	FindProfileByEmail(ctx context.Context, email string) (domain.Profile, error)
}

func NewUserRepository

func NewUserRepository(userDao dao.UserDAO, profileDao dao.ProfileDAO, userProfile dao.UserWithProfileDAO, c cache.UserCache) UserRepository

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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