30 lines
337 B
Go
30 lines
337 B
Go
package users
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type UserID int
|
|
|
|
func (u *UserID) Int32Ptr() *int32 {
|
|
if u == nil {
|
|
return nil
|
|
}
|
|
|
|
i := int32(*u)
|
|
|
|
return &i
|
|
}
|
|
|
|
func (u UserID) Int() int {
|
|
return int(u)
|
|
}
|
|
|
|
type User struct {
|
|
ID UserID
|
|
Username string
|
|
Password string
|
|
Email string
|
|
IsAdmin bool
|
|
Prefs json.RawMessage
|
|
}
|