model

package module
v0.0.0-...-5dab438 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TRANSACTION_DATATYPE_ORIGINAL = 1
	TRANSACTION_DATATYPE_NEW      = 2

	TRANSACTION_CHANGETYPE_INSERT = 1
	TRANSACTION_CHANGETYPE_UPDATE = 2
	TRANSACTION_CHANGETYPE_DELETE = 3

	MGO_RECORD_NOT_FOUND = "not found"

	VALIDATION_ERROR                   = "ValidationError"
	VALIDATION_ERROR_REQUIRED          = "ValidationErrorRequiredFieldMissing"
	VALIDATION_ERROR_EMAIL             = "ValidationErrorInvalidEmail"
	VALIDATION_ERROR_SPECIFIC_REQUIRED = "ValidationFieldSpecificRequired"
	VALIDATION_ERROR_SPECIFIC_EMAIL    = "ValidationFieldSpecificEmailRequired"
)
View Source
const (
	FIELD_COUNTRY_ID                    = "Id"
	FIELD_COUNTRY_ISO                   = "Iso"
	FIELD_COUNTRY_NAME                  = "Name"
	FIELD_FILEOBJECT_ID                 = "Id"
	FIELD_FILEOBJECT_NAME               = "Name"
	FIELD_FILEOBJECT_PATH               = "Path"
	FIELD_FILEOBJECT_CONTENT            = "Content"
	FIELD_BUILDING_ID                   = "Id"
	FIELD_BUILDING_NAME                 = "Name"
	FIELD_BUILDING_IMAGECUSTOM          = "ImageCustom"
	FIELD_BUILDING_IMAGEFILENAME        = "ImageFileName"
	FIELD_BUILDING_SITEID               = "SiteId"
	FIELD_BUILDING_ACCOUNTID            = "AccountId"
	FIELD_FLOOR_ID                      = "Id"
	FIELD_FLOOR_NAME                    = "Name"
	FIELD_FLOOR_SITEID                  = "SiteId"
	FIELD_FLOOR_BUILDINGID              = "BuildingId"
	FIELD_FLOOR_ACCOUNTID               = "AccountId"
	FIELD_SITE_ID                       = "Id"
	FIELD_SITE_NAME                     = "Name"
	FIELD_SITE_IMAGECUSTOM              = "ImageCustom"
	FIELD_SITE_ACCOUNTID                = "AccountId"
	FIELD_SITE_COUNTRYID                = "CountryId"
	FIELD_USER_ID                       = "Id"
	FIELD_USER_FIRST                    = "First"
	FIELD_USER_LAST                     = "Last"
	FIELD_USER_SIGNUPDATE               = "SignupDate"
	FIELD_USER_EMAIL                    = "Email"
	FIELD_ACCOUNT_ID                    = "Id"
	FIELD_ACCOUNT_ACCOUNTNAME           = "AccountName"
	FIELD_ACCOUNT_SECONDARYPHONE        = "SecondaryPhone"
	FIELD_SECONDARYPHONEINFO_VALUE      = "Value"
	FIELD_SECONDARYPHONEINFO_NUMERIC    = "Numeric"
	FIELD_SECONDARYPHONEINFO_DIALCODE   = "DialCode"
	FIELD_SECONDARYPHONEINFO_COUNTRYISO = "CountryISO"
)
View Source
const (
	ERROR_INVALID_ID_VALUE = "Invalid Id value for query."
	JOIN_ALL               = "All"
)

Variables

View Source
var Accounts modelAccounts
View Source
var AccountsHistory modelAccountsHistory
View Source
var AllowWrites bool
View Source
var Buildings modelBuildings
View Source
var BuildingsHistory modelBuildingsHistory
View Source
var Countries modelCountries
View Source
var CountriesHistory modelCountriesHistory
View Source
var FileObjects modelFileObjects
View Source
var FileObjectsHistory modelFileObjectsHistory
View Source
var Floors modelFloors
View Source
var FloorsHistory modelFloorsHistory
View Source
var GoCoreAccountsHasBootStrapped atomicTypes.AtomicBool
View Source
var GoCoreBuildingsHasBootStrapped atomicTypes.AtomicBool
View Source
var GoCoreCountriesHasBootStrapped atomicTypes.AtomicBool
View Source
var GoCoreFileObjectsHasBootStrapped atomicTypes.AtomicBool
View Source
var GoCoreFloorsHasBootStrapped atomicTypes.AtomicBool
View Source
var GoCoreSitesHasBootStrapped atomicTypes.AtomicBool
View Source
var GoCoreUsersHasBootStrapped atomicTypes.AtomicBool
View Source
var Locales = []Locale{
	{"Arabic", "ar"},
	{"Chinese", "zh"},
	{"Croatian", "hr"},
	{"Czech", "cs"},
	{"Danish", "da"},
	{"Dutch", "nl"},
	{"English", "en"},
	{"Finnish", "fi"},
	{"French", "fr"},
	{"German", "de"},
	{"Greek", "el"},
	{"Hebrew", "he"},
	{"Hindi", "hi"},
	{"Hungarian", "hu"},
	{"Indonesian", "id"},
	{"Italian", "it"},
	{"Japanese", "ja"},
	{"Korean", "ko"},
	{"Norwegian", "no"},
	{"Polish", "pl"},
	{"Portuguese", "pt"},
	{"Romanian", "ro"},
	{"Russian", "ru"},
	{"Turkish", "tr"},
	{"Thai", "th"},
	{"Spanish", "es"},
	{"Swedish", "sv"},
	{"Debug", "dev"},
}
View Source
var Sites modelSites
View Source
var SitesHistory modelSitesHistory
View Source
var TimeZoneLocations = []Timezone{}/* 584 elements not displayed */

Locations is a list of all IANA timezone locations and country codes.

View Source
var Transactions modelTransactions
View Source
var Users modelUsers
View Source
var UsersHistory modelUsersHistory

Functions

func BootstrapDirectory

func BootstrapDirectory(directoryName string, collectionCount int) (files [][]byte, err error, directoryFound bool)

func BootstrapMongoDump

func BootstrapMongoDump(directoryName string, collectionName string) (err error)

func CallMethod

func CallMethod(i interface{}, methodName string, in []reflect.Value) (err error)

func ConnectDB

func ConnectDB()

func Criteria

func Criteria(key string, value interface{}) map[string]interface{}

func GetCollectionHistoryNames

func GetCollectionHistoryNames() (names []string)

func GetCollectionNames

func GetCollectionNames() (names []string)

func GetDefaultLocale

func GetDefaultLocale(language string) string

func IsValidationError

func IsValidationError(err error) bool

func IsZeroOfUnderlyingType

func IsZeroOfUnderlyingType(x interface{}) bool

func JoinEntity

func JoinEntity(collectionQ *Query, y interface{}, j join, id string, fieldToSet reflect.Value, remainingRecursions string, q *Query, endRecursion bool, recursionCount int) (err error)

func MaxQ

func MaxQ(k string, max interface{}) map[string]Max

