Documentation ¶
Index ¶
- type CodeRepo
- func (r *CodeRepo) Create(code *models.Code) error
- func (r *CodeRepo) Delete(code *models.Code) error
- func (r *CodeRepo) ExtendExpiration(code *models.Code) error
- func (r *CodeRepo) FindAll() (*[]models.Code, error)
- func (r *CodeRepo) FindByID(ID int) (*models.Code, error)
- func (r *CodeRepo) GetByCode(Code int) (*models.Code, error)
- func (r *CodeRepo) GetLastIsActiveCode(UserID int, Action string) (*models.Code, error)
- func (r *CodeRepo) NewCode(User models.User, Action string, Data string) (*models.Code, error)
- func (r *CodeRepo) Update(code *models.Code) error
- func (r *CodeRepo) UpdateWithAssociations(code *models.Code) error
- type UserRepo
- func (r *UserRepo) Create(user *models.User) error
- func (r *UserRepo) Delete(user *models.User) error
- func (r *UserRepo) FindAll() (*[]models.User, error)
- func (r *UserRepo) FindByEmail(Email string) (*models.User, error)
- func (r *UserRepo) FindByGoogleID(GoogleID string) (*models.User, error)
- func (r *UserRepo) FindByID(ID int) (*models.User, error)
- func (r *UserRepo) PasswordMatches(user *models.User, plainText string) (bool, error)
- func (r *UserRepo) ResetPassword(user *models.User, password string) error
- func (r *UserRepo) Update(user *models.User) error
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 (*CodeRepo) GetLastIsActiveCode ¶
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func NewUserRepo ¶
func (*UserRepo) FindByGoogleID ¶
func (*UserRepo) PasswordMatches ¶
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 ¶
ResetPassword is the method we will use to change a user's password.
Click to show internal directories.
Click to hide internal directories.