Documentation ¶
Index ¶
Constants ¶
View Source
const ( VerificationPending = "pending" VerificationSent = "sent" VerificationError = "error" EmailVerified = "verified" // TODO: Should moved to configuration database TokenExpDuration = 24 // hours )
View Source
const (
SessionExpDuration = 1 // hours
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type EmailVerification ¶
type EmailVerification struct { ID uint `gorm:"column:email_verification_id; primaryKey"` Status string `gorm:"size:50; default:pending"` Token string `gorm:"column:verification_token; size:100; unique"` ExpiredAt time.Time `gorm:"column:token_expiration"` BaseModel }
func (*EmailVerification) BeforeCreate ¶
func (e *EmailVerification) BeforeCreate(tx *gorm.DB) (err error)
func (*EmailVerification) BeforeSave ¶
func (e *EmailVerification) BeforeSave(tx *gorm.DB) (err error)
func (EmailVerification) TableName ¶
func (EmailVerification) TableName() string
type ExternalProvider ¶
type HashAlgorithm ¶
type LoginExternal ¶
type LoginExternal struct { ID uint `gorm:"column:user_id; primaryKey"` ProviderID uint `gorm:"column:external_provider_id"` Provider ExternalProvider `gorm:"foreignKey:ProviderID; references:ID"` Token string `gorm:"column:provider_token; size:100"` BaseModel }
type LoginInfo ¶
type LoginInfo struct { ID uint `gorm:"column:user_id; primaryKey"` Username string `gorm:"size:20; unique"` Email string `gorm:"size:100; unique"` PasswordHash string `gorm:"size:250"` PasswordSalt string `gorm:"size:100"` HashAlgorithmID uint HashAlgorithm HashAlgorithm `gorm:"foreignKey:HashAlgorithmID; references:ID"` EmailVerificationID uint EmailVerification EmailVerification `gorm:"foreignKey:EmailVerificationID; references:ID"` PasswordRecoveryID *uint PasswordRecovery PasswordRecovery `gorm:"foreignKey:PasswordRecoveryID; references:ID"` BaseModel }
type PasswordRecovery ¶
type PasswordRecovery struct { ID uint `gorm:"column:password_recovery_id; primaryKey"` Token string `gorm:"column:recovery_token; size:100"` ExpiredAt time.Time `gorm:"column:token_expiration"` BaseModel }
func (PasswordRecovery) TableName ¶
func (PasswordRecovery) TableName() string
type Permission ¶
type Role ¶
type Role struct { ID uint `gorm:"column:role_id; primaryKey"` Name string `gorm:"column:role_name; size:20"` Permissions []Permission `` /* 126-byte string literal not displayed */ BaseModel }
Click to show internal directories.
Click to hide internal directories.