MaxQ is a helper function to pass to things like Filter to filter a field value and a max value

func MinQ

func MinQ(k string, min interface{}) map[string]Min

MinQ is a helper function to pass to things like Filter to filter a field value and min value

func NewObjectId

func NewObjectId() string

func Q

func Q(k string, v interface{}) map[string]interface{}

Q is a helper function to pass to things like Filter to filter a field value and key

func QTs

func QTs(k string, v time.Time) map[string]time.Time

QTs is a helper function to pass to things like Filter to filter a field value and a time.Time

func RangeQ

func RangeQ(k string, min interface{}, max interface{}) map[string]Range

RangeQ is a helper function to pass to things like Filter to filter a field value and key

func ResolveCollection

func ResolveCollection(key string) (collection, error)

func ResolveEntity

func ResolveEntity(key string) modelEntity

func ResolveField

func ResolveField(collectionName string, fieldName string) string

func ResolveHistoryCollection

func ResolveHistoryCollection(key string) modelCollection

func TimeZoneOffset

func TimeZoneOffset(loc string) (zone string, offset int, err error)

TimeZoneOffset returns the abbreviated name of the zone of l (such as "CET") and its offset in seconds east of UTC. The location should be valid IANA timezone location.

func TimeZoneValidLocation

func TimeZoneValidLocation(s string) bool

TimeZoneValidLocation returns true if the given string can be found as a timezone location in the timezone.Locations array.

func UpdateAllRecordsToLatestSchema

func UpdateAllRecordsToLatestSchema()

Types

type Account

type Account struct {
	Id             bson.ObjectId              `json:"Id" bson:"_id,omitempty"`
	AccountName    string                     `json:"AccountName" bson:"AccountName" validate:"true,,,,,,"`
	SecondaryPhone AccountsSecondaryPhoneInfo `json:"SecondaryPhone" bson:"SecondaryPhone"`
	CreateDate     time.Time                  `json:"CreateDate" bson:"CreateDate"`
	UpdateDate     time.Time                  `json:"UpdateDate" bson:"UpdateDate"`
	LastUpdateId   string                     `json:"LastUpdateId" bson:"LastUpdateId"`
	BootstrapMeta  *BootstrapMeta             `json:"BootstrapMeta" bson:"-"`

	Errors struct {
		Id             string `json:"Id"`
		AccountName    string `json:"AccountName"`
		SecondaryPhone struct {
			Value      string `json:"Value"`
			Numeric    string `json:"Numeric"`
			DialCode   string `json:"DialCode"`
			CountryISO string `json:"CountryISO"`
		} `json:"SecondaryPhone"`
	} `json:"Errors" bson:"-"`

	Views struct {
		UpdateDate    string `json:"UpdateDate" ref:"UpdateDate~DateTime"`
		UpdateFromNow string `json:"UpdateFromNow" ref:"UpdateDate~TimeFromNow"`
	} `json:"Views" bson:"-"`

	Joins struct {
		LastUpdateUser *User `json:"LastUpdateUser,omitempty" join:"Users,User,LastUpdateId,false,"`
	} `json:"Joins" bson:"-"`
}

func (*Account) BSONBytes

func (obj *Account) BSONBytes() (in []byte, err error)

func (*Account) BSONString

func (obj *Account) BSONString() (string, error)

func (*Account) CreateWithTran

func (self *Account) CreateWithTran(t *Transaction, forceCreate bool) error

func (*Account) Delete

func (self *Account) Delete() error

func (*Account) DeleteWithTran

func (self *Account) DeleteWithTran(t *Transaction) error

func (*Account) DoesIdExist

func (obj *Account) DoesIdExist(objectID interface{}) bool

func (*Account) ForceCreateWithTran

func (self *Account) ForceCreateWithTran(t *Transaction) error

func (*Account) GetId

func (self *Account) GetId() string

func (*Account) JSONBytes

func (obj *Account) JSONBytes() ([]byte, error)

func (*Account) JSONString

func (obj *Account) JSONString() (string, error)

func (*Account) JoinFields

func (self *Account) JoinFields(remainingRecursions string, q *Query, recursionCount int) (err error)

func (*Account) NewId

func (obj *Account) NewId()

func (*Account) ParseInterface

func (obj *Account) ParseInterface(x interface{}) (err error)

func (*Account) Reflect

func (self *Account) Reflect() []Field

func (*Account) Save

func (self *Account) Save() error

func (*Account) SaveWithTran

func (self *Account) SaveWithTran(t *Transaction) error

func (*Account) Unmarshal

func (self *Account) Unmarshal(data []byte) error

func (*Account) ValidateAndClean

func (self *Account) ValidateAndClean() error

type AccountHistoryRecord

type AccountHistoryRecord struct {
	Id         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	TId        string        `json:"tId" dbIndex:"index" bson:"tId"`
	ObjId      string        `json:"objId" dbIndex:"index" bson:"objId"`
	Data       string        `json:"data" bson:"data"`
	Type       int           `json:"type" bson:"type"`
	CreateDate time.Time     `json:"createDate" dbIndex:"index" bson:"createDate"`
}

func (*AccountHistoryRecord) BSONBytes

func (obj *AccountHistoryRecord) BSONBytes() (in []byte, err error)

func (*AccountHistoryRecord) BSONString

func (obj *AccountHistoryRecord) BSONString() (string, error)

func (*AccountHistoryRecord) Delete

func (self *AccountHistoryRecord) Delete() error

func (*AccountHistoryRecord) DoesIdExist

func (obj *AccountHistoryRecord) DoesIdExist(objectID interface{}) bool

func (*AccountHistoryRecord) GetData

func (self *AccountHistoryRecord) GetData() string

func (*AccountHistoryRecord) GetId

func (self *AccountHistoryRecord) GetId() string

func (*AccountHistoryRecord) GetType

func (self *AccountHistoryRecord) GetType() int

func (*AccountHistoryRecord) JSONBytes

func (obj *AccountHistoryRecord) JSONBytes() ([]byte, error)

func (*AccountHistoryRecord) JSONString

func (obj *AccountHistoryRecord) JSONString() (string, error)

func (*AccountHistoryRecord) JoinFields

func (self *AccountHistoryRecord) JoinFields(s string, q *Query, x int) error

func (*AccountHistoryRecord) Reflect

func (obj *AccountHistoryRecord) Reflect() []Field

func (*AccountHistoryRecord) Save

func (self *AccountHistoryRecord) Save() error

func (*AccountHistoryRecord) SaveWithTran

func (self *AccountHistoryRecord) SaveWithTran(t *Transaction) error

func (*AccountHistoryRecord) Unmarshal

func (self *AccountHistoryRecord) Unmarshal(data []byte) error

type AccountJoinItems

type AccountJoinItems struct {
	Count int        `json:"Count"`
	Items *[]Account `json:"Items"`
}

type AccountsSecondaryPhoneInfo

