Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DBConfig DBConfig
JWTConfig JWTConfig
PasswordConfig PasswordConfig
}
type DBConfig ¶
type DBConfig struct {
MaxOpenConns int
MaxIdleConns int
// contains filtered or unexported fields
}
func (*DBConfig) GetPsqlConn ¶
GetPsqlConn get postgresql formatted connection string from configuration
type Message ¶
type PasswordConfig ¶
type User ¶
type User struct {
gorm.Model
Username string `gorm:"unique"`
PasswordKey []byte
Messages []Message `gorm:"foreignKey:OwnerID"`
}
func (*User) CheckPassword ¶
func (u *User) CheckPassword(passwordConfig *PasswordConfig, password []byte) error
CheckPassword compare not hashed password to password key
func (*User) GenerateJWT ¶
GenerateJWT generate jwt from user
func (*User) SetPassword ¶
func (u *User) SetPassword(passwordConfig *PasswordConfig, password []byte) error
SetPassword set password key to hashed password
Click to show internal directories.
Click to hide internal directories.