Documentation
¶
Index ¶
- type Models
- type User
- func (u *User) Delete() error
- func (u *User) DeleteByID(id int) error
- func (user *User) GetAll() ([]*User, error)
- func (u *User) GetByEmail(email string) (*User, error)
- func (u *User) GetOne(id int) (*User, error)
- func (u *User) Insert(user User) (int, error)
- func (u *User) PasswordMatches(userInput string) (bool, error)
- func (u *User) Update() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID int `json:"id"` Email string `json:"email"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Password string `json:"-"` Active int `json:"active"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Single User
func (*User) DeleteByID ¶
Delete one user from the database, by ID
func (*User) PasswordMatches ¶
Compare a user supplied password with the hash we have stored in the database. If the password and hash match, we return true; otherwise, we return false.
Click to show internal directories.
Click to hide internal directories.