30 lines
680 B
Go
30 lines
680 B
Go
package storage
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
ErrUserNotFound = errors.New("user not found")
|
|
ErrExistingUser = errors.New("user already exists")
|
|
ErrPasswordIncorrect = errors.New("password incorrect")
|
|
)
|
|
|
|
type User struct {
|
|
ID int64 `json:"id"`
|
|
Username string `json:"username"`
|
|
Email string `json:"email"`
|
|
Password string `json:"-"`
|
|
CreatedAt string `json:"created_at"`
|
|
IsActive bool `json:"is_active"`
|
|
Role Role `json:"role"`
|
|
PersonalGroup int64 `json:"user_group"`
|
|
Groups []int64 `json:"groups"`
|
|
}
|
|
|
|
// type Password struct {
|
|
// text *string
|
|
// hash []byte
|
|
// encoded *string
|
|
// }
|