orm

package
v0.0.0-...-5ebd1d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 19 Imported by: 2

Documentation

Overview

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go

do not modify, generated file

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

Index

Constants

This section is empty.

Variables

View Source
var BackRepoDummyAgentid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoEngineid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoEventid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoGongsimCommandid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoGongsimStatusid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var DummyAgent_Fields = []string{

	"ID",
	"TechName",
	"Name",
}
View Source
var Engine_Fields = []string{

	"ID",
	"Name",
	"EndTime",
	"CurrentTime",
	"SecondsSinceStart",
	"Fired",
	"ControlMode",
	"State",
	"Speed",
}
View Source
var Event_Fields = []string{

	"ID",
	"Name",
	"Duration",
}
View Source
var GongsimCommand_Fields = []string{

	"ID",
	"Name",
	"Command",
	"CommandDate",
	"SpeedCommandType",
	"DateSpeedCommand",
}
View Source
var GongsimStatus_Fields = []string{

	"ID",
	"Name",
	"CurrentCommand",
	"CompletionDate",
	"CurrentSpeedCommand",
	"SpeedCommandCompletionDate",
}

Functions

func CopyBackRepoToBackRepoData

func CopyBackRepoToBackRepoData(backRepo *BackRepoStruct, backRepoData *BackRepoData)

func GetID

func GetID[T models.Gongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T) (id int)

func GetIDPointer

func GetIDPointer[T models.PointerToGongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance T) (id int)

func GetInstanceDBFromInstance

func GetInstanceDBFromInstance[T models.Gongstruct, T2 GongstructDB](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T) (ret *T2)

func GetReverseFieldOwner

func GetReverseFieldOwner[T models.Gongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T,
	reverseField *models.ReverseField) (res any)

func GetReverseFieldOwnerName

func GetReverseFieldOwnerName[T models.Gongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T,
	reverseField *models.ReverseField) (res string)

Types

type BackRepoData

type BackRepoData struct {
	DummyAgentAPIs []*DummyAgentAPI

	EngineAPIs []*EngineAPI

	EventAPIs []*EventAPI

	GongsimCommandAPIs []*GongsimCommandAPI

	GongsimStatusAPIs []*GongsimStatusAPI
}

type BackRepoDummyAgentStruct

type BackRepoDummyAgentStruct struct {
	// stores DummyAgentDB according to their gorm ID
	Map_DummyAgentDBID_DummyAgentDB map[uint]*DummyAgentDB

	// stores DummyAgentDB ID according to DummyAgent address
	Map_DummyAgentPtr_DummyAgentDBID map[*models.DummyAgent]uint

	// stores DummyAgent according to their gorm ID
	Map_DummyAgentDBID_DummyAgentPtr map[uint]*models.DummyAgent
	// contains filtered or unexported fields
}

func (*BackRepoDummyAgentStruct) Backup

func (backRepoDummyAgent *BackRepoDummyAgentStruct) Backup(dirPath string)

Backup generates a json file from a slice of all DummyAgentDB instances in the backrepo

func (*BackRepoDummyAgentStruct) BackupXL

func (backRepoDummyAgent *BackRepoDummyAgentStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all DummyAgentDB instances in the backrepo

func (*BackRepoDummyAgentStruct) CheckoutPhaseOne

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CheckoutPhaseOne() (Error error)

BackRepoDummyAgent.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoDummyAgentStruct) CheckoutPhaseOneInstance

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CheckoutPhaseOneInstance(dummyagentDB *DummyAgentDB) (Error error)

CheckoutPhaseOneInstance takes a dummyagentDB that has been found in the DB, updates the backRepo and stages the models version of the dummyagentDB

func (*BackRepoDummyAgentStruct) CheckoutPhaseTwo

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoDummyAgent.CheckoutPhaseTwo Checkouts all staged instances of DummyAgent to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoDummyAgentStruct) CheckoutPhaseTwoInstance

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, dummyagentDB *DummyAgentDB) (Error error)

BackRepoDummyAgent.CheckoutPhaseTwoInstance Checkouts staged instances of DummyAgent to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoDummyAgentStruct) CommitDeleteInstance

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoDummyAgent.CommitDeleteInstance commits deletion of DummyAgent to the BackRepo

func (*BackRepoDummyAgentStruct) CommitPhaseOne

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoDummyAgent.CommitPhaseOne commits all staged instances of DummyAgent to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoDummyAgentStruct) CommitPhaseOneInstance

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CommitPhaseOneInstance(dummyagent *models.DummyAgent) (Error error)

BackRepoDummyAgent.CommitPhaseOneInstance commits dummyagent staged instances of DummyAgent to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoDummyAgentStruct) CommitPhaseTwo

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoDummyAgent.CommitPhaseTwo commits all staged instances of DummyAgent to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoDummyAgentStruct) CommitPhaseTwoInstance

func (backRepoDummyAgent *BackRepoDummyAgentStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, dummyagent *models.DummyAgent) (Error error)

BackRepoDummyAgent.CommitPhaseTwoInstance commits {{structname }} of models.DummyAgent to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoDummyAgentStruct) GetDB

func (backRepoDummyAgent *BackRepoDummyAgentStruct) GetDB() *gorm.DB

func (*BackRepoDummyAgentStruct) GetDummyAgentDBFromDummyAgentPtr

func (backRepoDummyAgent *BackRepoDummyAgentStruct) GetDummyAgentDBFromDummyAgentPtr(dummyagent *models.DummyAgent) (dummyagentDB *DummyAgentDB)

GetDummyAgentDBFromDummyAgentPtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoDummyAgentStruct) GetStage

func (backRepoDummyAgent *BackRepoDummyAgentStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoDummyAgentStruct) ResetReversePointers

