users

package
v0.0.0-...-91abe7c Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCustomerInResponse = errors.New("Response has no matching customer")
	ErrMissingField         = "Error missing %v"
)

Functions

This section is empty.

Types

type Address

type Address struct {
	Street   string `json:"street" bson:"street,omitempty"`
	Number   string `json:"number" bson:"number,omitempty"`
	Country  string `json:"country" bson:"country,omitempty"`
	City     string `json:"city" bson:"city,omitempty"`
	PostCode string `json:"postcode" bson:"postcode,omitempty"`
	ID       string `json:"id" bson:"-"`
	Links    Links  `json:"_links"`
}
func (a *Address) AddLinks()

type Card

type Card struct {
	LongNum string `json:"longNum" bson:"longNum"`
	Expires string `json:"expires" bson:"expires"`
	CCV     string `json:"ccv" bson:"ccv"`
	ID      string `json:"id" bson:"-"`
	Links   Links  `json:"_links" bson:"-"`
}
func (c *Card) AddLinks()

func (*Card) MaskCC

func (c *Card) MaskCC()

type Href

type Href struct {
	// contains filtered or unexported fields
}
type Links map[string]Href

func (*Links) AddAddress

func (l *Links) AddAddress(id string)
func (l *Links) AddAttrLink(attr string, corent string, id string)

func (*Links) AddCard

func (l *Links) AddCard(id string)

func (*Links) AddCustomer

func (l *Links) AddCustomer(id string)
func (l *Links) AddLink(ent string, id string)

type User

type User struct {
	FirstName string    `json:"firstName" bson:"firstName"`
	LastName  string    `json:"lastName" bson:"lastName"`
	Email     string    `json:"-" bson:"email"`
	Username  string    `json:"username" bson:"username"`
	Password  string    `json:"-" bson:"password,omitempty"`
	Addresses []Address `json:"-,omitempty" bson:"-"`
	Cards     []Card    `json:"-,omitempty" bson:"-"`
	UserID    string    `json:"id" bson:"-"`
	Links     Links     `json:"_links"`
	Salt      string    `json:"-" bson:"salt"`
}

func New

func New() User
func (u *User) AddLinks()

func (*User) MaskCCs

func (u *User) MaskCCs()

func (*User) NewSalt

func (u *User) NewSalt()

func (*User) Validate

func (u *User) Validate() error

Jump to

Keyboard shortcuts

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