Documentation
¶
Index ¶
- func CountQueryFromRequest(opts *QueryAndCountFromRequestCfg) error
- func FindPasswordByUserID(userID string, passwordRecord *PasswordModel) error
- func FindPasswordByUsername(username string, r *PasswordModel) error
- func LoadAllUsers(userList *[]UserModel) error
- func QueryAndCountFromRequest(opts *QueryAndCountFromRequestCfg) error
- func UpdateUserPasswordByUserID(userID string, password string) error
- func UserFindOne(id string, record *UserModel) error
- func UserFindOneByUsername(username string, record *UserModel) error
- func UsersQuery(userList *[]UserModel, limit int) error
- func ValidUsernamePassword(username, password string) (bool, error)
- type AuthTokenModel
- type PasswordModel
- type QueryAndCountFromRequestCfg
- type UserModel
- func (r *UserModel) AddRole(role string) error
- func (r *UserModel) Delete() error
- func (r *UserModel) FillById(id string) error
- func (r *UserModel) GetAcceptTermsString() string
- func (r *UserModel) GetActiveString() string
- func (r *UserModel) GetBiography() string
- func (r *UserModel) GetBirthdate() string
- func (r *UserModel) GetBlockedString() string
- func (r *UserModel) GetCreatedAtString() string
- func (r *UserModel) GetDisplayName() string
- func (r *UserModel) GetEmail() string
- func (r *UserModel) GetFullName() string
- func (r *UserModel) GetGender() string
- func (r *UserModel) GetID() string
- func (r *UserModel) GetLanguage() string
- func (r *UserModel) GetPhone() string
- func (r *UserModel) GetRoles() []string
- func (r *UserModel) GetUpdateAtString() string
- func (r *UserModel) GetUsername() string
- func (r *UserModel) IsActive() bool
- func (r *UserModel) IsBlocked() bool
- func (m *UserModel) LoadData() error
- func (m *UserModel) LoadTeaserData() error
- func (r *UserModel) RemoveRole(role string) error
- func (m *UserModel) Save(ctx *bolo.RequestContext) error
- func (r *UserModel) SetActive(v bool) error
- func (r *UserModel) SetBlocked(blocked bool) error
- func (r *UserModel) SetDisplayName(v string) error
- func (r *UserModel) SetEmail(v string) error
- func (r *UserModel) SetFullName(v string) error
- func (r *UserModel) SetID(id string) error
- func (r *UserModel) SetLanguage(v string) error
- func (m *UserModel) SetPassword(password string) error
- func (r *UserModel) SetRole(roleName string) []string
- func (r *UserModel) SetRoles(v []string) error
- func (r *UserModel) SetUsername(v string) error
- func (UserModel) TableName() string
- func (m *UserModel) ValidPassword(password string) (bool, error)
- type UserModelPublic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountQueryFromRequest ¶
func CountQueryFromRequest(opts *QueryAndCountFromRequestCfg) error
func FindPasswordByUserID ¶
func FindPasswordByUserID(userID string, passwordRecord *PasswordModel) error
func FindPasswordByUsername ¶
func FindPasswordByUsername(username string, r *PasswordModel) error
func LoadAllUsers ¶
func QueryAndCountFromRequest ¶
func QueryAndCountFromRequest(opts *QueryAndCountFromRequestCfg) error
func UserFindOne ¶
FindOne - Find one user record
func UserFindOneByUsername ¶
func UsersQuery ¶
func ValidUsernamePassword ¶
Types ¶
type AuthTokenModel ¶
type AuthTokenModel struct {
ID uint64 `gorm:"primary_key;column:id;" json:"id" filter:"param:id;type:number"`
UserID *string `gorm:"index:userId;column:userId;type:int(11)" json:"userId" filter:"param:userId;type:number"`
ProviderUserID int64 `gorm:"column:providerUserId;type:BIGINT" json:"providerUserId" filter:"param:providerUserId;type:string"`
TokenProviderID string `gorm:"column:tokenProviderId;type:VARCHAR(255)" json:"tokenProviderId" filter:"param:tokenProviderId;type:string"`
TokenType string `gorm:"column:tokenType;type:VARCHAR(255)" json:"tokenType" filter:"param:tokenType;type:string"`
Token string `gorm:"column:token;type:VARCHAR(255)" json:"token" filter:"param:token;type:string"`
IsValid bool `gorm:"column:isValid" json:"isValid" filter:"param:isValid;type:bool"`
RedirectURL string `gorm:"column:redirectUrl;type:TEXT" json:"redirectUrl" filter:"param:redirectUrl;type:string"`
CreatedAt time.Time `gorm:"column:createdAt;" json:"createdAt" filter:"param:createdAt"`
UpdatedAt time.Time `gorm:"column:updatedAt;" json:"updatedAt" filter:"param:updatedAt"`
}
func CreateAuthToken ¶
func CreateAuthToken(userID, tokenType string) (*AuthTokenModel, error)
func FindInvalidOldUserTokens ¶
func FindInvalidOldUserTokens(uid string) ([]*AuthTokenModel, error)
func FindOneAuthToken ¶
func FindOneAuthToken(id string) (*AuthTokenModel, error)
func ValidAuthToken ¶
func ValidAuthToken(userID string, token string) (bool, *AuthTokenModel, error)
func (*AuthTokenModel) Delete ¶
func (r *AuthTokenModel) Delete() error
func (*AuthTokenModel) GetResetUrl ¶
func (r *AuthTokenModel) GetResetUrl(ctx *bolo.RequestContext, resetPrefixName string, resetPrefixNames map[string]string) string
func (*AuthTokenModel) Save ¶
func (r *AuthTokenModel) Save() error
func (*AuthTokenModel) TableName ¶
func (r *AuthTokenModel) TableName() string
type PasswordModel ¶
type PasswordModel struct {
ID uint64 `gorm:"primary_key;column:id;" json:"id"`
UserID *int64 `gorm:"column:userId;type:bigint(20)" json:"userId"`
Password string `gorm:"column:password;type:text" json:"password"`
CreatedAt time.Time `gorm:"column:createdAt;type:datetime;not null" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updatedAt;type:datetime;not null" json:"updatedAt"`
}
func (*PasswordModel) Save ¶
func (r *PasswordModel) Save() error
func (*PasswordModel) SetPassword ¶
func (r *PasswordModel) SetPassword(password string) error
Generate hash from password and set if in .Password attr @param password string raw password to be hashed
func (*PasswordModel) TableName ¶
func (r *PasswordModel) TableName() string
type UserModel ¶
type UserModel struct {
ID uint64 `gorm:"primary_key;column:id;" json:"id" filter:"param:id;type:number"`
Username string `gorm:"unique;column:username;" json:"username" filter:"param:username;type:string"`
Email string `gorm:"unique;column:email;" json:"email" filter:"param:email;type:string"`
DisplayName string `gorm:"column:displayName;" json:"displayName" filter:"param:displayName;type:string"`
FullName string `gorm:"column:fullName;" json:"fullName" filter:"param:fullName;type:string"`
Biography string `gorm:"column:biography;type:TEXT;" json:"biography" filter:"param:biography;type:string"`
Gender string `gorm:"column:gender;" json:"gender" filter:"param:gender;type:string"`
Active bool `gorm:"column:active;" json:"active"`
Blocked bool `gorm:"column:blocked;" json:"blocked" filter:"param:blocked;type:bool"`
Language string `gorm:"column:language;" json:"language" filter:"param:language;type:string"`
ConfirmEmail string `gorm:"column:confirmEmail;" json:"confirmEmail"`
AcceptTerms bool `gorm:"column:acceptTerms;" json:"acceptTerms"`
Birthdate string `gorm:"column:birthdate;" json:"birthdate" filter:"param:birthdate;type:date"`
Phone string `gorm:"column:phone;" json:"phone" filter:"param:phone;type:string"`
Roles []string `gorm:"-" json:"roles"`
RolesText string `gorm:"column:roles;" json:"-"`
CreatedAt time.Time `gorm:"column:createdAt;autoCreateTime:false;" json:"createdAt" filter:"param:createdAt;type:date"`
UpdatedAt time.Time `gorm:"column:updatedAt;autoupdatetime:false;default:null;" json:"updatedAt" filter:"param:updatedAt;type:date"`
}
func (*UserModel) GetAcceptTermsString ¶
func (*UserModel) GetActiveString ¶
func (*UserModel) GetBiography ¶
func (*UserModel) GetBirthdate ¶
func (*UserModel) GetBlockedString ¶
func (*UserModel) GetCreatedAtString ¶
func (*UserModel) GetDisplayName ¶
func (*UserModel) GetFullName ¶
func (*UserModel) GetLanguage ¶
func (*UserModel) GetUpdateAtString ¶
func (*UserModel) GetUsername ¶
func (*UserModel) LoadTeaserData ¶
func (*UserModel) RemoveRole ¶
func (*UserModel) SetBlocked ¶
func (*UserModel) SetDisplayName ¶
func (*UserModel) SetFullName ¶
func (*UserModel) SetLanguage ¶
func (*UserModel) SetPassword ¶
func (*UserModel) SetUsername ¶
type UserModelPublic ¶
type UserModelPublic struct {
ID uint64 `gorm:"primary_key;column:id;" json:"id" filter:"param:id;type:number"`
Username string `gorm:"unique;column:username;" json:"username" filter:"param:username;type:string"`
DisplayName string `gorm:"column:displayName;" json:"displayName" filter:"param:displayName;type:string"`
Language string `gorm:"column:language;" json:"language" filter:"param:language;type:string"`
CreatedAt time.Time `gorm:"column:createdAt;" json:"createdAt" filter:"param:createdAt;type:date"`
UpdatedAt time.Time `gorm:"column:updatedAt;" json:"updatedAt" filter:"param:updatedAt;type:date"`
}
func NewUserModelPublicFromUserModel ¶
func NewUserModelPublicFromUserModel(userRecord *UserModel) *UserModelPublic
func (*UserModelPublic) GetID ¶
func (r *UserModelPublic) GetID() string
func (*UserModelPublic) TableName ¶
func (m *UserModelPublic) TableName() string
TableName get sql table name
Click to show internal directories.
Click to hide internal directories.