wattwerks

package module
v0.0.0-...-27ca5d2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2016 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BS

type BS struct {
	// contains filtered or unexported fields
}

func (*BS) ParseUpload

func (bs *BS) ParseUpload(r *http.Request, s string) ([]byte, error)

func (*BS) UnmarshalCSV

func (bs *BS) UnmarshalCSV(data []byte, n int) error

func (*BS) UnmarshalJSON

func (bs *BS) UnmarshalJSON(data []byte) error

func (*BS) UploadURL

func (bs *BS) UploadURL(successPath string) (*url.URL, error)

type BSErr

type BSErr struct {
	When time.Time
	What string
}

func (BSErr) Error

func (bse BSErr) Error() string

type Cart

type Cart struct {
	Id     int64     `json:"id"`    // 100,000-999,999
	Cstid  int64     `json:"cstid"` //completed cart default 0
	Ids    []int64   `json:"items"` //Good Ids
	Qntts  []int     `json:"qntts"`
	Prchsd bool      `json:"purchased"`
	Ttls   []float64 `json:"ttls"`
	Txs    float64   `json:"txs"`
	Ttl    float64   `json:"total"`
}

type Category

type Category struct {
	Name          string   `json:"category"`
	Subcategories []string `json:"subcategories"`
}

type Counter

type Counter struct {
	TtlGd  int64 // 1000-9999
	NxtGd  int64 // next lowest available ID
	TtlCst int64 // 10,000-99,999
	NxtCst int64
	TtlRdr int64
	NxtRdr int64
	HlsRdr []int64 // incomplete order ids that get returned from PG wo completion/confirmation
}

type Cust

type Cust struct {
	Id        int64     `json:"id"` // 10,000-99,999
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	Firstname string    `json:"firstname"`
	Lastname  string    `json:"lastname"`
	Birthdate time.Time `json:"birthdate"`
	Meterid   int64     `json:"meterid"`
	Addr      string    `json:"addr"`
	Street    string    `json:"street"`
	Area      string    `json:"area"`
	City      string    `json:"city"`
	Postcode  string    `json:"postcode"`
	State     string    `json:"state"`
	Country   string    `json:"country"`
	Phone     string    `json:"phone"`
	Indi      bool      `json:"indi"` //Individual or not (company)
	Company   string    `json:"company"`
	Vat       string    `json:"vat"`
	Pmtmethod string    `json:"pmtmethod"`
	Crtid     int64     `json:"cartid"` //current cart 100,000-999,999

}

type CustDatabase

type CustDatabase interface {
	ListCusts() ([]*Cust, error)

	AddCust(custy *Cust) (int64, error) //create

	GetCust(id int64) (*Cust, error) //retrieve by id

	GetCustwEmail(email string) (*Cust, error) //retrieve by email

	GetCustKey(email string) (*Cust, *datastore.Key, error)

	UpdateCust(custy *Cust) error //update

	DeleteCust(id int64) error //delete

	Close() error
}

type DS

type DS struct {
	// contains filtered or unexported fields
}

func (*DS) Add

func (ds *DS) Add(v interface{}, n ...int64) (int64, error)

func (*DS) AddCust

func (ds *DS) AddCust(custy *Cust) (int64, error)

func (*DS) AddwParent

func (ds *DS) AddwParent(parent interface{}, child interface{}, offset int64) error

func (*DS) Close

func (ds *DS) Close() error

func (*DS) DeleteCust

func (ds *DS) DeleteCust(id int64) error

func (*DS) Get

func (ds *DS) Get(v interface{}) error

func (*DS) GetCust

func (ds *DS) GetCust(id int64) (*Cust, error)

func (*DS) GetCustKey

func (ds *DS) GetCustKey(email string) (*Cust, *datastore.Key, error)

func (*DS) GetCustwEmail

func (ds *DS) GetCustwEmail(email string) (*Cust, error)

func (*DS) ListCusts

func (ds *DS) ListCusts() ([]*Cust, error)

func (*DS) UpdateCust

func (ds *DS) UpdateCust(custy *Cust) error

