model

package
v0.0.0-...-5e9e48e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

func (u *User) GetById(id interface{}) error

GetById will populate a user object from a database model with a matching id.

func (User) GetUserById

func (u User) GetUserById(id int64, db gorm.DB) *User

func (User) GetUserByNicknamePwd

func (u User) GetUserByNicknamePwd(nickname string, pwd string, db gorm.DB) *User

func (*User) IsAuthenticated

func (u *User) IsAuthenticated() bool

func (*User) Login

func (u *User) Login()

Login will preform any actions that are required to make a user model officially authenticated.

func (*User) Logout

func (u *User) Logout()

Logout will preform any actions that are required to completely logout a user.

func (User) TableName

func (u User) TableName() string

func (*User) UniqueId

func (u *User) UniqueId() interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL