Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	mgm.DefaultModel `bson:",inline"`
	Username         string `json:"username" bson:"username"`
	Email            string `json:"email" bson:"email"`
	Hash             string `json:"-" bson:"hash"`
	FullName         string `json:"fullName" bson:"fullName"`
	Birthdate        int64  `json:"birthdate" bson:"bithdate"`
}

func NewUser

func NewUser(username, email, fullName string, birthdate int64) *User

NewUser creates a new user with the given details. IMPORTANT THIS DOES NOT SAVE OR HASH THE PASSWORD. This has to be done seperatly

func (*User) GetBirthdate

func (user *User) GetBirthdate() time.Time

func (User) Validate

func (user User) Validate() error

Source Files