func (backRepoDummyAgent *BackRepoDummyAgentStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoDummyAgent.ResetReversePointers commits all staged instances of DummyAgent to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoDummyAgentStruct) ResetReversePointersInstance

func (backRepoDummyAgent *BackRepoDummyAgentStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, dummyagent *models.DummyAgent) (Error error)

func (*BackRepoDummyAgentStruct) RestorePhaseOne

func (backRepoDummyAgent *BackRepoDummyAgentStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "DummyAgentDB.json" in dirPath that stores an array of DummyAgentDB and stores it in the database the map BackRepoDummyAgentid_atBckpTime_newID is updated accordingly

func (*BackRepoDummyAgentStruct) RestorePhaseTwo

func (backRepoDummyAgent *BackRepoDummyAgentStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<DummyAgent>id_atBckpTime_newID to compute new index

func (*BackRepoDummyAgentStruct) RestoreXLPhaseOne

func (backRepoDummyAgent *BackRepoDummyAgentStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "DummyAgent" sheet all DummyAgentDB instances

type BackRepoEngineStruct

type BackRepoEngineStruct struct {
	// stores EngineDB according to their gorm ID
	Map_EngineDBID_EngineDB map[uint]*EngineDB

	// stores EngineDB ID according to Engine address
	Map_EnginePtr_EngineDBID map[*models.Engine]uint

	// stores Engine according to their gorm ID
	Map_EngineDBID_EnginePtr map[uint]*models.Engine
	// contains filtered or unexported fields
}

func (*BackRepoEngineStruct) Backup

func (backRepoEngine *BackRepoEngineStruct) Backup(dirPath string)

Backup generates a json file from a slice of all EngineDB instances in the backrepo

func (*BackRepoEngineStruct) BackupXL

func (backRepoEngine *BackRepoEngineStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all EngineDB instances in the backrepo

func (*BackRepoEngineStruct) CheckoutPhaseOne

func (backRepoEngine *BackRepoEngineStruct) CheckoutPhaseOne() (Error error)

BackRepoEngine.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoEngineStruct) CheckoutPhaseOneInstance

func (backRepoEngine *BackRepoEngineStruct) CheckoutPhaseOneInstance(engineDB *EngineDB) (Error error)

CheckoutPhaseOneInstance takes a engineDB that has been found in the DB, updates the backRepo and stages the models version of the engineDB

func (*BackRepoEngineStruct) CheckoutPhaseTwo

func (backRepoEngine *BackRepoEngineStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoEngine.CheckoutPhaseTwo Checkouts all staged instances of Engine to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEngineStruct) CheckoutPhaseTwoInstance

func (backRepoEngine *BackRepoEngineStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, engineDB *EngineDB) (Error error)

BackRepoEngine.CheckoutPhaseTwoInstance Checkouts staged instances of Engine to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEngineStruct) CommitDeleteInstance

func (backRepoEngine *BackRepoEngineStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoEngine.CommitDeleteInstance commits deletion of Engine to the BackRepo

func (*BackRepoEngineStruct) CommitPhaseOne

func (backRepoEngine *BackRepoEngineStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoEngine.CommitPhaseOne commits all staged instances of Engine to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoEngineStruct) CommitPhaseOneInstance

func (backRepoEngine *BackRepoEngineStruct) CommitPhaseOneInstance(engine *models.Engine) (Error error)

BackRepoEngine.CommitPhaseOneInstance commits engine staged instances of Engine to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoEngineStruct) CommitPhaseTwo

func (backRepoEngine *BackRepoEngineStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoEngine.CommitPhaseTwo commits all staged instances of Engine to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEngineStruct) CommitPhaseTwoInstance

func (backRepoEngine *BackRepoEngineStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, engine *models.Engine) (Error error)

BackRepoEngine.CommitPhaseTwoInstance commits {{structname }} of models.Engine to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEngineStruct) GetDB

func (backRepoEngine *BackRepoEngineStruct) GetDB() *gorm.DB

func (*BackRepoEngineStruct) GetEngineDBFromEnginePtr

func (backRepoEngine *BackRepoEngineStruct) GetEngineDBFromEnginePtr(engine *models.Engine) (engineDB *EngineDB)

GetEngineDBFromEnginePtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoEngineStruct) GetStage

func (backRepoEngine *BackRepoEngineStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoEngineStruct) ResetReversePointers

func (backRepoEngine *BackRepoEngineStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoEngine.ResetReversePointers commits all staged instances of Engine to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEngineStruct) ResetReversePointersInstance

func (backRepoEngine *BackRepoEngineStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, engine *models.Engine) (Error error)

func (*BackRepoEngineStruct) RestorePhaseOne