type AccountsSecondaryPhoneInfo struct {
	Value      string `json:"Value" bson:"Value"`
	Numeric    string `json:"Numeric" bson:"Numeric"`
	DialCode   string `json:"DialCode" bson:"DialCode"`
	CountryISO string `json:"CountryISO" bson:"CountryISO"`
}

type BootstrapMeta

type BootstrapMeta struct {
	// Version is the version that you specifically want to bootstrap only to
	Version int `json:"Version" bson:"Version"`
	// Domain would be used to bootstrap only a specific domain
	Domain string `json:"Domain" bson:"Domain"`
	// ReleaseMode would be used to bootstrap only a specific release mode such as debug records
	ReleaseMode string `json:"ReleaseMode" bson:"ReleaseMode"`
	// ProductName would be used to bootstrap only a specific product name
	ProductName string `json:"ProductName" bson:"ProductName"`
	// Domains would be used to bootstrap only many domains
	Domains []string `json:"Domains" bson:"Domains"`
	// ProductNames would be used to bootstrap many product name
	ProductNames []string `json:"ProductNames" bson:"ProductNames"`
	// DeleteRow, if true, will delete the row from the bootstrap table after it is previousl bootstrapped
	DeleteRow bool `json:"DeleteRow" bson:"DeleteRow"`
	// AlwaysUpdate, if true, will always update the row from the bootstrap table after it is previously bootstrapped
	AlwaysUpdate bool `json:"AlwaysUpdate" bson:"AlwaysUpdate"`
}

BootstrapMeta is a struct that is used to tell the bootstrap how or what you want to bootstrap

type Building

type Building struct {
	Id            bson.ObjectId  `json:"Id" bson:"_id,omitempty"`
	Name          string         `json:"Name" bson:"Name" validate:"true,,,,,,"`
	ImageCustom   string         `json:"ImageCustom" bson:"ImageCustom"`
	ImageFileName string         `json:"ImageFileName" bson:"ImageFileName"`
	SiteId        string         `json:"SiteId" dbIndex:"index" bson:"SiteId" validate:"true,,,,,,"`
	AccountId     string         `json:"AccountId" dbIndex:"index" bson:"AccountId" validate:"true,,,,,,"`
	CreateDate    time.Time      `json:"CreateDate" bson:"CreateDate"`
	UpdateDate    time.Time      `json:"UpdateDate" bson:"UpdateDate"`
	LastUpdateId  string         `json:"LastUpdateId" bson:"LastUpdateId"`
	BootstrapMeta *BootstrapMeta `json:"BootstrapMeta" bson:"-"`

	Errors struct {
		Id            string `json:"Id"`
		Name          string `json:"Name"`
		ImageCustom   string `json:"ImageCustom"`
		ImageFileName string `json:"ImageFileName"`
		SiteId        string `json:"SiteId"`
		AccountId     string `json:"AccountId"`
	} `json:"Errors" bson:"-"`

	Views struct {
		UpdateDate    string `json:"UpdateDate" ref:"UpdateDate~DateTime"`
		UpdateFromNow string `json:"UpdateFromNow" ref:"UpdateDate~TimeFromNow"`
	} `json:"Views" bson:"-"`

	Joins struct {
		FileObjects    *FileObject     `json:"FileObjects,omitempty" join:"FileObjects,FileObject,ImageCustom,false,"`
		Floors         *FloorJoinItems `json:"Floors,omitempty" join:"Floors,Floor,Id,true,BuildingId"`
		Site           *Site           `json:"Site,omitempty" join:"Sites,Site,SiteId,false,"`
		Account        *Account        `json:"Account,omitempty" join:"Accounts,Account,AccountId,false,"`
		LastUpdateUser *User           `json:"LastUpdateUser,omitempty" join:"Users,User,LastUpdateId,false,"`
	} `json:"Joins" bson:"-"`
}

func (*Building) BSONBytes

func (obj *Building) BSONBytes() (in []byte, err error)

func (*Building) BSONString

func (obj *Building) BSONString() (string, error)

func (*Building) CreateWithTran

func (self *Building) CreateWithTran(t *Transaction, forceCreate bool) error

func (*Building) Delete

func (self *Building) Delete() error

func (*Building) DeleteWithTran

func (self *Building) DeleteWithTran(t *Transaction) error

func (*Building) DoesIdExist

func (obj *Building) DoesIdExist(objectID interface{}) bool

func (*Building) ForceCreateWithTran

func (self *Building) ForceCreateWithTran(t *Transaction) error

func (*Building) GetId

func (self *Building) GetId() string

func (*Building) JSONBytes

func (obj *Building) JSONBytes() ([]byte, error)

func (*Building) JSONString

func (obj *Building) JSONString() (string, error)

func (*Building) JoinFields

func (self *Building) JoinFields(remainingRecursions string, q *Query, recursionCount int) (err error)

func (*Building) NewId

func (obj *Building) NewId()

func (*Building) ParseInterface

func (obj *Building) ParseInterface(x interface{}) (err error)

func (*Building) Reflect

func (self *Building) Reflect() []Field

func (*Building) Save

func (self *Building) Save() error

func (*Building) SaveWithTran

func (self *Building) SaveWithTran(t *Transaction) error

func (*Building) Unmarshal

func (self *Building) Unmarshal(data []byte) error

func (*Building) ValidateAndClean

func (self *Building) ValidateAndClean() error

type BuildingHistoryRecord

type BuildingHistoryRecord struct {
	Id         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	TId        string        `json:"tId" dbIndex:"index" bson:"tId"`
	ObjId      string        `json:"objId" dbIndex:"index" bson:"objId"`
	Data       string        `json:"data" bson:"data"`
	Type       int           `json:"type" bson:"type"`
	CreateDate time.Time     `json:"createDate" dbIndex:"index" bson:"createDate"`
}

func (*BuildingHistoryRecord) BSONBytes

func (obj *BuildingHistoryRecord) BSONBytes() (in []byte, err error)

func (*BuildingHistoryRecord) BSONString

func (obj *BuildingHistoryRecord) BSONString() (string, error)

func (*BuildingHistoryRecord) Delete

func (self *BuildingHistoryRecord) Delete() error

func (*BuildingHistoryRecord) DoesIdExist

func (obj *BuildingHistoryRecord) DoesIdExist(objectID interface{}) bool

func (*BuildingHistoryRecord) GetData

func (self *BuildingHistoryRecord) GetData() string

func (*BuildingHistoryRecord) GetId

func (self *BuildingHistoryRecord) GetId() string

func (*BuildingHistoryRecord) GetType

func (self *BuildingHistoryRecord) GetType() int

func (*BuildingHistoryRecord) JSONBytes

func (obj *BuildingHistoryRecord) JSONBytes() ([]byte, error)

func (*BuildingHistoryRecord) JSONString

func (obj *BuildingHistoryRecord) JSONString() (string, error)

func (*BuildingHistoryRecord) JoinFields

func (self *BuildingHistoryRecord) JoinFields(s string, q *Query, x int) error

func (*BuildingHistoryRecord) Reflect

func (obj *BuildingHistoryRecord) Reflect() []Field

func (*BuildingHistoryRecord) Save

