Documentation ¶
Index ¶
- func GenerateAnonymousUser() sessionauth.User
- type User
- func (u *User) GetById(id interface{}) error
- func (u User) GetUserById(id int64, db gorm.DB) *User
- func (u User) GetUserByNicknamePwd(nickname string, pwd string, db gorm.DB) *User
- func (u *User) IsAuthenticated() bool
- func (u *User) Login()
- func (u *User) Logout()
- func (u User) TableName() string
- func (u *User) UniqueId() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAnonymousUser ¶
func GenerateAnonymousUser() sessionauth.User
GetAnonymousUser should generate an anonymous user model for all sessions. This should be an unauthenticated 0 value struct.
Types ¶
type User ¶
type User struct { Id int64 Nickname string `form:"nickname"` Password string `form:"password"` Gender int64 Birthday time.Time CreatedAt time.Time `gorm:"column:created_time"` UpdatedAt time.Time `gorm:"column:updated_time"` // contains filtered or unexported fields }
func (*User) GetById ¶
GetById will populate a user object from a database model with a matching id.
func (User) GetUserByNicknamePwd ¶
func (*User) IsAuthenticated ¶
func (*User) Login ¶
func (u *User) Login()
Login will preform any actions that are required to make a user model officially authenticated.
Click to show internal directories.
Click to hide internal directories.