models

package
v0.0.0-...-0dc708d Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2016 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID                string `sql:"type:uuid;primary_key;default:uuid_generate_v4()"`
	FirstName         string `gorm:"type:varchar(128);not null;"`
	LastName          string `gorm:"type:varchar(128);not null;"`
	Email             string `gorm:"type:varchar(128);not null;unique_index"`
	EncryptedPassword string `gorm:"type:varchar(128);not null;index"`
}

func AllUsers

func AllUsers() (users []*User, err error)

func CreateUser

func CreateUser(firstName string, lastName string, email string, password string) (*User, error)

func DeleteUser

func DeleteUser(id string) (User, error)

func FindUser

func FindUser(id string) (*User, error)

func UpdateUser

func UpdateUser(id string, firstName *string, lastName *string, email *string, password *string) (*User, error)

func UserLogin

func UserLogin(email string, password string) (user *User, err error)

func (*User) AsMap

func (u *User) AsMap() map[string]string

Jump to

Keyboard shortcuts

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