func (self *BuildingHistoryRecord) Save() error

func (*BuildingHistoryRecord) SaveWithTran

func (self *BuildingHistoryRecord) SaveWithTran(t *Transaction) error

func (*BuildingHistoryRecord) Unmarshal

func (self *BuildingHistoryRecord) Unmarshal(data []byte) error

type BuildingJoinItems

type BuildingJoinItems struct {
	Count int         `json:"Count"`
	Items *[]Building `json:"Items"`
}

type Country

type Country struct {
	Id            bson.ObjectId  `json:"Id" bson:"_id,omitempty"`
	Iso           string         `json:"Iso" bson:"Iso"`
	Name          string         `json:"Name" bson:"Name"`
	CreateDate    time.Time      `json:"CreateDate" bson:"CreateDate"`
	UpdateDate    time.Time      `json:"UpdateDate" bson:"UpdateDate"`
	LastUpdateId  string         `json:"LastUpdateId" bson:"LastUpdateId"`
	BootstrapMeta *BootstrapMeta `json:"BootstrapMeta" bson:"-"`

	Errors struct {
		Id   string `json:"Id"`
		Iso  string `json:"Iso"`
		Name string `json:"Name"`
	} `json:"Errors" bson:"-"`
}

func (*Country) BSONBytes

func (obj *Country) BSONBytes() (in []byte, err error)

func (*Country) BSONString

func (obj *Country) BSONString() (string, error)

func (*Country) CreateWithTran

func (self *Country) CreateWithTran(t *Transaction, forceCreate bool) error

func (*Country) Delete

func (self *Country) Delete() error

func (*Country) DeleteWithTran

func (self *Country) DeleteWithTran(t *Transaction) error

func (*Country) DoesIdExist

func (obj *Country) DoesIdExist(objectID interface{}) bool

func (*Country) ForceCreateWithTran

func (self *Country) ForceCreateWithTran(t *Transaction) error

func (*Country) GetId

func (self *Country) GetId() string

func (*Country) JSONBytes

func (obj *Country) JSONBytes() ([]byte, error)

func (*Country) JSONString

func (obj *Country) JSONString() (string, error)

func (*Country) JoinFields

func (self *Country) JoinFields(remainingRecursions string, q *Query, recursionCount int) (err error)

func (*Country) NewId

func (obj *Country) NewId()

func (*Country) ParseInterface

func (obj *Country) ParseInterface(x interface{}) (err error)

func (*Country) Reflect

func (self *Country) Reflect() []Field

func (*Country) Save

func (self *Country) Save() error

func (*Country) SaveWithTran

func (self *Country) SaveWithTran(t *Transaction) error

func (*Country) Unmarshal

func (self *Country) Unmarshal(data []byte) error

func (*Country) ValidateAndClean

func (self *Country) ValidateAndClean() error

type CountryHistoryRecord

type CountryHistoryRecord struct {
	Id         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	TId        string        `json:"tId" dbIndex:"index" bson:"tId"`
	ObjId      string        `json:"objId" dbIndex:"index" bson:"objId"`
	Data       string        `json:"data" bson:"data"`
	Type       int           `json:"type" bson:"type"`
	CreateDate time.Time     `json:"createDate" dbIndex:"index" bson:"createDate"`
}

func (*CountryHistoryRecord) BSONBytes

func (obj *CountryHistoryRecord) BSONBytes() (in []byte, err error)

func (*CountryHistoryRecord) BSONString

func (obj *CountryHistoryRecord) BSONString() (string, error)

func (*CountryHistoryRecord) Delete

func (self *CountryHistoryRecord) Delete() error

func (*CountryHistoryRecord) DoesIdExist

func (obj *CountryHistoryRecord) DoesIdExist(objectID interface{}) bool

func (*CountryHistoryRecord) GetData

func (self *CountryHistoryRecord) GetData() string

func (*CountryHistoryRecord) GetId

func (self *CountryHistoryRecord) GetId() string

func (*CountryHistoryRecord) GetType

func (self *CountryHistoryRecord) GetType() int

func (*CountryHistoryRecord) JSONBytes

func (obj *CountryHistoryRecord) JSONBytes() ([]byte, error)

func (*CountryHistoryRecord) JSONString

func (obj *CountryHistoryRecord) JSONString() (string, error)

func (*CountryHistoryRecord) JoinFields

func (self *CountryHistoryRecord) JoinFields(s string, q *Query, x int) error

func (*CountryHistoryRecord) Reflect

func (obj *CountryHistoryRecord) Reflect() []Field

func (*CountryHistoryRecord) Save

func (self *CountryHistoryRecord) Save() error

func (*CountryHistoryRecord) SaveWithTran

func (self *CountryHistoryRecord) SaveWithTran(t *Transaction) error

func (*CountryHistoryRecord) Unmarshal

func (self *CountryHistoryRecord) Unmarshal(data []byte) error

type CountryJoinItems

type CountryJoinItems struct {
	Count int        `json:"Count"`
	Items *[]Country `json:"Items"`
}

type DataFormat

type DataFormat struct {
	Language      string `json:"Language"`
	DateFormat    string `json:"DateFormat"`
	LocalTimeZone string `json:"LocalTimeZone"`
}

func (*DataFormat) JSONString

func (obj *DataFormat) JSONString() (string, error)

func (*DataFormat) Parse

func (self *DataFormat) Parse(data string) (err error)

type Field

type Field struct {
	Name       string
	Label      string
	DataType   string
	IsView     bool
	Validation *dbServices.FieldValidation
}

func Reflect

func Reflect(obj interface{}) []Field

type FileObject

type FileObject struct {
	Id            bson.ObjectId  `json:"Id" bson:"_id,omitempty"`
	Name          string         `json:"Name" bson:"Name"`
	Path          string         `json:"Path" bson:"Path"`
	Content       string         `json:"Content" bson:"Content"`
	CreateDate    time.Time      `json:"CreateDate" bson:"CreateDate"`
	UpdateDate    time.Time      `json:"UpdateDate" bson:"UpdateDate"`
	LastUpdateId  string         `json:"LastUpdateId" bson:"LastUpdateId"`
	BootstrapMeta *BootstrapMeta `json:"BootstrapMeta" bson:"-"`

	Errors struct {
		Id      string `json:"Id"`
		Name    string `json:"Name"`
		Path    string `json:"Path"`
		Content string `json:"Content"`
	} `json:"Errors" bson:"-"`
}

func (*FileObject) BSONBytes

func (obj *FileObject) BSONBytes() (in []byte, err error)

func (*FileObject) BSONString

func (obj *FileObject) BSONString() (string, error)

func (*FileObject) CreateWithTran

func (self *FileObject) CreateWithTran(t *Transaction, forceCreate bool) error

func (*FileObject) Delete

func (self *FileObject) Delete() error

func (*FileObject) DeleteWithTran

func (self *FileObject) DeleteWithTran(t *Transaction) error

func (*FileObject) DoesIdExist

func (obj *FileObject) DoesIdExist(objectID interface{}) bool

