model

package
v0.0.0-...-93a054a Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCode is a config or an internal error
	ErrCode = errors.New("Case statement in code is not correct.")
	// ErrNoResult is a not results error
	ErrNoResult = errors.New("Result not found.")
	// ErrUnavailable is a database not available error
	ErrUnavailable = errors.New("Database is unavailable.")
	// ErrUnauthorized is a permissions violation
	ErrUnauthorized = errors.New("User does not have permission to perform this operation.")
)

Functions

func ClientCreate

func ClientCreate(firstName, lastName, email, password string) error

ClientCreate creates new user record in DB temporary disabled: ', phone, group, preflang, company, taxnum, country, state, city, district, postcode, address, pdtype, house, floor, door, dcompany, dcountry, dstate, dcity, ddistrict, dpostcode, daddress, dpdtype, dhouse, dfloor, ddoor string, promotions bool'

Types

type Client

type Client struct {
	// client infos
	ObjectID  bson.ObjectId `json:"_id" bson:"_id"`
	FirstName string        `json:"fname" bson:"fname"`
	LastName  string        `json:"lname" bson:"lname"`
	Email     string        `json:"email" bson:"email"`
	Password  string        `json:"password" bson:"password"`
	Status    int           `json:"status" bson:"status"`
}

Client struct is used for storing users (non administrative user, client only)

func ClientByEmail

func ClientByEmail(email string) (Client, error)

ClientByEmail returns client with given email address

func (*Client) ClientID

func (u *Client) ClientID() string

ClientID returns the client's ID

Jump to

Keyboard shortcuts

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