GetUserByEmail retrieves user from datastore by its email
(email string)
| 25 | |
| 26 | // GetUserByEmail retrieves user from datastore by its email |
| 27 | func (db *sqlstore) GetUserByEmail(email string) (*models.User, error) { |
| 28 | u := &models.User{} |
| 29 | query := db.Rebind("SELECT * FROM users WHERE email = ? LIMIT 1") |
| 30 | err := db.Get(u, query, email) |
| 31 | return u, mapError(err) |
| 32 | } |
| 33 | |
| 34 | // SaveUser inserts the user model in the connected database |
| 35 | func (db *sqlstore) SaveUser(u *models.User) error { |
nothing calls this directly
no test coverage detected