func (*FileObject) ForceCreateWithTran

func (self *FileObject) ForceCreateWithTran(t *Transaction) error

func (*FileObject) GetId

func (self *FileObject) GetId() string

func (*FileObject) JSONBytes

func (obj *FileObject) JSONBytes() ([]byte, error)

func (*FileObject) JSONString

func (obj *FileObject) JSONString() (string, error)

func (*FileObject) JoinFields

func (self *FileObject) JoinFields(remainingRecursions string, q *Query, recursionCount int) (err error)

func (*FileObject) NewId

func (obj *FileObject) NewId()

func (*FileObject) ParseInterface

func (obj *FileObject) ParseInterface(x interface{}) (err error)

func (*FileObject) Reflect

func (self *FileObject) Reflect() []Field

func (*FileObject) Save

func (self *FileObject) Save() error

func (*FileObject) SaveWithTran

func (self *FileObject) SaveWithTran(t *Transaction) error

func (*FileObject) Unmarshal

func (self *FileObject) Unmarshal(data []byte) error

func (*FileObject) ValidateAndClean

func (self *FileObject) ValidateAndClean() error

type FileObjectHistoryRecord

type FileObjectHistoryRecord struct {
	Id         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	TId        string        `json:"tId" dbIndex:"index" bson:"tId"`
	ObjId      string        `json:"objId" dbIndex:"index" bson:"objId"`
	Data       string        `json:"data" bson:"data"`
	Type       int           `json:"type" bson:"type"`
	CreateDate time.Time     `json:"createDate" dbIndex:"index" bson:"createDate"`
}

func (*FileObjectHistoryRecord) BSONBytes

func (obj *FileObjectHistoryRecord) BSONBytes() (in []byte, err error)

func (*FileObjectHistoryRecord) BSONString

func (obj *FileObjectHistoryRecord) BSONString() (string, error)

func (*FileObjectHistoryRecord) Delete

func (self *FileObjectHistoryRecord) Delete() error

func (*FileObjectHistoryRecord) DoesIdExist

func (obj *FileObjectHistoryRecord) DoesIdExist(objectID interface{}) bool

func (*FileObjectHistoryRecord) GetData

func (self *FileObjectHistoryRecord) GetData() string

func (*FileObjectHistoryRecord) GetId

func (self *FileObjectHistoryRecord) GetId() string

func (*FileObjectHistoryRecord) GetType

func (self *FileObjectHistoryRecord) GetType() int

func (*FileObjectHistoryRecord) JSONBytes

func (obj *FileObjectHistoryRecord) JSONBytes() ([]byte, error)

func (*FileObjectHistoryRecord) JSONString

func (obj *FileObjectHistoryRecord) JSONString() (string, error)

func (*FileObjectHistoryRecord) JoinFields

func (self *FileObjectHistoryRecord) JoinFields(s string, q *Query, x int) error

func (*FileObjectHistoryRecord) Reflect

func (obj *FileObjectHistoryRecord) Reflect() []Field

func (*FileObjectHistoryRecord) Save

func (self *FileObjectHistoryRecord) Save() error

func (*FileObjectHistoryRecord) SaveWithTran

func (self *FileObjectHistoryRecord) SaveWithTran(t *Transaction) error

func (*FileObjectHistoryRecord) Unmarshal

func (self *FileObjectHistoryRecord) Unmarshal(data []byte) error

type FileObjectJoinItems

type FileObjectJoinItems struct {
	Count int           `json:"Count"`
	Items *[]FileObject `json:"Items"`
}

type Floor

type Floor struct {
	Id            bson.ObjectId  `json:"Id" bson:"_id,omitempty"`
	Name          string         `json:"Name" bson:"Name" validate:"true,,,,,,"`
	SiteId        string         `json:"SiteId" dbIndex:"index" bson:"SiteId" validate:"true,,,,,,"`
	BuildingId    string         `json:"BuildingId" dbIndex:"index" bson:"BuildingId" validate:"true,,,,,,"`
	AccountId     string         `json:"AccountId" dbIndex:"index" bson:"AccountId" validate:"true,,,,,,"`
	CreateDate    time.Time      `json:"CreateDate" bson:"CreateDate"`
	UpdateDate    time.Time      `json:"UpdateDate" bson:"UpdateDate"`
	LastUpdateId  string         `json:"LastUpdateId" bson:"LastUpdateId"`
	BootstrapMeta *BootstrapMeta `json:"BootstrapMeta" bson:"-"`

	Errors struct {
		Id         string `json:"Id"`
		Name       string `json:"Name"`
		SiteId     string `json:"SiteId"`
		BuildingId string `json:"BuildingId"`
		AccountId  string `json:"AccountId"`
	} `json:"Errors" bson:"-"`

	Views struct {
		UpdateDate    string `json:"UpdateDate" ref:"UpdateDate~DateTime"`
		UpdateFromNow string `json:"UpdateFromNow" ref:"UpdateDate~TimeFromNow"`
	} `json:"Views" bson:"-"`

	Joins struct {
		Site           *Site     `json:"Site,omitempty" join:"Sites,Site,SiteId,false,"`
		Building       *Building `json:"Building,omitempty" join:"Buildings,Building,BuildingId,false,"`
		Account        *Account  `json:"Account,omitempty" join:"Accounts,Account,AccountId,false,"`
		LastUpdateUser *User     `json:"LastUpdateUser,omitempty" join:"Users,User,LastUpdateId,false,"`
	} `json:"Joins" bson:"-"`
}

func (*Floor) BSONBytes

func (obj *Floor) BSONBytes() (in []byte, err error)

func (*Floor) BSONString

func (obj *Floor) BSONString() (string, error)

func (*Floor) CreateWithTran

func (self *Floor) CreateWithTran(t *Transaction, forceCreate bool) error

func (*Floor) Delete

func (self *Floor) Delete() error

func (*Floor) DeleteWithTran

func (self *Floor) DeleteWithTran(t *Transaction) error

func (*Floor) DoesIdExist

func (obj *Floor) DoesIdExist(objectID interface{}) bool

func (*Floor) ForceCreateWithTran

func (self *Floor) ForceCreateWithTran(t *Transaction) error

func (*Floor) GetId

func (self *Floor) GetId() string

func (*Floor) JSONBytes

func (obj *Floor) JSONBytes() ([]byte, error)

func (*Floor) JSONString

func (obj *Floor) JSONString() (string, error)

func (*Floor) JoinFields

func (self *Floor) JoinFields(remainingRecursions string, q *Query, recursionCount int) (err error)

func (*Floor) NewId

func (obj *Floor) NewId()

func (*Floor) ParseInterface

func (obj *Floor) ParseInterface(x interface{}) (err error)

func (*Floor) Reflect

func (self *Floor) Reflect() []Field

func (*Floor) Save

func (self *Floor) Save() error

func (*Floor) SaveWithTran

func (self *Floor) SaveWithTran(t *Transaction) error

func (*Floor) Unmarshal

func (self *Floor) Unmarshal(data []byte) error

