Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PasswordHash ¶
PasswordHash hashes a plaintext string and returns an argon2 hash byte slice
func RandomString ¶
RandomString returns a securely generated random string
Types ¶
type User ¶
type User struct {
ID primitive.ObjectID `json:"-" bson:"_id,omitempty"`
Email string `json:"email" validate:"required,email"`
Password string `json:"password" bson:"-" validate:"required,gte=10"`
APIKey string `json:"-"`
Enabled bool `json:"-"`
Roles []string `json:"-" bson:"roles,omitempty"`
Hash []byte `json:"-"`
}
User stores a user account
Click to show internal directories.
Click to hide internal directories.