user

package
v0.0.0-...-765978f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateUser

func ValidateUser(u *User) (bool, error)

ValidateUser makes sure all user's information is satisfied

Types

type User

type User struct {
	Id             int    `json:"id"`
	Name           string `json:"name" form:"name"`
	Email          string `json:"email" form:"email"`
	PasswordDigest []byte `json:"-"`
	Password       string `json:"password"`
}

func CreateDummyUser

func CreateDummyUser() *User

CreateDummy adds a dummy user to the database

func CreateUser

func CreateUser(u *User) (*User, error)

CreateUser validates the User's information. Upon successful validations, it creates a new User node in the database,

func DummyUser

func DummyUser() User

DummyUser or factory.DummyUser creates 1 valid User

func DummyUsers

func DummyUsers() []User

DummyUsers or factory.DummyUsers creates a slice of valid Users

func FindUser

func FindUser(props neoism.Props) (*User, error)

FindUser finds a single User by calling on FindUsers and returns the first element of the []*User slice.

func FindUsers

func FindUsers(props map[string]interface{}) ([]*User, error)

FindUsers contructs and executes a cypher query with the provided parametrs and return all User nodes that satisfy the props conditions.

func New

func New() *User

New initiate a new User struct

func (*User) Save

func (u *User) Save() (*User, error)

Save or u.Save calls on CreateUser to write a newu User node in the database.

type UserAdapter

type UserAdapter struct {
	Id             int    `json:"id(u)"`
	Name           string `json:"u.name"`
	Email          string `json:"u.email"`
	PasswordDigest []byte `json:"u.password_digest"`
}

func (*UserAdapter) Transform

func (ua *UserAdapter) Transform() *User

Transform creates a User struct from the UserAdapter

Jump to

Keyboard shortcuts

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