func (*Floor) ValidateAndClean

func (self *Floor) ValidateAndClean() error

type FloorHistoryRecord

type FloorHistoryRecord struct {
	Id         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	TId        string        `json:"tId" dbIndex:"index" bson:"tId"`
	ObjId      string        `json:"objId" dbIndex:"index" bson:"objId"`
	Data       string        `json:"data" bson:"data"`
	Type       int           `json:"type" bson:"type"`
	CreateDate time.Time     `json:"createDate" dbIndex:"index" bson:"createDate"`
}

func (*FloorHistoryRecord) BSONBytes

func (obj *FloorHistoryRecord) BSONBytes() (in []byte, err error)

func (*FloorHistoryRecord) BSONString

func (obj *FloorHistoryRecord) BSONString() (string, error)

func (*FloorHistoryRecord) Delete

func (self *FloorHistoryRecord) Delete() error

func (*FloorHistoryRecord) DoesIdExist

func (obj *FloorHistoryRecord) DoesIdExist(objectID interface{}) bool

func (*FloorHistoryRecord) GetData

func (self *FloorHistoryRecord) GetData() string

func (*FloorHistoryRecord) GetId

func (self *FloorHistoryRecord) GetId() string

func (*FloorHistoryRecord) GetType

func (self *FloorHistoryRecord) GetType() int

func (*FloorHistoryRecord) JSONBytes

func (obj *FloorHistoryRecord) JSONBytes() ([]byte, error)

func (*FloorHistoryRecord) JSONString

func (obj *FloorHistoryRecord) JSONString() (string, error)

func (*FloorHistoryRecord) JoinFields

func (self *FloorHistoryRecord) JoinFields(s string, q *Query, x int) error

func (*FloorHistoryRecord) Reflect

func (obj *FloorHistoryRecord) Reflect() []Field

func (*FloorHistoryRecord) Save

func (self *FloorHistoryRecord) Save() error

func (*FloorHistoryRecord) SaveWithTran

func (self *FloorHistoryRecord) SaveWithTran(t *Transaction) error

func (*FloorHistoryRecord) Unmarshal

func (self *FloorHistoryRecord) Unmarshal(data []byte) error

type FloorJoinItems

type FloorJoinItems struct {
	Count int      `json:"Count"`
	Items *[]Floor `json:"Items"`
}

type Locale

type Locale struct {
	Language string `json:"Language"`
	Value    string `json:"Value"`
}

type Max

type Max struct {
	Max interface{}
}

type Min

type Min struct {
	Min interface{}
}

type Query

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

func (*Query) AddAnd

func (self *Query) AddAnd() *Query

func (*Query) AddAndOr

func (self *Query) AddAndOr() *Query

func (*Query) AddBlankAndOr

func (self *Query) AddBlankAndOr() *Query

func (*Query) All

func (self *Query) All(x interface{}) error

func (*Query) AndExclude

func (self *Query) AndExclude(index int, criteria map[string]interface{}) *Query

func (*Query) AndFilter

func (self *Query) AndFilter(index int, criteria map[string]interface{}) *Query

func (*Query) AndGreaterThan

func (self *Query) AndGreaterThan(index int, criteria map[string]Max) *Query

func (*Query) AndGreaterThanEqualTo

func (self *Query) AndGreaterThanEqualTo(index int, criteria map[string]Max) *Query

func (*Query) AndIn

func (self *Query) AndIn(index int, criteria map[string]interface{}) *Query

func (*Query) AndLessThan

func (self *Query) AndLessThan(index int, criteria map[string]Min) *Query

func (*Query) AndLessThanEqualTo

func (self *Query) AndLessThanEqualTo(index int, criteria map[string]Min) *Query

func (*Query) AndRange

func (self *Query) AndRange(index int, criteria map[string]Range) *Query

func (*Query) Blacklist

func (self *Query) Blacklist(collection string, fields []string) *Query

func (*Query) ById

func (self *Query) ById(objectId interface{}, modelInstance interface{}) error

func (*Query) CheckForObjectId

func (self *Query) CheckForObjectId(val interface{}) interface{}

func (*Query) Count

func (self *Query) Count(x interface{}) (int, error)

func (*Query) Distinct

func (self *Query) Distinct(key string, x interface{}) error

func (*Query) Exclude

func (self *Query) Exclude(criteria map[string]interface{}) *Query

func (*Query) Exists

func (self *Query) Exists(criteria map[string]interface{}) *Query

func (*Query) Filter

func (self *Query) Filter(criteria map[string]interface{}) *Query

func (*Query) GenerateQuery

func (self *Query) GenerateQuery() *mgo.Query

func (*Query) GetAndOr

func (self *Query) GetAndOr() map[string][]map[string][]bson.M

func (*Query) GetCollection

func (self *Query) GetCollection() *mgo.Collection

func (*Query) GetOrCreate

func (self *Query) GetOrCreate(x interface{}, t *Transaction) (err error)

func (*Query) GreaterThan

func (self *Query) GreaterThan(criteria map[string]Max) *Query

func (*Query) GreaterThanEqualTo

func (self *Query) GreaterThanEqualTo(criteria map[string]Max) *Query

func (*Query) In

func (self *Query) In(criteria map[string]interface{}) *Query

func (*Query) InitAndOr

func (self *Query) InitAndOr() *Query

func (*Query) Iter

func (self *Query) Iter() (qi *QueryIterator)

func (*Query) Join

func (self *Query) Join(criteria string) *Query

func (*Query) LeftJoin

func (self *Query) LeftJoin(criteria string) *Query

func (*Query) LessThan

func (self *Query) LessThan(criteria map[string]Min) *Query

func (*Query) LessThanEqualTo

func (self *Query) LessThanEqualTo(criteria map[string]Min) *Query

func (*Query) Limit

func (self *Query) Limit(val int) *Query

func (*Query) LogQuery

func (self *Query) LogQuery(functionName string)

func (*Query) NotExists

func (self *Query) NotExists(criteria map[string]interface{}) *Query

func (*Query) One

func (self *Query) One(x interface{}) error

func (*Query) Or

func (self *Query) Or(criteria map[string]interface{}) *Query

func (*Query) OrExclude

func (self *Query) OrExclude(index int, criteria map[string]interface{}) *Query

func (*Query) OrFilter

func (self *Query) OrFilter(index int, criteria map[string]interface{}) *Query

func (*Query) OrGreaterThan

func (self *Query) OrGreaterThan(index int, criteria map[string]Max) *Query

func (*Query) OrGreaterThanEqualTo

func (self *Query) OrGreaterThanEqualTo(index int, criteria map[string]Max) *Query

func (*Query) OrIn

func (self *Query) OrIn(index int, criteria map[string]interface{}) *Query

func (*Query) OrLessThan

func (self *Query) OrLessThan(index int, criteria map[string]Min) *Query

func (*Query) OrLessThanEqualTo

func (self *Query) OrLessThanEqualTo(index int, criteria map[string]Min) *Query

func (*Query) OrRange

func (self *Query) OrRange(index int, criteria map[string]Range) *Query

