Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashPassword ¶
HashPassword returns the bcrypt hash of the password
Types ¶
type Opt ¶
type Opt func(*credentialsProvider)
Opt is a function that configures the credentials provider.
type User ¶
type User struct {
// ID is the unique identifier of the user.
ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()"`
// Name is the name of the user.
Name string `gorm:"size:255"`
// Email is the email of the user.
Email string `gorm:"type:varchar(100);unique_index"`
// HashedPassword is the hashed password of the user.
HashedPassword []byte
// Active is true if the user is active.
Active bool
// CreatedAt is the creation time of the user.
CreatedAt time.Time `json:"created_at"`
// UpdatedAt is the update time of the user.
UpdatedAt time.Time `json:"updated_at"`
// DeletedAt is the deletion time of the user.
DeletedAt gorm.DeletedAt `json:"deleted_at"`
}
func (*User) SetNewPassword ¶
SetNewPassword set a new hashsed password to user.
Click to show internal directories.
Click to hide internal directories.