Documentation ¶
Index ¶
- Constants
- type MongoAdapter
- func (m MongoAdapter) BeginTx() *gorm.DB
- func (m MongoAdapter) ById(ctx context.Context, id int64) (*models.UserDBModel, error)
- func (m MongoAdapter) ByLogin(ctx context.Context, user *models.SignInUserRequest) (*models.UserDBModel, error)
- func (m MongoAdapter) ChangePassword(ctx context.Context, userid int64, password string) error
- func (m MongoAdapter) ConfirmVerify(ctx context.Context, vCode string) error
- func (m MongoAdapter) FindOne(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
- func (m MongoAdapter) FindUserByID(uid int64) (*models.UserDBModel, error)
- func (m MongoAdapter) GetConnection() *gorm.DB
- func (m MongoAdapter) Load(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
- func (m MongoAdapter) Save(ctx context.Context, user *models.UserDBModel) error
- func (m MongoAdapter) SingUp(user *models.UserDBModel) error
- func (m MongoAdapter) Update(ctx context.Context, user *models.UserDBModel) error
- func (m MongoAdapter) UpdateLastLogin(ctx context.Context, u *models.UserDBModel) (*models.UserDBModel, error)
- type Redis
- type UserAdapter
- func (r *UserAdapter) BeginTx() *gorm.DB
- func (r *UserAdapter) ById(_ context.Context, id int64) (*models.UserDBModel, error)
- func (r *UserAdapter) ByLogin(_ context.Context, user *models.SignInUserRequest) (*models.UserDBModel, error)
- func (r *UserAdapter) ChangePassword(ctx context.Context, userid int64, password string) error
- func (r *UserAdapter) ConfirmVerify(ctx context.Context, vCode string) error
- func (r *UserAdapter) FindOne(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
- func (r *UserAdapter) FindUserByID(uid int64) (*models.UserDBModel, error)
- func (r *UserAdapter) GetConnection() *gorm.DB
- func (r *UserAdapter) Load(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
- func (r *UserAdapter) Save(ctx context.Context, user *models.UserDBModel) error
- func (r *UserAdapter) SingUp(user *models.UserDBModel) error
- func (r *UserAdapter) Update(ctx context.Context, user *models.UserDBModel) error
- func (r *UserAdapter) UpdateLastLogin(ctx context.Context, u *models.UserDBModel) (*models.UserDBModel, error)
- type UserRepository
Constants ¶
View Source
const ( MySQL string = "mysql" MongoDB string = "mongo" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoAdapter ¶
func (MongoAdapter) BeginTx ¶
func (m MongoAdapter) BeginTx() *gorm.DB
func (MongoAdapter) ById ¶
func (m MongoAdapter) ById(ctx context.Context, id int64) (*models.UserDBModel, error)
func (MongoAdapter) ByLogin ¶
func (m MongoAdapter) ByLogin(ctx context.Context, user *models.SignInUserRequest) (*models.UserDBModel, error)
func (MongoAdapter) ChangePassword ¶
func (MongoAdapter) ConfirmVerify ¶
func (m MongoAdapter) ConfirmVerify(ctx context.Context, vCode string) error
func (MongoAdapter) FindOne ¶
func (m MongoAdapter) FindOne(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
func (MongoAdapter) FindUserByID ¶
func (m MongoAdapter) FindUserByID(uid int64) (*models.UserDBModel, error)
func (MongoAdapter) GetConnection ¶
func (m MongoAdapter) GetConnection() *gorm.DB
func (MongoAdapter) Load ¶
func (m MongoAdapter) Load(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
func (MongoAdapter) Save ¶
func (m MongoAdapter) Save(ctx context.Context, user *models.UserDBModel) error
func (MongoAdapter) SingUp ¶
func (m MongoAdapter) SingUp(user *models.UserDBModel) error
func (MongoAdapter) Update ¶
func (m MongoAdapter) Update(ctx context.Context, user *models.UserDBModel) error
func (MongoAdapter) UpdateLastLogin ¶
func (m MongoAdapter) UpdateLastLogin(ctx context.Context, u *models.UserDBModel) (*models.UserDBModel, error)
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func NewRedisRepository ¶
type UserAdapter ¶
func (*UserAdapter) BeginTx ¶
func (r *UserAdapter) BeginTx() *gorm.DB
func (*UserAdapter) ById ¶
func (r *UserAdapter) ById(_ context.Context, id int64) (*models.UserDBModel, error)
func (*UserAdapter) ByLogin ¶
func (r *UserAdapter) ByLogin(_ context.Context, user *models.SignInUserRequest) (*models.UserDBModel, error)
func (*UserAdapter) ChangePassword ¶
func (*UserAdapter) ConfirmVerify ¶
func (r *UserAdapter) ConfirmVerify(ctx context.Context, vCode string) error
func (*UserAdapter) FindOne ¶
func (r *UserAdapter) FindOne(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
func (*UserAdapter) FindUserByID ¶
func (r *UserAdapter) FindUserByID(uid int64) (*models.UserDBModel, error)
func (*UserAdapter) GetConnection ¶
func (r *UserAdapter) GetConnection() *gorm.DB
func (*UserAdapter) Load ¶
func (r *UserAdapter) Load(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error)
func (*UserAdapter) Save ¶
func (r *UserAdapter) Save(ctx context.Context, user *models.UserDBModel) error
func (*UserAdapter) SingUp ¶
func (r *UserAdapter) SingUp(user *models.UserDBModel) error
func (*UserAdapter) Update ¶
func (r *UserAdapter) Update(ctx context.Context, user *models.UserDBModel) error
func (*UserAdapter) UpdateLastLogin ¶
func (r *UserAdapter) UpdateLastLogin(ctx context.Context, u *models.UserDBModel) (*models.UserDBModel, error)
type UserRepository ¶
type UserRepository interface { FindOne(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error) Save(ctx context.Context, user *models.UserDBModel) error Update(ctx context.Context, user *models.UserDBModel) error SingUp(user *models.UserDBModel) error Load(ctx context.Context, user *models.UserDBModel) (*models.UserDBModel, error) ById(ctx context.Context, id int64) (*models.UserDBModel, error) ByLogin(ctx context.Context, user *models.SignInUserRequest) (*models.UserDBModel, error) ConfirmVerify(ctx context.Context, vCode string) error UpdateLastLogin(ctx context.Context, u *models.UserDBModel) (*models.UserDBModel, error) FindUserByID(uid int64) (*models.UserDBModel, error) ChangePassword(ctx context.Context, userid int64, password string) error BeginTx() *gorm.DB GetConnection() *gorm.DB }
func NewUserAdapter ¶
func NewUserAdapter(db *gorm.DB) UserRepository
func NewUserRepository ¶
Click to show internal directories.
Click to hide internal directories.