func (*Query) Range

func (self *Query) Range(criteria map[string]Range) *Query

func (*Query) RenderViews

func (self *Query) RenderViews(format DataFormat) *Query

func (*Query) Skip

func (self *Query) Skip(val int) *Query

func (*Query) Sort

func (self *Query) Sort(fields ...string) *Query

func (*Query) ToggleLogFlag

func (self *Query) ToggleLogFlag(toggle bool) *Query

func (*Query) TotalRows

func (self *Query) TotalRows() int

func (*Query) Where

func (self *Query) Where(field string, val interface{}) *Query

func (*Query) Whitelist

func (self *Query) Whitelist(collection string, fields []string) *Query

type QueryFieldFilter

type QueryFieldFilter struct {
	CollectionName string
	Fields         []string
}

type QueryIterator

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

func (*QueryIterator) Next

func (self *QueryIterator) Next(x interface{}) (gotRecord bool, err error)

type Range

type Range struct {
	Min interface{}
	Max interface{}
}

type Site

type Site struct {
	Id            bson.ObjectId  `json:"Id" bson:"_id,omitempty"`
	Name          string         `json:"Name" bson:"Name" validate:"true,,,,,,"`
	ImageCustom   string         `json:"ImageCustom" bson:"ImageCustom"`
	AccountId     string         `json:"AccountId" dbIndex:"index" bson:"AccountId"`
	CountryId     string         `json:"CountryId" bson:"CountryId" validate:"true,,,,,,"`
	CreateDate    time.Time      `json:"CreateDate" bson:"CreateDate"`
	UpdateDate    time.Time      `json:"UpdateDate" bson:"UpdateDate"`
	LastUpdateId  string         `json:"LastUpdateId" bson:"LastUpdateId"`
	BootstrapMeta *BootstrapMeta `json:"BootstrapMeta" bson:"-"`

	Errors struct {
		Id          string `json:"Id"`
		Name        string `json:"Name"`
		ImageCustom string `json:"ImageCustom"`
		AccountId   string `json:"AccountId"`
		CountryId   string `json:"CountryId"`
	} `json:"Errors" bson:"-"`

	Views struct {
		UpdateDate    string `json:"UpdateDate" ref:"UpdateDate~DateTime"`
		UpdateFromNow string `json:"UpdateFromNow" ref:"UpdateDate~TimeFromNow"`
	} `json:"Views" bson:"-"`

	Joins struct {
		FileObjects    *FileObject        `json:"FileObjects,omitempty" join:"FileObjects,FileObject,ImageCustom,false,"`
		Account        *Account           `json:"Account,omitempty" join:"Accounts,Account,AccountId,false,"`
		Country        *Country           `json:"Country,omitempty" join:"Countries,Country,CountryId,false,"`
		Buildings      *BuildingJoinItems `json:"Buildings,omitempty" join:"Buildings,Building,Id,true,SiteId"`
		LastUpdateUser *User              `json:"LastUpdateUser,omitempty" join:"Users,User,LastUpdateId,false,"`
	} `json:"Joins" bson:"-"`
}

func (*Site) BSONBytes

func (obj *Site) BSONBytes() (in []byte, err error)

func (*Site) BSONString

func (obj *Site) BSONString() (string, error)

func (*Site) CreateWithTran

func (self *Site) CreateWithTran(t *Transaction, forceCreate bool) error

func (*Site) Delete

func (self *Site) Delete() error

func (*Site) DeleteWithTran

func (self *Site) DeleteWithTran(t *Transaction) error

func (*Site) DoesIdExist

func (obj *Site) DoesIdExist(objectID interface{}) bool

func (*Site) ForceCreateWithTran

func (self *Site) ForceCreateWithTran(t *Transaction) error

func (*Site) GetId

func (self *Site) GetId() string

func (*Site) JSONBytes

func (obj *Site) JSONBytes() ([]byte, error)

func (*Site) JSONString

func (obj *Site) JSONString() (string, error)

func (*Site) JoinFields

func (self *Site) JoinFields(remainingRecursions string, q *Query, recursionCount int) (err error)

func (*Site) NewId

func (obj *Site) NewId()

func (*Site) ParseInterface

func (obj *Site) ParseInterface(x interface{}) (err error)

func (*Site) Reflect

func (self *Site) Reflect() []Field

func (*Site) Save

func (self *Site) Save() error

func (*Site) SaveWithTran

func (self *Site) SaveWithTran(t *Transaction) error

func (*Site) Unmarshal

func (self *Site) Unmarshal(data []byte) error

func (*Site) ValidateAndClean

func (self *Site) ValidateAndClean() error

type SiteHistoryRecord

type SiteHistoryRecord struct {
	Id         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	TId        string        `json:"tId" dbIndex:"index" bson:"tId"`
	ObjId      string        `json:"objId" dbIndex:"index" bson:"objId"`
	Data       string        `json:"data" bson:"data"`
	Type       int           `json:"type" bson:"type"`
	CreateDate time.Time     `json:"createDate" dbIndex:"index" bson:"createDate"`
}

func (*SiteHistoryRecord) BSONBytes

func (obj *SiteHistoryRecord) BSONBytes() (in []byte, err error)

func (*SiteHistoryRecord) BSONString

func (obj *SiteHistoryRecord) BSONString() (string, error)

func (*SiteHistoryRecord) Delete

func (self *SiteHistoryRecord) Delete() error

func (*SiteHistoryRecord) DoesIdExist

func (obj *SiteHistoryRecord) DoesIdExist(objectID interface{}) bool

func (*SiteHistoryRecord) GetData

func (self *SiteHistoryRecord) GetData() string

func (*SiteHistoryRecord) GetId

func (self *SiteHistoryRecord) GetId() string

func (*SiteHistoryRecord) GetType

func (self *SiteHistoryRecord) GetType() int

func (*SiteHistoryRecord) JSONBytes

func (obj *SiteHistoryRecord) JSONBytes() ([]byte, error)

func (*SiteHistoryRecord) JSONString

func (obj *SiteHistoryRecord) JSONString() (string, error)

func (*SiteHistoryRecord) JoinFields

func (self *SiteHistoryRecord) JoinFields(s string, q *Query, x int) error

func (*SiteHistoryRecord) Reflect

func (obj *SiteHistoryRecord) Reflect() []Field

func (*SiteHistoryRecord) Save

func (self *SiteHistoryRecord) Save() error

func (*SiteHistoryRecord) SaveWithTran

func (self *SiteHistoryRecord) SaveWithTran(t *Transaction) error

func (*SiteHistoryRecord) Unmarshal

func (self *SiteHistoryRecord) Unmarshal(data []byte) error

type SiteJoinItems

type SiteJoinItems struct {
	Count int     `json:"Count"`
	Items *[]Site `json:"Items"`
}

type Timezone

type Timezone struct {
	Location string `json:"Location"`
	Code     string `json:"Code"`
	Country  string `json:"Country"`
}

Timezone holds data gathered from CSV files on http://timezonedb.com/download.