type DSErr

type DSErr struct {
	When time.Time
	What string
}

func (DSErr) Error

func (dse DSErr) Error() string

type Good

type Good struct {
	Id          int64     `json:"id,string" schema:"-"` //1,000-9,999
	Code        string    `json:"code" schema:"code"`
	Category    string    `json:"category" schema:"category"`
	Subcategory string    `json:"subCategory" schema:"subcategory"`
	Brand       string    `json:"brand" schema:"brand"`
	Desc        string    `json:"desc" schema:"desc"`
	Price       float64   `json:"price,string" schema:"price"`
	Url         string    `json:"url" schema:"url"`
	Urlimg      string    `json:"urlImg" schema:"urlImg"`
	Featured    bool      `json:"featured,string" schema:"featured"`
	Hidden      bool      `json:"hidden,string" schema:"hidden"`
	Deets       GoodDeets `json:"goodDeets" schema:"Deets"`
}

type GoodDatabase

type GoodDatabase interface {
	ListGoods() ([]*Good, error)

	Add(good *Good) (int64, error)

	Get(id int64) (*Good, error)

	GetGoodByCategory(cat Category) ([]*Good, error)

	GetGoodBySubcategory(subcat string) ([]*Good, error)

	Update(good *Good) (int64, error)

	Delete(id int64) error

	Close() error
}

type GoodDeets

type GoodDeets struct {
	//Id int64 `json:"id"`
	DescDetails string    `json:"descDetails" schema:"descDetails"` //path to file with details
	Tax         float64   `json:"tax,string" schema:"tax"`          //percent
	Price       float64   `json:"price,string" schema:"price"`
	Stock       int       `json:"stock,string" schema:"stock"`
	Related     []int64   `json:"related" cap:"6" schema:"-"`
	Prices      []float64 `json:"prices" cap:"6" schema:"-"`
	Volumes     []int     `json:"volumes" cap:"6" schema:"-"`
	//PriceVolume map[int]float64 `json:"priceVolume"`
	ParameterNames  []string `json:"parameterNames" cap:"12" schema:"-"`
	ParameterValues []string `json:"parameterValues" cap:"12" schema:"-"`
	//Parameters map[string]string `json:"parameters"`
	Features []string `json:"features" cap:"12" schema:"-"`
	Items    []string `json:"items" cap:"6" schema:"-"`
	UrlImgs1 string   `json:"urlImgs1" schema:"urlImgs"`
	UrlImgs2 string   `json:"urlImgs2" schema:"-"`
	UrlImgs3 string   `json:"urlImgs3" schema:"-"`
	UrlFile  string   `json:"urlFile" schema:"urlFile"`
}

type Order

type Order struct {
	Id                int64  `json:"id"` //1,000,000-9,999,999
	TxId              string `json:"txid"`
	TxRefNo           string `json:"txrefno"`
	TxStatus          string `json:"txstatus"`
	TxMsg             string `json:"txmsg"`
	PgTxnNo           string `json:"pgtxnno"`
	IssuerRefNo       string `json:"issuerrefno"`
	AuthIdCode        string `json:"authidcode"`
	PgRespCode        string `json:"pgrespcode"`
	OriginalAmount    string `json:"originalamount "`
	AdjustedAmount    string `json:"adjustedamount "`
	DpRuleName        string `json:"dprulename "`
	DpRuleType        string `json:"dpruletype "`
	Amount            string `json:"amount "`
	TransactionAmount string `json:"transactionamount "`
	PaymentMode       string `json:"paymentmode "`
	TxGateway         string `json:"txgateway "`
	IssuerCode        string `json:"issuercode "`
	TxnDateTime       string `json:"txndatetime "`
	IsCOD             string `json:"iscod "`
	//Details of un-registered buyer
	FirstName        string `json:"firstname "`
	LastName         string `json:"lastname "`
	AddressStreet1   string `json:"addressstreet1 "`
	AddressStreet2   string `json:"addressstreet2 "`
	AddressFirstName string `json:"addressfirstname "`
	AddressZip       string `json:"addresszip "`
	AddressState     string `json:"addressstate "`
	AddressCountry   string `json:"addresscountry "`
	MobileNo         string `json:"mobileno "`
	Email            string `json:"email "`
	//user account if buyer registered
	//Buyer *Cust //`json:"buyer"`
	//Cart Cart `json:"cart"`
	ReqTime  time.Time `json:"reqTime"`
	SecSign  string    `json:"secSign"`
	Cstid    int64     `json:"cstid"`  //completed cart buyer
	Crtid    int64     `json:"cartid"` //completed cart id
	Notified bool      `json:"boolean"`
}

