Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UserIDPattern = regexp.MustCompile(`^[a-z][a-z0-9\._\-]{3,}$`)
UserIDPattern general name pattern
Functions ¶
func CreateUserPassword ¶
Types ¶
type Grant ¶
type Grant struct { ID string `gorm:"column:id;primaryKey" json:"id"` UserID string `gorm:"column:user_id;index" json:"user_id"` ServerUser string `gorm:"column:server_user;index" json:"server_user"` ServerID string `gorm:"column:server_id;index" json:"server_id"` CreatedAt time.Time `gorm:"column:created_at;index" json:"created_at"` User User }
type Key ¶
type Key struct { // sha256 of public key ID string `gorm:"column:id;primarykey" json:"id"` DisplayName string `gorm:"column:display_name" json:"display_name"` UserID string `gorm:"column:user_id;index" json:"user_id"` User User CreatedAt time.Time `gorm:"column:created_at;index" json:"created_at"` }
type Token ¶
type Token struct { ID string `gorm:"column:id;primarykey" json:"id"` UserID string `gorm:"column:user_id;not null;index" json:"user_id"` CreatedAt time.Time `gorm:"column:created_at;not null;index" json:"created_at"` VisitedAt time.Time `gorm:"column:visited_at;not null;index" json:"visited_at"` UserAgent string `gorm:"column:user_agent;not null" json:"user_agent"` User User `json:"-"` }
type User ¶
type User struct { ID string `gorm:"column:id;primarykey" json:"id"` PasswordDigest string `gorm:"column:password_digest;not null" json:"-"` CreatedAt time.Time `gorm:"column:created_at;not null;index" json:"created_at"` VisitedAt time.Time `gorm:"column:visited_at;not null;index" json:"visited_at"` IsAdmin bool `gorm:"column:is_admin;not null;default:0;index" json:"is_admin"` IsBlocked bool `gorm:"column:is_blocked;not null;default:0;index" json:"is_blocked"` Keys []Key `json:"keys,omitempty"` Grants []Grant `json:"grants,omitempty"` Tokens []Token `json:"tokens,omitempty"` }
func (*User) CheckPassword ¶
CheckPassword check password
func (*User) SetPassword ¶
SetPassword update password for user bcrypt produces clear text encrypted password, no further encoding needed
Click to show internal directories.
Click to hide internal directories.