user

package
v0.0.0-...-c15dfdb Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateLoginToken

func GenerateLoginToken() string

GenerateLoginToken ... Generate new login token

func GetCollection

func GetCollection() *mgo.Collection

GetCollection ... Get database collection made it easily to access table

Types

type User

type User struct {
	ID            bson.ObjectId `json:"id,omitempty" bson:"_id,omitempty"`
	GuestDeviceID string        `json:"guestDeviceId,omitempty" bson:"guestDeviceId,omitempty"`
	Username      string        `json:"username,omitempty" bson:"username,omitempty"`
	Password      string        `json:"password,omitempty" bson:"password,omitempty"`
	Email         string        `json:"email,omitempty" bson:"email,omitempty"`
	LoginToken    string        `json:"loginToken,omitempty" bson:"loginToken,omitempty"`
	FacebookID    string        `json:"facebookId,omitempty" bson:"facebookId,omitempty"`
	FacebookToken string        `json:"facebookToken,omitempty" bson:"facebookToken,omitempty"`
	GoogleID      string        `json:"googleId,omitempty" bson:"googleId,omitempty"`
	GoogleToken   string        `json:"googleToken,omitempty" bson:"googleToken,omitempty"`
	RegisterDate  *time.Time    `json:"registerDate,omitempty" bson:"registerDate,omitempty"`
	LastLoginDate *time.Time    `json:"lastLoginDate,omitempty" bson:"lastLoginDate,omitempty"`
}

User ... User database model

func New

func New() User

New ... Create new User with required database

func NewEmpty

func NewEmpty() User

NewEmpty ... Create new User with empty database

func (*User) UpdateLogin

func (user *User) UpdateLogin()

UpdateLogin ... Update login token and last login date

Jump to

Keyboard shortcuts

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