Documentation
¶
Index ¶
- type UserBase
- func (u *UserBase) CreatorUserID() uint64
- func (u *UserBase) GetApprove() pkgModels.ApproveStatus
- func (u *UserBase) GetCreatedAt() time.Time
- func (u *UserBase) GetID() uint64
- func (u *UserBase) GetUpdatedAt() time.Time
- func (u *UserBase) IsAnonymous() bool
- func (u *UserBase) IsNil() bool
- func (u *UserBase) RBACResourceName() string
- func (u *UserBase) SetApprove(status pkgModels.ApproveStatus)
- func (u *UserBase) SetCreatedAt(t time.Time)
- func (u *UserBase) SetID(id uint64)
- func (u *UserBase) SetUpdatedAt(t time.Time)
- func (u *UserBase) TableName() string
- type UserEmail
- type UserPassword
- type UserPasswordReset
- type UserUsername
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserBase ¶ added in v0.5.0
type UserBase struct {
ID uint64 `json:"id" gorm:"primaryKey"`
Approve pkgModels.ApproveStatus `gorm:"column:approve_status" db:"approve_status" json:"approve_status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"deleted_at"`
}
UserBase is the minimal embeddable user identity (Member anchor).
func (*UserBase) CreatorUserID ¶ added in v0.5.0
CreatorUserID returns the user id for ACL ownership checks.
func (*UserBase) GetApprove ¶ added in v0.5.0
func (u *UserBase) GetApprove() pkgModels.ApproveStatus
GetApprove returns approval status.
func (*UserBase) GetCreatedAt ¶ added in v0.5.0
GetCreatedAt returns created timestamp.
func (*UserBase) GetUpdatedAt ¶ added in v0.5.0
GetUpdatedAt returns updated timestamp.
func (*UserBase) IsAnonymous ¶ added in v0.5.0
IsAnonymous reports whether this is an anonymous user.
func (*UserBase) RBACResourceName ¶ added in v0.5.0
RBACResourceName returns the default RBAC resource name (override on consumer type).
func (*UserBase) SetApprove ¶ added in v0.5.0
func (u *UserBase) SetApprove(status pkgModels.ApproveStatus)
SetApprove sets approval status.
func (*UserBase) SetCreatedAt ¶ added in v0.5.0
SetCreatedAt sets created timestamp.
func (*UserBase) SetUpdatedAt ¶ added in v0.5.0
SetUpdatedAt sets updated timestamp.
type UserEmail ¶ added in v0.5.0
type UserEmail struct {
Email string `json:"email" gorm:"column:email;not null;default:'';"`
}
UserEmail optional trait: email identity.
func (*UserEmail) EmailColumn ¶ added in v0.5.0
EmailColumn returns the database column name.
type UserPassword ¶ added in v0.5.0
type UserPassword struct {
Password string `json:"password" gorm:"column:password;not null;default:'';"`
MustResetPassword bool `json:"required_password_reset" gorm:"column:required_password_reset;not null;default:false"`
}
UserPassword optional trait: password authentication.
func (*UserPassword) GetPasswordHash ¶ added in v0.5.0
func (u *UserPassword) GetPasswordHash() string
GetPasswordHash returns the stored password hash.
func (*UserPassword) PasswordColumn ¶ added in v0.5.0
func (u *UserPassword) PasswordColumn() string
PasswordColumn returns the database column name.
func (*UserPassword) RequiredPasswordReset ¶ added in v0.5.0
func (u *UserPassword) RequiredPasswordReset() bool
RequiredPasswordReset reports whether the user must reset password on next login.
func (*UserPassword) SetPasswordHash ¶ added in v0.5.0
func (u *UserPassword) SetPasswordHash(hash string)
SetPasswordHash sets the stored password hash.
type UserPasswordReset ¶
type UserPasswordReset struct {
UserID uint64 `json:"user_id" gorm:"primaryKey"`
Token string `json:"token" gorm:"index:,unique" limit:"128"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
UserPasswordReset direct defenition
func (*UserPasswordReset) TableName ¶
func (u *UserPasswordReset) TableName() string
TableName returns the name in database
type UserUsername ¶ added in v0.5.0
type UserUsername struct {
Username string `json:"username" gorm:"column:username"`
}
UserUsername optional trait: separate username (GraphQL compatibility).
func (*UserUsername) GetUsername ¶ added in v0.5.0
func (u *UserUsername) GetUsername() string
GetUsername returns the username.