func (backRepoEngine *BackRepoEngineStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "EngineDB.json" in dirPath that stores an array of EngineDB and stores it in the database the map BackRepoEngineid_atBckpTime_newID is updated accordingly

func (*BackRepoEngineStruct) RestorePhaseTwo

func (backRepoEngine *BackRepoEngineStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<Engine>id_atBckpTime_newID to compute new index

func (*BackRepoEngineStruct) RestoreXLPhaseOne

func (backRepoEngine *BackRepoEngineStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Engine" sheet all EngineDB instances

type BackRepoEventStruct

type BackRepoEventStruct struct {
	// stores EventDB according to their gorm ID
	Map_EventDBID_EventDB map[uint]*EventDB

	// stores EventDB ID according to Event address
	Map_EventPtr_EventDBID map[*models.Event]uint

	// stores Event according to their gorm ID
	Map_EventDBID_EventPtr map[uint]*models.Event
	// contains filtered or unexported fields
}

func (*BackRepoEventStruct) Backup

func (backRepoEvent *BackRepoEventStruct) Backup(dirPath string)

Backup generates a json file from a slice of all EventDB instances in the backrepo

func (*BackRepoEventStruct) BackupXL

func (backRepoEvent *BackRepoEventStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all EventDB instances in the backrepo

func (*BackRepoEventStruct) CheckoutPhaseOne

func (backRepoEvent *BackRepoEventStruct) CheckoutPhaseOne() (Error error)

BackRepoEvent.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoEventStruct) CheckoutPhaseOneInstance

func (backRepoEvent *BackRepoEventStruct) CheckoutPhaseOneInstance(eventDB *EventDB) (Error error)

CheckoutPhaseOneInstance takes a eventDB that has been found in the DB, updates the backRepo and stages the models version of the eventDB

func (*BackRepoEventStruct) CheckoutPhaseTwo

func (backRepoEvent *BackRepoEventStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoEvent.CheckoutPhaseTwo Checkouts all staged instances of Event to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEventStruct) CheckoutPhaseTwoInstance

func (backRepoEvent *BackRepoEventStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, eventDB *EventDB) (Error error)

BackRepoEvent.CheckoutPhaseTwoInstance Checkouts staged instances of Event to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEventStruct) CommitDeleteInstance

func (backRepoEvent *BackRepoEventStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoEvent.CommitDeleteInstance commits deletion of Event to the BackRepo

func (*BackRepoEventStruct) CommitPhaseOne

func (backRepoEvent *BackRepoEventStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoEvent.CommitPhaseOne commits all staged instances of Event to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoEventStruct) CommitPhaseOneInstance

func (backRepoEvent *BackRepoEventStruct) CommitPhaseOneInstance(event *models.Event) (Error error)

BackRepoEvent.CommitPhaseOneInstance commits event staged instances of Event to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoEventStruct) CommitPhaseTwo

func (backRepoEvent *BackRepoEventStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoEvent.CommitPhaseTwo commits all staged instances of Event to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEventStruct) CommitPhaseTwoInstance

func (backRepoEvent *BackRepoEventStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, event *models.Event) (Error error)

BackRepoEvent.CommitPhaseTwoInstance commits {{structname }} of models.Event to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEventStruct) GetDB

func (backRepoEvent *BackRepoEventStruct) GetDB() *gorm.DB

func (*BackRepoEventStruct) GetEventDBFromEventPtr

func (backRepoEvent *BackRepoEventStruct) GetEventDBFromEventPtr(event *models.Event) (eventDB *EventDB)

GetEventDBFromEventPtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoEventStruct) GetStage

func (backRepoEvent *BackRepoEventStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoEventStruct) ResetReversePointers

func (backRepoEvent *BackRepoEventStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoEvent.ResetReversePointers commits all staged instances of Event to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoEventStruct) ResetReversePointersInstance

func (backRepoEvent *BackRepoEventStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, event *models.Event) (Error error)

func (*BackRepoEventStruct) RestorePhaseOne

func (backRepoEvent *BackRepoEventStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "EventDB.json" in dirPath that stores an array of EventDB and stores it in the database the map BackRepoEventid_atBckpTime_newID is updated accordingly

func (*BackRepoEventStruct) RestorePhaseTwo

func (backRepoEvent *BackRepoEventStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<Event>id_atBckpTime_newID to compute new index

func (*BackRepoEventStruct) RestoreXLPhaseOne

func (backRepoEvent *BackRepoEventStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Event" sheet all EventDB instances

type BackRepoGongsimCommandStruct

type BackRepoGongsimCommandStruct struct {
	// stores GongsimCommandDB according to their gorm ID
	Map_GongsimCommandDBID_GongsimCommandDB map[uint]*GongsimCommandDB

	// stores GongsimCommandDB ID according to GongsimCommand address
	Map_GongsimCommandPtr_GongsimCommandDBID map[*models.GongsimCommand]uint

	// stores GongsimCommand according to their gorm ID
	Map_GongsimCommandDBID_GongsimCommandPtr map[uint]*models.GongsimCommand
	// contains filtered or unexported fields
}

func (*BackRepoGongsimCommandStruct) Backup

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) Backup(dirPath string)

Backup generates a json file from a slice of all GongsimCommandDB instances in the backrepo

func (*BackRepoGongsimCommandStruct) BackupXL

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all GongsimCommandDB instances in the backrepo

func (*BackRepoGongsimCommandStruct) CheckoutPhaseOne

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CheckoutPhaseOne() (Error error)

BackRepoGongsimCommand.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoGongsimCommandStruct) CheckoutPhaseOneInstance

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CheckoutPhaseOneInstance(gongsimcommandDB *GongsimCommandDB) (Error error)

CheckoutPhaseOneInstance takes a gongsimcommandDB that has been found in the DB, updates the backRepo and stages the models version of the gongsimcommandDB

func (*BackRepoGongsimCommandStruct) CheckoutPhaseTwo

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoGongsimCommand.CheckoutPhaseTwo Checkouts all staged instances of GongsimCommand to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimCommandStruct) CheckoutPhaseTwoInstance

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, gongsimcommandDB *GongsimCommandDB) (Error error)

BackRepoGongsimCommand.CheckoutPhaseTwoInstance Checkouts staged instances of GongsimCommand to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimCommandStruct) CommitDeleteInstance

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoGongsimCommand.CommitDeleteInstance commits deletion of GongsimCommand to the BackRepo

func (*BackRepoGongsimCommandStruct) CommitPhaseOne

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoGongsimCommand.CommitPhaseOne commits all staged instances of GongsimCommand to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoGongsimCommandStruct) CommitPhaseOneInstance

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CommitPhaseOneInstance(gongsimcommand *models.GongsimCommand) (Error error)

