models

package
v0.0.0-...-46f008b Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserCollectionName - Collection name
	UserCollectionName = "users"
)

Variables

Users - User Collection

Functions

This section is empty.

Types

type User

type User struct {
	ID       bson.ObjectId `bson:"_id,omitempty"`
	Name     string        `bson:"name"`
	Username string        `bson:"username"`
	Email    string        `bson:"email"`
	Password string        `bson:"password"`
}

User model

func NewUser

func NewUser(user *User) *User

NewUser - Create a new user(make a copy of this user and modify for saving) (mostly for triggering setters)

params -- user {*User} User

returns -- {*User} The better and save ready user

func (*User) SetPassword

func (user *User) SetPassword(password string)

SetPassword - Setter for the password field TODO: Encrypt the password

params -- password {string}

Jump to

Keyboard shortcuts

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