models

package
v0.0.0-...-fc8e493 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSignUpDataCorrectness

func CheckSignUpDataCorrectness(login, email, password string) bool

func GatherUserInfo

func GatherUserInfo(u *User, data *map[string]interface{})

func GenerateSID

func GenerateSID(login, ip string, t time.Time) string

Types

type User

type User struct {
	Id               bson.ObjectId `bson:"_id,omitempty" json:"_id,omitempty"`
	Login            string        `bson:"login,omitempty" json:"login,omitempty"`
	PasswordHash     string        `bson:"pwd,omitempty" json:"-,omitpempty"`
	Email            string        `bson:"email,omitempty" json:"email,omitempty"`
	LastSID          string        `bson:"lastSID,omitempty" json:"-,omitempty"`
	LastSessionStart time.Time     `bson:"lastSessionStart,omitempty" json:"lastSessionStart,omitempty"`
	LastSessionEnd   time.Time     `bson:"lastSessionEnd,omitempty" json:"lastSessionEnd,omitempty"`
}

func GetUserFromCookie

func GetUserFromCookie(r *http.Request, db *mgo.Database) *User

func (*User) IsLoggedIn

func (u *User) IsLoggedIn() bool

Jump to

Keyboard shortcuts

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