BackRepoGongsimCommand.CommitPhaseOneInstance commits gongsimcommand staged instances of GongsimCommand to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoGongsimCommandStruct) CommitPhaseTwo

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoGongsimCommand.CommitPhaseTwo commits all staged instances of GongsimCommand to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimCommandStruct) CommitPhaseTwoInstance

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, gongsimcommand *models.GongsimCommand) (Error error)

BackRepoGongsimCommand.CommitPhaseTwoInstance commits {{structname }} of models.GongsimCommand to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimCommandStruct) GetDB

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) GetDB() *gorm.DB

func (*BackRepoGongsimCommandStruct) GetGongsimCommandDBFromGongsimCommandPtr

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) GetGongsimCommandDBFromGongsimCommandPtr(gongsimcommand *models.GongsimCommand) (gongsimcommandDB *GongsimCommandDB)

GetGongsimCommandDBFromGongsimCommandPtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoGongsimCommandStruct) GetStage

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoGongsimCommandStruct) ResetReversePointers

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoGongsimCommand.ResetReversePointers commits all staged instances of GongsimCommand to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimCommandStruct) ResetReversePointersInstance

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, gongsimcommand *models.GongsimCommand) (Error error)

func (*BackRepoGongsimCommandStruct) RestorePhaseOne

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "GongsimCommandDB.json" in dirPath that stores an array of GongsimCommandDB and stores it in the database the map BackRepoGongsimCommandid_atBckpTime_newID is updated accordingly

func (*BackRepoGongsimCommandStruct) RestorePhaseTwo

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<GongsimCommand>id_atBckpTime_newID to compute new index

func (*BackRepoGongsimCommandStruct) RestoreXLPhaseOne

func (backRepoGongsimCommand *BackRepoGongsimCommandStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "GongsimCommand" sheet all GongsimCommandDB instances

type BackRepoGongsimStatusStruct

type BackRepoGongsimStatusStruct struct {
	// stores GongsimStatusDB according to their gorm ID
	Map_GongsimStatusDBID_GongsimStatusDB map[uint]*GongsimStatusDB

	// stores GongsimStatusDB ID according to GongsimStatus address
	Map_GongsimStatusPtr_GongsimStatusDBID map[*models.GongsimStatus]uint

	// stores GongsimStatus according to their gorm ID
	Map_GongsimStatusDBID_GongsimStatusPtr map[uint]*models.GongsimStatus
	// contains filtered or unexported fields
}

func (*BackRepoGongsimStatusStruct) Backup

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) Backup(dirPath string)

Backup generates a json file from a slice of all GongsimStatusDB instances in the backrepo

func (*BackRepoGongsimStatusStruct) BackupXL

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) BackupXL(file *xlsx.File)

Backup generates a json file from a slice of all GongsimStatusDB instances in the backrepo

func (*BackRepoGongsimStatusStruct) CheckoutPhaseOne

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CheckoutPhaseOne() (Error error)

BackRepoGongsimStatus.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoGongsimStatusStruct) CheckoutPhaseOneInstance

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CheckoutPhaseOneInstance(gongsimstatusDB *GongsimStatusDB) (Error error)

CheckoutPhaseOneInstance takes a gongsimstatusDB that has been found in the DB, updates the backRepo and stages the models version of the gongsimstatusDB

func (*BackRepoGongsimStatusStruct) CheckoutPhaseTwo

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoGongsimStatus.CheckoutPhaseTwo Checkouts all staged instances of GongsimStatus to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimStatusStruct) CheckoutPhaseTwoInstance

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, gongsimstatusDB *GongsimStatusDB) (Error error)

BackRepoGongsimStatus.CheckoutPhaseTwoInstance Checkouts staged instances of GongsimStatus to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimStatusStruct) CommitDeleteInstance

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoGongsimStatus.CommitDeleteInstance commits deletion of GongsimStatus to the BackRepo

func (*BackRepoGongsimStatusStruct) CommitPhaseOne

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoGongsimStatus.CommitPhaseOne commits all staged instances of GongsimStatus to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoGongsimStatusStruct) CommitPhaseOneInstance

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CommitPhaseOneInstance(gongsimstatus *models.GongsimStatus) (Error error)

BackRepoGongsimStatus.CommitPhaseOneInstance commits gongsimstatus staged instances of GongsimStatus to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoGongsimStatusStruct) CommitPhaseTwo

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

BackRepoGongsimStatus.CommitPhaseTwo commits all staged instances of GongsimStatus to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimStatusStruct) CommitPhaseTwoInstance

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, gongsimstatus *models.GongsimStatus) (Error error)

BackRepoGongsimStatus.CommitPhaseTwoInstance commits {{structname }} of models.GongsimStatus to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimStatusStruct) GetDB

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) GetDB() *gorm.DB

func (*BackRepoGongsimStatusStruct) GetGongsimStatusDBFromGongsimStatusPtr

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) GetGongsimStatusDBFromGongsimStatusPtr(gongsimstatus *models.GongsimStatus) (gongsimstatusDB *GongsimStatusDB)

GetGongsimStatusDBFromGongsimStatusPtr is a handy function to access the back repo instance from the stage instance

func (*BackRepoGongsimStatusStruct) GetStage

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoGongsimStatusStruct) ResetReversePointers

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

BackRepoGongsimStatus.ResetReversePointers commits all staged instances of GongsimStatus to the BackRepo Phase Two is the update of instance with the field in the database

func (*BackRepoGongsimStatusStruct) ResetReversePointersInstance

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, gongsimstatus *models.GongsimStatus) (Error error)

func (*BackRepoGongsimStatusStruct) RestorePhaseOne

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) RestorePhaseOne(dirPath string)