type RelatedGoods

type RelatedGoods struct {
	Gd   Good   `json:"good,string"`
	Rgds []Good `json:"goods,string"`
}

type Render

type Render struct {
	Message    string     `json:"message"`
	Cstmr      Cust       `json:"cstmr"`
	Goods      []Good     `json:"goods,string"`
	Categories []Category `json:"categories,string"`
}

rendering structs

type Render1

type Render1 struct {
	Message    string     `json:"message"`
	Cstmr      Cust       `json:"cstmr"`
	Goods      []Good     `json:"goods,string"`
	Categories []Category `json:"categories,string"`
	Cstmrs     []*Cust    `json:"cstmrs"`
}

type Render2

type Render2 struct {
	UpURL      *url.URL   `json:"upurl,string"`
	Cstmr      Cust       `json:"cstmr"`
	Categories []Category `json:"categories,string"`
}

type Render3

type Render3 struct {
	Message    string     `json:"message"`
	Cstmr      Cust       `json:"cstmr"`
	Goods      []Good     `json:"goods,string"`
	Categories []Category `json:"categories,string"`
	Crt        Cart       `json:"items"`
	Orders     []Order    `json:"orders"`
}

type Render4

type Render4 struct {
	Message    string     `json:"message"`
	Cstmr      Cust       `json:"cstmr"`
	Goods      []Good     `json:"goods,string"`
	Categories []Category `json:"categories,string"`
	Crt        Cart       `json:"items"`
}

type Render40

type Render40 struct {
	Message    string     `json:"message"`
	Cstmr      Cust       `json:"cstmr"`
	Goods      []Good     `json:"goods,string"`
	Categories []Category `json:"categories,string"`
	Crt        Cart       `json:"items"`
	Rdr        Order      `json:"rdr"`
}

type Render5

type Render5 struct {
	Ctgry         string     `json:"ctgry"`
	Sctgry        string     `json:"sctgry"`
	Cstmr         Cust       `json:"cstmr"`
	Crt           Cart       `json:"crt"`
	Goods         []Good     `json:"goods,string"`
	Categories    []Category `json:"categories,string"`
	Subcategories []string   `json:"subcategories,string"`
}

type Render6

type Render6 struct {
	Ctgry      string     `json:"ctgry"`
	Sctgry     string     `json:"sctgry"`
	Cstmr      Cust       `json:"cstmr"`
	Crt        Cart       `json:"crt"`
	Gd         Good       `json:"good,string"`
	Categories []Category `json:"categories,string"`
	Deets      GoodDeets  `json:"gooddeets"`
}

type Render7

type Render7 struct {
	Ctgry      string     `json:"ctgry"`
	Sctgry     string     `json:"sctgry"`
	Cstmr      Cust       `json:"cstmr"`
	Crt        Cart       `json:"crt"`
	Gd         Good       `json:"good,string"`
	Rgds       []Good     `json:"goods,string"`
	Categories []Category `json:"categories,string"`
	Deets      GoodDeets  `json:"gooddeets"`
}

type Sheep

type Sheep struct {
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	Addr      string    `json:"addr"`
	Phon      string    `json:"phon"`
	Area      string    `json:"area"`
	Note      string    `json:"note"`
	JDte      time.Time `json:"jdte"`
	Confirmed bool      `json:"conf"`
}

datastore structs Good-4 Cust-5 Cart-6 Order-7 GoodDeets-8 CartsPurchased-9

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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