Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Instance *gorm.DB
Instance is a shared, global Gorm instance. Initialize with CreateInstance.
Functions ¶
func ComputeHash ¶
ComputeHash computes a hash for a given password and salt combination.
func CreateInstance ¶
CreateInstance creates a global Gorm instance.
Types ¶
type User ¶
type User struct { gorm.Model Username string `gorm:"unique;index"` HashedPassword []byte PasswordSalt []byte }
User represents a single Okra user.
func (*User) ChangePassword ¶
ChangePassword changes a user's password.
func (*User) CheckPassword ¶
CheckPassword checks a provided password against the stored password for a given user.
Click to show internal directories.
Click to hide internal directories.