func TimeZoneCode

func TimeZoneCode(c string) ([]Timezone, error)

TimeZoneCode returns all timezones with given country code. If none is found, returns an error.

func TimeZoneCountry

func TimeZoneCountry(c string) ([]Timezone, error)

TimeZoneCountry returns all timezones with given country name. If none is found, returns an error.

type Transaction

type Transaction struct {
	Id             bson.ObjectId `json:"id" bson:"_id,omitempty"`
	UserId         string        `json:"userId" dbIndex:"index" bson:"userId"`
	CreateDate     time.Time     `json:"createDate" bson:"createDate"`
	LastUpdate     time.Time     `json:"lastUpdate" bson:"lastUpdate"`
	CompleteDate   time.Time     `json:"completeDate" bson:"completeDate"`
	RollbackDate   time.Time     `json:"rollbackDate" bson:"rollbackDate"`
	Committed      bool          `json:"committed" bson:"committed"`
	Error          string        `json:"error" bson:"error"`
	Collections    []string      `json:"collections" bson:"collections"`
	Details        string        `json:"details" bson:"details"`
	RolledBack     bool          `json:"rolledBack" bson:"rolledBack"`
	RolledBackBy   string        `json:"rolledBackBy" bson:"rolledBackBy"`
	RollbackReason string        `json:"rollbackReason" bson:"rollbackReason"`
}

func (*Transaction) BSONBytes

func (obj *Transaction) BSONBytes() (in []byte, err error)

func (*Transaction) BSONString

func (obj *Transaction) BSONString() (string, error)

func (*Transaction) Begin

func (self *Transaction) Begin() error

func (*Transaction) Commit

func (self *Transaction) Commit() error

func (*Transaction) Delete

func (self *Transaction) Delete() error

func (*Transaction) JSONBytes

func (obj *Transaction) JSONBytes() ([]byte, error)

func (*Transaction) JSONString

func (obj *Transaction) JSONString() (string, error)

func (*Transaction) Resume

func (self *Transaction) Resume() error

func (*Transaction) Rollback

func (self *Transaction) Rollback(userId string, reason string) error

func (*Transaction) RollbackTransaction

func (self *Transaction) RollbackTransaction() error

func (*Transaction) Save

func (self *Transaction) Save() error

type User

type User struct {
	Id            bson.ObjectId  `json:"Id" bson:"_id,omitempty"`
	First         string         `json:"First" bson:"First" validate:"true,,,,,,"`
	Last          string         `json:"Last" bson:"Last" validate:"true,,,,,,"`
	SignupDate    time.Time      `json:"SignupDate" bson:"SignupDate"`
	Email         string         `json:"Email" dbIndex:"unique" bson:"Email" validate:"true,email,,,,,"`
	CreateDate    time.Time      `json:"CreateDate" bson:"CreateDate"`
	UpdateDate    time.Time      `json:"UpdateDate" bson:"UpdateDate"`
	LastUpdateId  string         `json:"LastUpdateId" bson:"LastUpdateId"`
	BootstrapMeta *BootstrapMeta `json:"BootstrapMeta" bson:"-"`

	Errors struct {
		Id         string `json:"Id"`
		First      string `json:"First"`
		Last       string `json:"Last"`
		SignupDate string `json:"SignupDate"`
		Email      string `json:"Email"`
	} `json:"Errors" bson:"-"`
}

func (*User) BSONBytes

func (obj *User) BSONBytes() (in []byte, err error)

func (*User) BSONString

func (obj *User) BSONString() (string, error)

func (*User) CreateWithTran

func (self *User) CreateWithTran(t *Transaction, forceCreate bool) error

func (*User) Delete

func (self *User) Delete() error

func (*User) DeleteWithTran

func (self *User) DeleteWithTran(t *Transaction) error

func (*User) DoesIdExist

func (obj *User) DoesIdExist(objectID interface{}) bool

func (*User) ForceCreateWithTran

func (self *User) ForceCreateWithTran(t *Transaction) error

func (*User) GetId

func (self *User) GetId() string

func (*User) JSONBytes

func (obj *User) JSONBytes() ([]byte, error)

func (*User) JSONString

func (obj *User) JSONString() (string, error)

func (*User) JoinFields

func (self *User) JoinFields(remainingRecursions string, q *Query, recursionCount int) (err error)

func (*User) NewId

func (obj *User) NewId()

func (*User) ParseInterface

func (obj *User) ParseInterface(x interface{}) (err error)

func (*User) Reflect

func (self *User) Reflect() []Field

func (*User) Save

func (self *User) Save() error

func (*User) SaveWithTran

func (self *User) SaveWithTran(t *Transaction) error

func (*User) Unmarshal

func (self *User) Unmarshal(data []byte) error

func (*User) ValidateAndClean

func (self *User) ValidateAndClean() error

type UserHistoryRecord

type UserHistoryRecord struct {
	Id         bson.ObjectId `json:"id" bson:"_id,omitempty"`
	TId        string        `json:"tId" dbIndex:"index" bson:"tId"`
	ObjId      string        `json:"objId" dbIndex:"index" bson:"objId"`
	Data       string        `json:"data" bson:"data"`
	Type       int           `json:"type" bson:"type"`
	CreateDate time.Time     `json:"createDate" dbIndex:"index" bson:"createDate"`
}

func (*UserHistoryRecord) BSONBytes

func (obj *UserHistoryRecord) BSONBytes() (in []byte, err error)

func (*UserHistoryRecord) BSONString

func (obj *UserHistoryRecord) BSONString() (string, error)

func (*UserHistoryRecord) Delete

func (self *UserHistoryRecord) Delete() error

func (*UserHistoryRecord) DoesIdExist

func (obj *UserHistoryRecord) DoesIdExist(objectID interface{}) bool

func (*UserHistoryRecord) GetData

func (self *UserHistoryRecord) GetData() string

func (*UserHistoryRecord) GetId

func (self *UserHistoryRecord) GetId() string

func (*UserHistoryRecord) GetType

func (self *UserHistoryRecord) GetType() int

func (*UserHistoryRecord) JSONBytes

func (obj *UserHistoryRecord) JSONBytes() ([]byte, error)

func (*UserHistoryRecord) JSONString

func (obj *UserHistoryRecord) JSONString() (string, error)

func (*UserHistoryRecord) JoinFields

func (self *UserHistoryRecord) JoinFields(s string, q *Query, x int) error

func (*UserHistoryRecord) Reflect

func (obj *UserHistoryRecord) Reflect() []Field

func (*UserHistoryRecord) Save

func (self *UserHistoryRecord) Save() error

func (*UserHistoryRecord) SaveWithTran

func (self *UserHistoryRecord) SaveWithTran(t *Transaction) error

func (*UserHistoryRecord) Unmarshal

func (self *UserHistoryRecord) Unmarshal(data []byte) error

type UserJoinItems

type UserJoinItems struct {
	Count int     `json:"Count"`
	Items *[]User `json:"Items"`
}

Jump to

Keyboard shortcuts

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