RestorePhaseOne read the file "GongsimStatusDB.json" in dirPath that stores an array of GongsimStatusDB and stores it in the database the map BackRepoGongsimStatusid_atBckpTime_newID is updated accordingly

func (*BackRepoGongsimStatusStruct) RestorePhaseTwo

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) RestorePhaseTwo()

RestorePhaseTwo uses all map BackRepo<GongsimStatus>id_atBckpTime_newID to compute new index

func (*BackRepoGongsimStatusStruct) RestoreXLPhaseOne

func (backRepoGongsimStatus *BackRepoGongsimStatusStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "GongsimStatus" sheet all GongsimStatusDB instances

type BackRepoStruct

type BackRepoStruct struct {
	// insertion point for per struct back repo declarations
	BackRepoDummyAgent BackRepoDummyAgentStruct

	BackRepoEngine BackRepoEngineStruct

	BackRepoEvent BackRepoEventStruct

	BackRepoGongsimCommand BackRepoGongsimCommandStruct

	BackRepoGongsimStatus BackRepoGongsimStatusStruct

	CommitFromBackNb uint // records commit increments when performed by the back

	PushFromFrontNb uint // records commit increments when performed by the front
	// contains filtered or unexported fields
}

BackRepoStruct supports callback functions

func NewBackRepo

func NewBackRepo(stage *models.StageStruct, filename string) (backRepo *BackRepoStruct)

func (*BackRepoStruct) Backup

func (backRepo *BackRepoStruct) Backup(stage *models.StageStruct, dirPath string)

Backup the BackRepoStruct

func (*BackRepoStruct) BackupXL

func (backRepo *BackRepoStruct) BackupXL(stage *models.StageStruct, dirPath string)

Backup in XL the BackRepoStruct

func (*BackRepoStruct) Checkout

func (backRepo *BackRepoStruct) Checkout(stage *models.StageStruct)

Checkout the database into the stage

func (*BackRepoStruct) CheckoutDummyAgent

func (backRepo *BackRepoStruct) CheckoutDummyAgent(dummyagent *models.DummyAgent)

CommitDummyAgent allows checkout of a single dummyagent (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutEngine

func (backRepo *BackRepoStruct) CheckoutEngine(engine *models.Engine)

CommitEngine allows checkout of a single engine (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutEvent

func (backRepo *BackRepoStruct) CheckoutEvent(event *models.Event)

CommitEvent allows checkout of a single event (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutGongsimCommand

func (backRepo *BackRepoStruct) CheckoutGongsimCommand(gongsimcommand *models.GongsimCommand)

CommitGongsimCommand allows checkout of a single gongsimcommand (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutGongsimStatus

func (backRepo *BackRepoStruct) CheckoutGongsimStatus(gongsimstatus *models.GongsimStatus)

CommitGongsimStatus allows checkout of a single gongsimstatus (if already staged and with a BackRepo id)

func (*BackRepoStruct) Commit

func (backRepo *BackRepoStruct) Commit(stage *models.StageStruct)

Commit the BackRepoStruct inner variables and link to the database

func (*BackRepoStruct) CommitDummyAgent

func (backRepo *BackRepoStruct) CommitDummyAgent(dummyagent *models.DummyAgent)

CommitDummyAgent allows commit of a single dummyagent (if already staged)

func (*BackRepoStruct) CommitEngine

func (backRepo *BackRepoStruct) CommitEngine(engine *models.Engine)

CommitEngine allows commit of a single engine (if already staged)

func (*BackRepoStruct) CommitEvent

func (backRepo *BackRepoStruct) CommitEvent(event *models.Event)

CommitEvent allows commit of a single event (if already staged)

func (*BackRepoStruct) CommitGongsimCommand

func (backRepo *BackRepoStruct) CommitGongsimCommand(gongsimcommand *models.GongsimCommand)

CommitGongsimCommand allows commit of a single gongsimcommand (if already staged)

func (*BackRepoStruct) CommitGongsimStatus

func (backRepo *BackRepoStruct) CommitGongsimStatus(gongsimstatus *models.GongsimStatus)

CommitGongsimStatus allows commit of a single gongsimstatus (if already staged)

func (*BackRepoStruct) GetLastCommitFromBackNb

func (backRepo *BackRepoStruct) GetLastCommitFromBackNb() uint

func (*BackRepoStruct) GetLastPushFromFrontNb

func (backRepo *BackRepoStruct) GetLastPushFromFrontNb() uint

func (*BackRepoStruct) GetStage

func (backRepo *BackRepoStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoStruct) IncrementCommitFromBackNb

func (backRepo *BackRepoStruct) IncrementCommitFromBackNb() uint

func (*BackRepoStruct) IncrementPushFromFrontNb

func (backRepo *BackRepoStruct) IncrementPushFromFrontNb() uint

func (*BackRepoStruct) Restore

func (backRepo *BackRepoStruct) Restore(stage *models.StageStruct, dirPath string)

Restore the database into the back repo

func (*BackRepoStruct) RestoreXL

func (backRepo *BackRepoStruct) RestoreXL(stage *models.StageStruct, dirPath string)

Restore the database into the back repo

func (*BackRepoStruct) SubscribeToCommitNb

func (backRepoStruct *BackRepoStruct) SubscribeToCommitNb() <-chan int

type DummyAgentAPI

type DummyAgentAPI struct {
	gorm.Model

	models.DummyAgent_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	DummyAgentPointersEncoding DummyAgentPointersEncoding
}

DummyAgentAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model dummyagentAPI

type DummyAgentDB

type DummyAgentDB struct {
	gorm.Model

	// Declation for basic field dummyagentDB.TechName
	TechName_Data sql.NullString

	// Declation for basic field dummyagentDB.Name
	Name_Data sql.NullString

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	DummyAgentPointersEncoding
}

DummyAgentDB describes a dummyagent in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model dummyagentDB

func (*DummyAgentDB) CopyBasicFieldsFromDummyAgent

func (dummyagentDB *DummyAgentDB) CopyBasicFieldsFromDummyAgent(dummyagent *models.DummyAgent)

CopyBasicFieldsFromDummyAgent

func (*DummyAgentDB) CopyBasicFieldsFromDummyAgentWOP

func (dummyagentDB *DummyAgentDB) CopyBasicFieldsFromDummyAgentWOP(dummyagent *DummyAgentWOP)

CopyBasicFieldsFromDummyAgentWOP

func (*DummyAgentDB) CopyBasicFieldsFromDummyAgent_WOP

func (dummyagentDB *DummyAgentDB) CopyBasicFieldsFromDummyAgent_WOP(dummyagent *models.DummyAgent_WOP)

CopyBasicFieldsFromDummyAgent_WOP

func (*DummyAgentDB) CopyBasicFieldsToDummyAgent

func (dummyagentDB *DummyAgentDB) CopyBasicFieldsToDummyAgent(dummyagent *models.DummyAgent)

CopyBasicFieldsToDummyAgent

func (*DummyAgentDB) CopyBasicFieldsToDummyAgentWOP

func (dummyagentDB *DummyAgentDB) CopyBasicFieldsToDummyAgentWOP(dummyagent *DummyAgentWOP)

CopyBasicFieldsToDummyAgentWOP

func (*DummyAgentDB) CopyBasicFieldsToDummyAgent_WOP

func (dummyagentDB *DummyAgentDB) CopyBasicFieldsToDummyAgent_WOP(dummyagent *models.DummyAgent_WOP)

CopyBasicFieldsToDummyAgent_WOP

func (*DummyAgentDB) DecodePointers

func (dummyagentDB *DummyAgentDB) DecodePointers(backRepo *BackRepoStruct, dummyagent *models.DummyAgent)

type DummyAgentDBResponse

type DummyAgentDBResponse struct {
	DummyAgentDB
}

DummyAgentDBResponse provides response swagger:response dummyagentDBResponse

type DummyAgentDBs

type DummyAgentDBs []DummyAgentDB

DummyAgentDBs arrays dummyagentDBs swagger:response dummyagentDBsResponse

type DummyAgentPointersEncoding

type DummyAgentPointersEncoding struct {
}

DummyAgentPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type DummyAgentWOP

type DummyAgentWOP struct {
	ID int `xlsx:"0"`

	TechName string `xlsx:"1"`

	Name string `xlsx:"2"`
}

DummyAgentWOP is a DummyAgent without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

type EngineAPI

type EngineAPI struct {
	gorm.Model

	models.Engine_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	EnginePointersEncoding EnginePointersEncoding
}

EngineAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model engineAPI

type EngineDB

type EngineDB struct {
	gorm.Model

	// Declation for basic field engineDB.Name
	Name_Data sql.NullString

	// Declation for basic field engineDB.EndTime
	EndTime_Data sql.NullString

	// Declation for basic field engineDB.CurrentTime
	CurrentTime_Data sql.NullString

	// Declation for basic field engineDB.SecondsSinceStart
	SecondsSinceStart_Data sql.NullFloat64

	// Declation for basic field engineDB.Fired
	Fired_Data sql.NullInt64

	// Declation for basic field engineDB.ControlMode
	ControlMode_Data sql.NullString

	// Declation for basic field engineDB.State
	State_Data sql.NullString

	// Declation for basic field engineDB.Speed
	Speed_Data sql.NullFloat64

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	EnginePointersEncoding
}

EngineDB describes a engine in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model engineDB

func (*EngineDB) CopyBasicFieldsFromEngine

func (engineDB *EngineDB) CopyBasicFieldsFromEngine(engine *models.Engine)

CopyBasicFieldsFromEngine

func (*EngineDB) CopyBasicFieldsFromEngineWOP

func (engineDB *EngineDB) CopyBasicFieldsFromEngineWOP(engine *EngineWOP)

CopyBasicFieldsFromEngineWOP

func (*EngineDB) CopyBasicFieldsFromEngine_WOP

func (engineDB *EngineDB) CopyBasicFieldsFromEngine_WOP(engine *models.Engine_WOP)

CopyBasicFieldsFromEngine_WOP

func (*EngineDB) CopyBasicFieldsToEngine

func (engineDB *EngineDB) CopyBasicFieldsToEngine(engine *models.Engine)

CopyBasicFieldsToEngine

func (*EngineDB) CopyBasicFieldsToEngineWOP

func (engineDB *EngineDB) CopyBasicFieldsToEngineWOP(engine *EngineWOP)

CopyBasicFieldsToEngineWOP

func (*EngineDB) CopyBasicFieldsToEngine_WOP

func (engineDB *EngineDB) CopyBasicFieldsToEngine_WOP(engine *models.Engine_WOP)

CopyBasicFieldsToEngine_WOP

func (*EngineDB) DecodePointers

func (engineDB *EngineDB) DecodePointers(backRepo *BackRepoStruct, engine *models.Engine)

type EngineDBResponse

type EngineDBResponse struct {
	EngineDB
}

EngineDBResponse provides response swagger:response engineDBResponse

type EngineDBs

type EngineDBs []EngineDB

EngineDBs arrays engineDBs swagger:response engineDBsResponse

type EnginePointersEncoding

type EnginePointersEncoding struct {
}

EnginePointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type EngineWOP

type EngineWOP struct {
	ID int `xlsx:"0"`

	Name string `xlsx:"1"`

	EndTime string `xlsx:"2"`

	CurrentTime string `xlsx:"3"`

	SecondsSinceStart float64 `xlsx:"4"`

	Fired int `xlsx:"5"`

	ControlMode models.ControlMode `xlsx:"6"`

	State models.EngineState `xlsx:"7"`

	Speed float64 `xlsx:"8"`
}

EngineWOP is a Engine without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

type EventAPI

type EventAPI struct {
	gorm.Model

	models.Event_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	EventPointersEncoding EventPointersEncoding
}

EventAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model eventAPI

type EventDB

type EventDB struct {
	gorm.Model

	// Declation for basic field eventDB.Name
	Name_Data sql.NullString

	// Declation for basic field eventDB.Duration
	Duration_Data sql.NullInt64

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	EventPointersEncoding
}

EventDB describes a event in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model eventDB

func (*EventDB) CopyBasicFieldsFromEvent

func (eventDB *EventDB) CopyBasicFieldsFromEvent(event *models.Event)

CopyBasicFieldsFromEvent

func (*EventDB) CopyBasicFieldsFromEventWOP

func (eventDB *EventDB) CopyBasicFieldsFromEventWOP(event *EventWOP)

CopyBasicFieldsFromEventWOP

func (*EventDB) CopyBasicFieldsFromEvent_WOP

func (eventDB *EventDB) CopyBasicFieldsFromEvent_WOP(event *models.Event_WOP)

CopyBasicFieldsFromEvent_WOP

func (*EventDB) CopyBasicFieldsToEvent

func (eventDB *EventDB) CopyBasicFieldsToEvent(event *models.Event)

CopyBasicFieldsToEvent

func (*EventDB) CopyBasicFieldsToEventWOP

func (eventDB *EventDB) CopyBasicFieldsToEventWOP(event *EventWOP)

CopyBasicFieldsToEventWOP

func (*EventDB) CopyBasicFieldsToEvent_WOP

func (eventDB *EventDB) CopyBasicFieldsToEvent_WOP(event *models.Event_WOP)

CopyBasicFieldsToEvent_WOP

func (*EventDB) DecodePointers

func (eventDB *EventDB) DecodePointers(backRepo *BackRepoStruct, event *models.Event)

type EventDBResponse

type EventDBResponse struct {
	EventDB
}

EventDBResponse provides response swagger:response eventDBResponse

type EventDBs

type EventDBs []EventDB

EventDBs arrays eventDBs swagger:response eventDBsResponse

type EventPointersEncoding

type EventPointersEncoding struct {
}

EventPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type EventWOP

type EventWOP struct {
	ID int `xlsx:"0"`

	Name string `xlsx:"1"`

	Duration time.Duration `xlsx:"2"`
}

EventWOP is a Event without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

type GongsimCommandAPI

type GongsimCommandAPI struct {
	gorm.Model

	models.GongsimCommand_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	GongsimCommandPointersEncoding GongsimCommandPointersEncoding
}

GongsimCommandAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model gongsimcommandAPI

type GongsimCommandDB

type GongsimCommandDB struct {
	gorm.Model

	// Declation for basic field gongsimcommandDB.Name
	Name_Data sql.NullString

	// Declation for basic field gongsimcommandDB.Command
	Command_Data sql.NullString

	// Declation for basic field gongsimcommandDB.CommandDate
	CommandDate_Data sql.NullString

	// Declation for basic field gongsimcommandDB.SpeedCommandType
	SpeedCommandType_Data sql.NullString

	// Declation for basic field gongsimcommandDB.DateSpeedCommand
	DateSpeedCommand_Data sql.NullString

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	GongsimCommandPointersEncoding
}

GongsimCommandDB describes a gongsimcommand in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model gongsimcommandDB

func (*GongsimCommandDB) CopyBasicFieldsFromGongsimCommand

func (gongsimcommandDB *GongsimCommandDB) CopyBasicFieldsFromGongsimCommand(gongsimcommand *models.GongsimCommand)

CopyBasicFieldsFromGongsimCommand

func (*GongsimCommandDB) CopyBasicFieldsFromGongsimCommandWOP

func (gongsimcommandDB *GongsimCommandDB) CopyBasicFieldsFromGongsimCommandWOP(gongsimcommand *GongsimCommandWOP)

CopyBasicFieldsFromGongsimCommandWOP

func (*GongsimCommandDB) CopyBasicFieldsFromGongsimCommand_WOP

func (gongsimcommandDB *GongsimCommandDB) CopyBasicFieldsFromGongsimCommand_WOP(gongsimcommand *models.GongsimCommand_WOP)

CopyBasicFieldsFromGongsimCommand_WOP

func (*GongsimCommandDB) CopyBasicFieldsToGongsimCommand

func (gongsimcommandDB *GongsimCommandDB) CopyBasicFieldsToGongsimCommand(gongsimcommand *models.GongsimCommand)

CopyBasicFieldsToGongsimCommand

func (*GongsimCommandDB) CopyBasicFieldsToGongsimCommandWOP

func (gongsimcommandDB *GongsimCommandDB) CopyBasicFieldsToGongsimCommandWOP(gongsimcommand *GongsimCommandWOP)

CopyBasicFieldsToGongsimCommandWOP

func (*GongsimCommandDB) CopyBasicFieldsToGongsimCommand_WOP

func (gongsimcommandDB *GongsimCommandDB) CopyBasicFieldsToGongsimCommand_WOP(gongsimcommand *models.GongsimCommand_WOP)

CopyBasicFieldsToGongsimCommand_WOP

func (*GongsimCommandDB) DecodePointers

func (gongsimcommandDB *GongsimCommandDB) DecodePointers(backRepo *BackRepoStruct, gongsimcommand *models.GongsimCommand)

type GongsimCommandDBResponse

type GongsimCommandDBResponse struct {
	GongsimCommandDB
}

GongsimCommandDBResponse provides response swagger:response gongsimcommandDBResponse

type GongsimCommandDBs

type GongsimCommandDBs []GongsimCommandDB

GongsimCommandDBs arrays gongsimcommandDBs swagger:response gongsimcommandDBsResponse

type GongsimCommandPointersEncoding

type GongsimCommandPointersEncoding struct {

	// field Engine is a pointer to another Struct (optional or 0..1)
	// This field is generated into another field to enable AS ONE association
	EngineID sql.NullInt64
}

GongsimCommandPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type GongsimCommandWOP

type GongsimCommandWOP struct {
	ID int `xlsx:"0"`

	Name string `xlsx:"1"`

	Command models.GongsimCommandType `xlsx:"2"`

	CommandDate string `xlsx:"3"`

	SpeedCommandType models.SpeedCommandType `xlsx:"4"`

	DateSpeedCommand string `xlsx:"5"`
}

GongsimCommandWOP is a GongsimCommand without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

type GongsimStatusAPI

type GongsimStatusAPI struct {
	gorm.Model

	models.GongsimStatus_WOP

	// encoding of pointers
	// for API, it cannot be embedded
	GongsimStatusPointersEncoding GongsimStatusPointersEncoding
}

GongsimStatusAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model gongsimstatusAPI

type GongsimStatusDB

type GongsimStatusDB struct {
	gorm.Model

	// Declation for basic field gongsimstatusDB.Name
	Name_Data sql.NullString

	// Declation for basic field gongsimstatusDB.CurrentCommand
	CurrentCommand_Data sql.NullString

	// Declation for basic field gongsimstatusDB.CompletionDate
	CompletionDate_Data sql.NullString

	// Declation for basic field gongsimstatusDB.CurrentSpeedCommand
	CurrentSpeedCommand_Data sql.NullString

	// Declation for basic field gongsimstatusDB.SpeedCommandCompletionDate
	SpeedCommandCompletionDate_Data sql.NullString

	// encoding of pointers
	// for GORM serialization, it is necessary to embed to Pointer Encoding declaration
	GongsimStatusPointersEncoding
}

GongsimStatusDB describes a gongsimstatus in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model gongsimstatusDB

func (*GongsimStatusDB) CopyBasicFieldsFromGongsimStatus

func (gongsimstatusDB *GongsimStatusDB) CopyBasicFieldsFromGongsimStatus(gongsimstatus *models.GongsimStatus)

CopyBasicFieldsFromGongsimStatus

func (*GongsimStatusDB) CopyBasicFieldsFromGongsimStatusWOP

func (gongsimstatusDB *GongsimStatusDB) CopyBasicFieldsFromGongsimStatusWOP(gongsimstatus *GongsimStatusWOP)

CopyBasicFieldsFromGongsimStatusWOP

func (*GongsimStatusDB) CopyBasicFieldsFromGongsimStatus_WOP

func (gongsimstatusDB *GongsimStatusDB) CopyBasicFieldsFromGongsimStatus_WOP(gongsimstatus *models.GongsimStatus_WOP)

CopyBasicFieldsFromGongsimStatus_WOP

func (*GongsimStatusDB) CopyBasicFieldsToGongsimStatus

func (gongsimstatusDB *GongsimStatusDB) CopyBasicFieldsToGongsimStatus(gongsimstatus *models.GongsimStatus)

CopyBasicFieldsToGongsimStatus

func (*GongsimStatusDB) CopyBasicFieldsToGongsimStatusWOP

func (gongsimstatusDB *GongsimStatusDB) CopyBasicFieldsToGongsimStatusWOP(gongsimstatus *GongsimStatusWOP)

CopyBasicFieldsToGongsimStatusWOP

func (*GongsimStatusDB) CopyBasicFieldsToGongsimStatus_WOP

func (gongsimstatusDB *GongsimStatusDB) CopyBasicFieldsToGongsimStatus_WOP(gongsimstatus *models.GongsimStatus_WOP)

CopyBasicFieldsToGongsimStatus_WOP

func (*GongsimStatusDB) DecodePointers

func (gongsimstatusDB *GongsimStatusDB) DecodePointers(backRepo *BackRepoStruct, gongsimstatus *models.GongsimStatus)

type GongsimStatusDBResponse

type GongsimStatusDBResponse struct {
	GongsimStatusDB
}

GongsimStatusDBResponse provides response swagger:response gongsimstatusDBResponse

type GongsimStatusDBs

type GongsimStatusDBs []GongsimStatusDB

GongsimStatusDBs arrays gongsimstatusDBs swagger:response gongsimstatusDBsResponse

type GongsimStatusPointersEncoding

type GongsimStatusPointersEncoding struct {
}

GongsimStatusPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct

type GongsimStatusWOP

type GongsimStatusWOP struct {
	ID int `xlsx:"0"`

	Name string `xlsx:"1"`

	CurrentCommand models.GongsimCommandType `xlsx:"2"`

	CompletionDate string `xlsx:"3"`

	CurrentSpeedCommand models.SpeedCommandType `xlsx:"4"`

	SpeedCommandCompletionDate string `xlsx:"5"`
}

GongsimStatusWOP is a GongsimStatus without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint

type GongstructDB

type GongstructDB interface {
	// insertion point for generic types
	// "int" is present to handle the case when no struct is present
	int | DummyAgentDB | EngineDB | EventDB | GongsimCommandDB | GongsimStatusDB
}

type IntSlice

type IntSlice []int

func (*IntSlice) Scan

func (s *IntSlice) Scan(value interface{}) error

Scan makes IntSlice implement the sql.Scanner interface.

func (IntSlice) Value

func (s IntSlice) Value() (driver.Value, error)

Value makes IntSlice implement the driver.Valuer interface.

Jump to

Keyboard shortcuts

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