Documentation ¶
Index ¶
- Variables
- type Auth
- type User
- func (u *User) AddRole(ctx context.Context, role *role.Role) error
- func (u *User) Get(ctx context.Context) error
- func (u *User) GetRoles(ctx context.Context) error
- func (u *User) GetRolesStrings() []string
- func (u *User) RemoveRole(ctx context.Context, role *role.Role) error
- func (u *User) Save(ctx context.Context) error
- func (u *User) TableName() string
- type UserProfile
- type UserRole
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMsgNameAreadyExist = "username already exists"
)
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { ID string // UUID DeviceToken string `gorm:"-"` // UUID Username string Password string Token string `gorm:"-"` }
func (*Auth) QuickSignin ¶
QuickSignin quick signin without password Require: DeviceToken, Token
type User ¶
type User struct { ID string // ID is the primary key Username string Email string Profiles []*UserProfile `json:",omitempty" gorm:"-"` Roles []*role.Role `gorm:"many2many:authv1.user_role;"` }
User is the user model
func (*User) GetRolesStrings ¶
type UserProfile ¶
type UserProfile struct {
PhoneNo string
}
Click to show internal directories.
Click to hide internal directories.