models

package
v0.0.0-...-34fb709 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 4 Imported by: 0

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        time.Time `json:"birthdate" bson:"bithdate"`
}

func NewUser

func NewUser(username, email, fullName string, birthdate time.Time) *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) Validate

func (user User) Validate() error

Jump to

Keyboard shortcuts

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