models

package
v0.0.0-...-072c2b0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

agreement

Index

Constants

This section is empty.

Variables

View Source
var (
	DbMap *sql.DB
)

Functions

func GetDbListTemplate

func GetDbListTemplate(queryMap map[string]string, dbCountFunc DbCountFunc, dbRowsFunc DbRowsFunc, dbListFunc DbListFunc)

func LoadModel

func LoadModel(loadable Loadable, data map[string][]string)

Types

type Agreement

type Agreement struct {
	AgreementId  []byte
	ProductId    []byte
	PartyIdFrom  []byte
	PartyIdTo    []byte
	RoleTypeIdTo []byte
	FromDate     []byte
	ThruDate     []byte
	Description  []byte
}

func GetTableAgreement

func GetTableAgreement(queryMap map[string]string, offset int, limit int) ([]*Agreement, int)

type DbChange

type DbChange struct {
	XMLName  xml.Name  `xml:"db"`
	Products []Product `xml:"product"`
}

/////////////////////////////////////////////////////////////////////////////////

  • store the changes to the database

type DbCountFunc

type DbCountFunc func(queryMap *map[string]string) error

/////////////////////////////////////////////////////////////////////////////////

  • for creating a function literal that set the total row count variable (in lexical scope)
  • of the list/table, based on the function parameter (i.e. queryMap)

type DbListFunc

type DbListFunc func(rows *sql.Rows) error

* for creating a function literal that create an object and populate it with values from the row, * before appending it to a lexical scoped list

type DbRowsFunc

type DbRowsFunc func(queryMap *map[string]string) (*sql.Rows, error)

* for creating a function literal that return rows from the database, * based on the function parameter (i.e. queryMap) and any lexical scoped variables (e.g. offset, limit)

type Loadable

type Loadable interface {
	LoadValue(prefix string, name string, value []string)
}

implemented by structs that need to load values from http request

type Product

type Product struct {
	ProductId   []byte `xml:"product_id"`
	ProductName []byte `xml:"product_name"`
}

func GetListProduct

func GetListProduct(queryMap map[string]string, offset int, limit int) ([]*Product, int)

func GetTableProduct

func GetTableProduct(queryMap map[string]string, offset int, limit int) ([]*Product, int)

func (*Product) LoadValue

func (d *Product) LoadValue(prefix string, name string, value []string)

implements the Loadable interface

Jump to

Keyboard shortcuts

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