gogmagog/models/user.go
Deepak 3ea8603368
All checks were successful
gitea-deepak/gogmagog/pipeline/head This commit looks good
Adds user table and adds support for config flag to drop DB on restart
2021-01-11 20:15:36 -06:00

22 lines
618 B
Go

package models
// User represents the full DB user field, for inserts and compares.
// No reason to return the hashed pw on the route though.
type User struct {
UserID int64 `json:"user_id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
Password []byte `json:"password"`
}
// User returns a single plan from the store by plan_id.
func (m *Model) User(id int) (*User, error) {
user, err := m.SelectUserByID(id)
return user, wrapNotFound(err)
}
// AddUser inserts a user into the store.
// func (m *Model) AddUser(u *User) (int, error) {
// return m.InsertUser(u)
// }