Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPasswordIsEmpty = errors.New("password: is empty") ErrPasswordNotValid = errors.New("password: is not valid") ErrPasswordShort = errors.New("password: is too short, must be at least 8 characters long") ErrPasswordLong = errors.New("password: is too long, must be at most 64 characters long") )
View Source
var ErrOTPNotValid = errors.New("otp: is not valid")
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct { ID int64 `json:"id,omitempty" yaml:"id,omitempty" required:"true"` Avatar string `json:"avatar,omitempty" yaml:"avatar,omitempty" required:"true"` Email string `json:"email,omitempty" yaml:"email,omitempty" required:"true" format:"email"` Username string `json:"username,omitempty" yaml:"username,omitempty" required:"true"` Salt string `json:"_" yaml:"-" hidden:"true"` Password Password `json:"-" yaml:"-" hidden:"true"` OTP OTP `json:"-" yaml:"-" hidden:"true"` IsActive bool `json:"isActive,omitempty" yaml:"isActive,omitempty" required:"false"` Roles []string `json:"roles,omitempty" yaml:"roles,omitempty" required:"true"` Metadata map[string]any `json:"metadata,omitempty" yaml:"metadata,omitempty" required:"false"` Created time.Time `json:"created,omitempty" yaml:"created,omitempty" required:"true"` Updated time.Time `json:"updated,omitempty" yaml:"updated,omitempty" required:"true"` }
func (Admin) ValidateOTP ¶
func (Admin) ValidatePassword ¶
func (Admin) WithRandomSalt ¶
type RefreshToken ¶
type RefreshToken struct { ID int64 `json:"id,omitempty" yaml:"id,omitempty" required:"true"` AdminID int64 `json:"adminID,omitempty" yaml:"adminID,omitempty" required:"true"` Token string `json:"token,omitempty" yaml:"token,omitempty" required:"true"` Metadata map[string]any `json:"metadata,omitempty" yaml:"metadata,omitempty" required:"false"` Created time.Time `json:"created,omitempty" yaml:"created,omitempty" required:"true"` Updated time.Time `json:"updated,omitempty" yaml:"updated,omitempty" required:"true"` Expires time.Time `json:"expires,omitempty" yaml:"expires,omitempty" required:"true"` }
func (RefreshToken) GetID ¶
func (t RefreshToken) GetID() int64
Click to show internal directories.
Click to hide internal directories.