repository

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeRepo

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

func NewCodeRepo

func NewCodeRepo(db *gorm.DB) *CodeRepo

func (*CodeRepo) Create

func (r *CodeRepo) Create(code *models.Code) error

func (*CodeRepo) Delete

func (r *CodeRepo) Delete(code *models.Code) error

func (*CodeRepo) ExtendExpiration

func (r *CodeRepo) ExtendExpiration(code *models.Code) error

func (*CodeRepo) FindAll

func (r *CodeRepo) FindAll() (*[]models.Code, error)

func (*CodeRepo) FindByID

func (r *CodeRepo) FindByID(ID int) (*models.Code, error)

func (*CodeRepo) GetByCode

func (r *CodeRepo) GetByCode(Code int) (*models.Code, error)

func (*CodeRepo) GetLastIsActiveCode

func (r *CodeRepo) GetLastIsActiveCode(UserID int, Action string) (*models.Code, error)

func (*CodeRepo) NewCode

func (r *CodeRepo) NewCode(User models.User, Action string, Data string) (*models.Code, error)

NewCode CreateCode generation new code

func (*CodeRepo) Update

func (r *CodeRepo) Update(code *models.Code) error

func (*CodeRepo) UpdateWithAssociations added in v1.0.5

func (r *CodeRepo) UpdateWithAssociations(code *models.Code) error

type UserRepo

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

func NewUserRepo

func NewUserRepo(db *gorm.DB, cache *redis.Client) *UserRepo

func (*UserRepo) Create

func (r *UserRepo) Create(user *models.User) error

func (*UserRepo) Delete

func (r *UserRepo) Delete(user *models.User) error

func (*UserRepo) FindAll

func (r *UserRepo) FindAll() (*[]models.User, error)

func (*UserRepo) FindByEmail

func (r *UserRepo) FindByEmail(Email string) (*models.User, error)

func (*UserRepo) FindByGoogleID

func (r *UserRepo) FindByGoogleID(GoogleID string) (*models.User, error)

func (*UserRepo) FindByID

func (r *UserRepo) FindByID(ID int) (*models.User, error)

func (*UserRepo) PasswordMatches

func (r *UserRepo) PasswordMatches(user *models.User, plainText string) (bool, error)

PasswordMatches uses Go's bcrypt package to compare a user supplied password with the hash we have stored for a given user in the database. If the password and hash match, we return true; otherwise, we return false.

func (*UserRepo) ResetPassword

func (r *UserRepo) ResetPassword(user *models.User, password string) error

ResetPassword is the method we will use to change a user's password.

func (*UserRepo) Update

func (r *UserRepo) Update(user *models.User) error

Jump to

Keyboard shortcuts

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