Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHealthcheckRepository ¶
NewHealthcheckRepository returns healthcheckRepository
func NewTempUserRepository ¶
NewUserRepository returns tempUserRepository
func NewUserRepository ¶
NewUserRepository returns userRepository
Types ¶
type HealthcheckRepository ¶
type HealthcheckRepository interface {
PingDB() error
}
HealthcheckRepository represent the healthcheck repository contract
type Repository ¶
type Repository struct { HealthcheckRepository HealthcheckRepository UserRepository UserRepository TempUserRepository TempUserRepository }
Repository manage all repositories
func NewRepository ¶
func NewRepository(db *sqlx.DB) *Repository
NewRepository returns initialized Repository
type TempUserRepository ¶
type TempUserRepository interface { FindByID(ctx context.Context, id uint64) (*model.TempUser, error) FindByPhoneNumber(ctx context.Context, phoneNumber string) (*model.TempUser, error) FindByCodeAndKey(ctx context.Context, authCode string, authKey string) (*model.TempUser, error) Create(ctx context.Context, user *model.TempUser) error Update(ctx context.Context, user *model.TempUser) error UpsertByPhoneNumber(ctx context.Context, user *model.TempUser) (*model.TempUser, error) Destroy(ctx context.Context, user *model.TempUser) error }
TempUserRepository represent the user's repository contract
type UserRepository ¶
type UserRepository interface { FindByID(ctx context.Context, id uint64) (*model.User, error) FindByPhoneNumber(ctx context.Context, phoneNumber string) (*model.User, error) FindByEmail(ctx context.Context, email string) (*model.User, error) Create(ctx context.Context, user *model.User) error Update(ctx context.Context, user *model.User) error UpdateProfile(ctx context.Context, user *model.User, firstName, lastName string, gender model.Gender, dateOfBirth null.Time) error FindSMSReconfirmationByUser(ctx context.Context, user *model.User) (*model.SmsReconfirmation, error) FindSMSReconfirmationByPhoneNumber(ctx context.Context, phoneNumber string) (*model.SmsReconfirmation, error) SaveSMSReconfirmation(ctx context.Context, smsReconfirmation *model.SmsReconfirmation) error DestroySMSReconfirmation(ctx context.Context, smsReconfirmation *model.SmsReconfirmation) error }
UserRepository represent the user's repository contract
Click to show internal directories.
Click to hide internal directories.