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
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
generated code - do not edit
Index ¶
- Variables
- func CopyBackRepoToBackRepoData(backRepo *BackRepoStruct, backRepoData *BackRepoData)
- func GetID[T models.Gongstruct](stage *models.StageStruct, backRepo *BackRepoStruct, instance *T) (id int)
- func GetIDPointer[T models.PointerToGongstruct](stage *models.StageStruct, backRepo *BackRepoStruct, instance T) (id int)
- func GetInstanceDBFromInstance[T models.Gongstruct, T2 GongstructDB](stage *models.StageStruct, backRepo *BackRepoStruct, instance *T) (ret *T2)
- func GetReverseFieldOwner[T models.Gongstruct](stage *models.StageStruct, backRepo *BackRepoStruct, instance *T, ...) (res any)
- func GetReverseFieldOwnerName(stage *models.StageStruct, backRepo *BackRepoStruct, instance any, ...) (res string)
- type BackRepoButtonStruct
- func (backRepoButton *BackRepoButtonStruct) Backup(dirPath string)
- func (backRepoButton *BackRepoButtonStruct) BackupXL(file *xlsx.File)
- func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseOne() (Error error)
- func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseOneInstance(buttonDB *ButtonDB) (Error error)
- func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, buttonDB *ButtonDB) (Error error)
- func (backRepoButton *BackRepoButtonStruct) CommitDeleteInstance(id uint) (Error error)
- func (backRepoButton *BackRepoButtonStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
- func (backRepoButton *BackRepoButtonStruct) CommitPhaseOneInstance(button *models.Button) (Error error)
- func (backRepoButton *BackRepoButtonStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoButton *BackRepoButtonStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, button *models.Button) (Error error)
- func (backRepoButton *BackRepoButtonStruct) GetButtonDBFromButtonPtr(button *models.Button) (buttonDB *ButtonDB)
- func (backRepoButton *BackRepoButtonStruct) GetDB() db.DBInterface
- func (backRepoButton *BackRepoButtonStruct) GetStage() (stage *models.StageStruct)
- func (backRepoButton *BackRepoButtonStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
- func (backRepoButton *BackRepoButtonStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, button *models.Button) (Error error)
- func (backRepoButton *BackRepoButtonStruct) RestorePhaseOne(dirPath string)
- func (backRepoButton *BackRepoButtonStruct) RestorePhaseTwo()
- func (backRepoButton *BackRepoButtonStruct) RestoreXLPhaseOne(file *xlsx.File)
- type BackRepoData
- type BackRepoGroupStruct
- func (backRepoGroup *BackRepoGroupStruct) Backup(dirPath string)
- func (backRepoGroup *BackRepoGroupStruct) BackupXL(file *xlsx.File)
- func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseOne() (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseOneInstance(groupDB *GroupDB) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, groupDB *GroupDB) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CommitDeleteInstance(id uint) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CommitPhaseOneInstance(group *models.Group) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, group *models.Group) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) GetDB() db.DBInterface
- func (backRepoGroup *BackRepoGroupStruct) GetGroupDBFromGroupPtr(group *models.Group) (groupDB *GroupDB)
- func (backRepoGroup *BackRepoGroupStruct) GetStage() (stage *models.StageStruct)
- func (backRepoGroup *BackRepoGroupStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, group *models.Group) (Error error)
- func (backRepoGroup *BackRepoGroupStruct) RestorePhaseOne(dirPath string)
- func (backRepoGroup *BackRepoGroupStruct) RestorePhaseTwo()
- func (backRepoGroup *BackRepoGroupStruct) RestoreXLPhaseOne(file *xlsx.File)
- type BackRepoLayoutStruct
- func (backRepoLayout *BackRepoLayoutStruct) Backup(dirPath string)
- func (backRepoLayout *BackRepoLayoutStruct) BackupXL(file *xlsx.File)
- func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseOne() (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseOneInstance(layoutDB *LayoutDB) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, layoutDB *LayoutDB) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CommitDeleteInstance(id uint) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseOneInstance(layout *models.Layout) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, layout *models.Layout) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) GetDB() db.DBInterface
- func (backRepoLayout *BackRepoLayoutStruct) GetLayoutDBFromLayoutPtr(layout *models.Layout) (layoutDB *LayoutDB)
- func (backRepoLayout *BackRepoLayoutStruct) GetStage() (stage *models.StageStruct)
- func (backRepoLayout *BackRepoLayoutStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, layout *models.Layout) (Error error)
- func (backRepoLayout *BackRepoLayoutStruct) RestorePhaseOne(dirPath string)
- func (backRepoLayout *BackRepoLayoutStruct) RestorePhaseTwo()
- func (backRepoLayout *BackRepoLayoutStruct) RestoreXLPhaseOne(file *xlsx.File)
- type BackRepoStruct
- func (backRepo *BackRepoStruct) Backup(stage *models.StageStruct, dirPath string)
- func (backRepo *BackRepoStruct) BackupXL(stage *models.StageStruct, dirPath string)
- func (backRepo *BackRepoStruct) Checkout(stage *models.StageStruct)
- func (backRepo *BackRepoStruct) CheckoutButton(button *models.Button)
- func (backRepo *BackRepoStruct) CheckoutGroup(group *models.Group)
- func (backRepo *BackRepoStruct) CheckoutLayout(layout *models.Layout)
- func (backRepo *BackRepoStruct) Commit(stage *models.StageStruct)
- func (backRepo *BackRepoStruct) CommitButton(button *models.Button)
- func (backRepo *BackRepoStruct) CommitGroup(group *models.Group)
- func (backRepo *BackRepoStruct) CommitLayout(layout *models.Layout)
- func (backRepo *BackRepoStruct) GetLastCommitFromBackNb() uint
- func (backRepo *BackRepoStruct) GetLastPushFromFrontNb() uint
- func (backRepo *BackRepoStruct) GetStage() (stage *models.StageStruct)
- func (backRepo *BackRepoStruct) IncrementCommitFromBackNb() uint
- func (backRepo *BackRepoStruct) IncrementPushFromFrontNb() uint
- func (backRepo *BackRepoStruct) Restore(stage *models.StageStruct, dirPath string)
- func (backRepo *BackRepoStruct) RestoreXL(stage *models.StageStruct, dirPath string)
- func (backRepoStruct *BackRepoStruct) SubscribeToCommitNb(ctx context.Context) <-chan int
- type ButtonAPI
- type ButtonDB
- func (buttonDB *ButtonDB) CopyBasicFieldsFromButton(button *models.Button)
- func (buttonDB *ButtonDB) CopyBasicFieldsFromButtonWOP(button *ButtonWOP)
- func (buttonDB *ButtonDB) CopyBasicFieldsFromButton_WOP(button *models.Button_WOP)
- func (buttonDB *ButtonDB) CopyBasicFieldsToButton(button *models.Button)
- func (buttonDB *ButtonDB) CopyBasicFieldsToButtonWOP(button *ButtonWOP)
- func (buttonDB *ButtonDB) CopyBasicFieldsToButton_WOP(button *models.Button_WOP)
- func (buttonDB *ButtonDB) DecodePointers(backRepo *BackRepoStruct, button *models.Button)
- type ButtonDBResponse
- type ButtonDBs
- type ButtonPointersEncoding
- type ButtonWOP
- type DBLite
- func (db *DBLite) Create(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Delete(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Find(instanceDBs any) (db.DBInterface, error)
- func (db *DBLite) First(instanceDB any, conds ...any) (db.DBInterface, error)
- func (db *DBLite) Model(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Save(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Unscoped() (db.DBInterface, error)
- func (db *DBLite) Updates(instanceDB any) (db.DBInterface, error)
- type GongstructDB
- type GroupAPI
- type GroupDB
- func (groupDB *GroupDB) CopyBasicFieldsFromGroup(group *models.Group)
- func (groupDB *GroupDB) CopyBasicFieldsFromGroupWOP(group *GroupWOP)
- func (groupDB *GroupDB) CopyBasicFieldsFromGroup_WOP(group *models.Group_WOP)
- func (groupDB *GroupDB) CopyBasicFieldsToGroup(group *models.Group)
- func (groupDB *GroupDB) CopyBasicFieldsToGroupWOP(group *GroupWOP)
- func (groupDB *GroupDB) CopyBasicFieldsToGroup_WOP(group *models.Group_WOP)
- func (groupDB *GroupDB) DecodePointers(backRepo *BackRepoStruct, group *models.Group)
- type GroupDBResponse
- type GroupDBs
- type GroupPointersEncoding
- type GroupWOP
- type IntSlice
- type LayoutAPI
- type LayoutDB
- func (layoutDB *LayoutDB) CopyBasicFieldsFromLayout(layout *models.Layout)
- func (layoutDB *LayoutDB) CopyBasicFieldsFromLayoutWOP(layout *LayoutWOP)
- func (layoutDB *LayoutDB) CopyBasicFieldsFromLayout_WOP(layout *models.Layout_WOP)
- func (layoutDB *LayoutDB) CopyBasicFieldsToLayout(layout *models.Layout)
- func (layoutDB *LayoutDB) CopyBasicFieldsToLayoutWOP(layout *LayoutWOP)
- func (layoutDB *LayoutDB) CopyBasicFieldsToLayout_WOP(layout *models.Layout_WOP)
- func (layoutDB *LayoutDB) DecodePointers(backRepo *BackRepoStruct, layout *models.Layout)
- type LayoutDBResponse
- type LayoutDBs
- type LayoutPointersEncoding
- type LayoutWOP
Constants ¶
This section is empty.
Variables ¶
var BackRepoButtonid_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
var BackRepoGroupid_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
var BackRepoLayoutid_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
var Button_Fields = []string{
"ID",
"Name",
"Label",
"Icon",
}
var Group_Fields = []string{
"ID",
"Name",
"Percentage",
}
var Layout_Fields = []string{
"ID",
"Name",
}
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( stage *models.StageStruct, backRepo *BackRepoStruct, instance any, reverseField *models.ReverseField) (res string)
Types ¶
type BackRepoButtonStruct ¶
type BackRepoButtonStruct struct { // stores ButtonDB according to their gorm ID Map_ButtonDBID_ButtonDB map[uint]*ButtonDB // stores ButtonDB ID according to Button address Map_ButtonPtr_ButtonDBID map[*models.Button]uint // stores Button according to their gorm ID Map_ButtonDBID_ButtonPtr map[uint]*models.Button // contains filtered or unexported fields }
func (*BackRepoButtonStruct) Backup ¶
func (backRepoButton *BackRepoButtonStruct) Backup(dirPath string)
Backup generates a json file from a slice of all ButtonDB instances in the backrepo
func (*BackRepoButtonStruct) BackupXL ¶
func (backRepoButton *BackRepoButtonStruct) BackupXL(file *xlsx.File)
Backup generates a json file from a slice of all ButtonDB instances in the backrepo
func (*BackRepoButtonStruct) CheckoutPhaseOne ¶
func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseOne() (Error error)
BackRepoButton.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 (*BackRepoButtonStruct) CheckoutPhaseOneInstance ¶
func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseOneInstance(buttonDB *ButtonDB) (Error error)
CheckoutPhaseOneInstance takes a buttonDB that has been found in the DB, updates the backRepo and stages the models version of the buttonDB
func (*BackRepoButtonStruct) CheckoutPhaseTwo ¶
func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoButton.CheckoutPhaseTwo Checkouts all staged instances of Button to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoButtonStruct) CheckoutPhaseTwoInstance ¶
func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, buttonDB *ButtonDB) (Error error)
BackRepoButton.CheckoutPhaseTwoInstance Checkouts staged instances of Button to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoButtonStruct) CommitDeleteInstance ¶
func (backRepoButton *BackRepoButtonStruct) CommitDeleteInstance(id uint) (Error error)
BackRepoButton.CommitDeleteInstance commits deletion of Button to the BackRepo
func (*BackRepoButtonStruct) CommitPhaseOne ¶
func (backRepoButton *BackRepoButtonStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
BackRepoButton.CommitPhaseOne commits all staged instances of Button 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 (*BackRepoButtonStruct) CommitPhaseOneInstance ¶
func (backRepoButton *BackRepoButtonStruct) CommitPhaseOneInstance(button *models.Button) (Error error)
BackRepoButton.CommitPhaseOneInstance commits button staged instances of Button 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 (*BackRepoButtonStruct) CommitPhaseTwo ¶
func (backRepoButton *BackRepoButtonStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoButton.CommitPhaseTwo commits all staged instances of Button to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoButtonStruct) CommitPhaseTwoInstance ¶
func (backRepoButton *BackRepoButtonStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, button *models.Button) (Error error)
BackRepoButton.CommitPhaseTwoInstance commits {{structname }} of models.Button to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoButtonStruct) GetButtonDBFromButtonPtr ¶
func (backRepoButton *BackRepoButtonStruct) GetButtonDBFromButtonPtr(button *models.Button) (buttonDB *ButtonDB)
GetButtonDBFromButtonPtr is a handy function to access the back repo instance from the stage instance
func (*BackRepoButtonStruct) GetDB ¶
func (backRepoButton *BackRepoButtonStruct) GetDB() db.DBInterface
func (*BackRepoButtonStruct) GetStage ¶
func (backRepoButton *BackRepoButtonStruct) GetStage() (stage *models.StageStruct)
func (*BackRepoButtonStruct) ResetReversePointers ¶
func (backRepoButton *BackRepoButtonStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
BackRepoButton.ResetReversePointers commits all staged instances of Button to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoButtonStruct) ResetReversePointersInstance ¶
func (backRepoButton *BackRepoButtonStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, button *models.Button) (Error error)
func (*BackRepoButtonStruct) RestorePhaseOne ¶
func (backRepoButton *BackRepoButtonStruct) RestorePhaseOne(dirPath string)
RestorePhaseOne read the file "ButtonDB.json" in dirPath that stores an array of ButtonDB and stores it in the database the map BackRepoButtonid_atBckpTime_newID is updated accordingly
func (*BackRepoButtonStruct) RestorePhaseTwo ¶
func (backRepoButton *BackRepoButtonStruct) RestorePhaseTwo()
RestorePhaseTwo uses all map BackRepo<Button>id_atBckpTime_newID to compute new index
func (*BackRepoButtonStruct) RestoreXLPhaseOne ¶
func (backRepoButton *BackRepoButtonStruct) RestoreXLPhaseOne(file *xlsx.File)
RestoreXL from the "Button" sheet all ButtonDB instances
type BackRepoData ¶
type BackRepoGroupStruct ¶
type BackRepoGroupStruct struct { // stores GroupDB according to their gorm ID Map_GroupDBID_GroupDB map[uint]*GroupDB // stores GroupDB ID according to Group address Map_GroupPtr_GroupDBID map[*models.Group]uint // stores Group according to their gorm ID Map_GroupDBID_GroupPtr map[uint]*models.Group // contains filtered or unexported fields }
func (*BackRepoGroupStruct) Backup ¶
func (backRepoGroup *BackRepoGroupStruct) Backup(dirPath string)
Backup generates a json file from a slice of all GroupDB instances in the backrepo
func (*BackRepoGroupStruct) BackupXL ¶
func (backRepoGroup *BackRepoGroupStruct) BackupXL(file *xlsx.File)
Backup generates a json file from a slice of all GroupDB instances in the backrepo
func (*BackRepoGroupStruct) CheckoutPhaseOne ¶
func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseOne() (Error error)
BackRepoGroup.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 (*BackRepoGroupStruct) CheckoutPhaseOneInstance ¶
func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseOneInstance(groupDB *GroupDB) (Error error)
CheckoutPhaseOneInstance takes a groupDB that has been found in the DB, updates the backRepo and stages the models version of the groupDB
func (*BackRepoGroupStruct) CheckoutPhaseTwo ¶
func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoGroup.CheckoutPhaseTwo Checkouts all staged instances of Group to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoGroupStruct) CheckoutPhaseTwoInstance ¶
func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, groupDB *GroupDB) (Error error)
BackRepoGroup.CheckoutPhaseTwoInstance Checkouts staged instances of Group to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoGroupStruct) CommitDeleteInstance ¶
func (backRepoGroup *BackRepoGroupStruct) CommitDeleteInstance(id uint) (Error error)
BackRepoGroup.CommitDeleteInstance commits deletion of Group to the BackRepo
func (*BackRepoGroupStruct) CommitPhaseOne ¶
func (backRepoGroup *BackRepoGroupStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
BackRepoGroup.CommitPhaseOne commits all staged instances of Group 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 (*BackRepoGroupStruct) CommitPhaseOneInstance ¶
func (backRepoGroup *BackRepoGroupStruct) CommitPhaseOneInstance(group *models.Group) (Error error)
BackRepoGroup.CommitPhaseOneInstance commits group staged instances of Group 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 (*BackRepoGroupStruct) CommitPhaseTwo ¶
func (backRepoGroup *BackRepoGroupStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoGroup.CommitPhaseTwo commits all staged instances of Group to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoGroupStruct) CommitPhaseTwoInstance ¶
func (backRepoGroup *BackRepoGroupStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, group *models.Group) (Error error)
BackRepoGroup.CommitPhaseTwoInstance commits {{structname }} of models.Group to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoGroupStruct) GetDB ¶
func (backRepoGroup *BackRepoGroupStruct) GetDB() db.DBInterface
func (*BackRepoGroupStruct) GetGroupDBFromGroupPtr ¶
func (backRepoGroup *BackRepoGroupStruct) GetGroupDBFromGroupPtr(group *models.Group) (groupDB *GroupDB)
GetGroupDBFromGroupPtr is a handy function to access the back repo instance from the stage instance
func (*BackRepoGroupStruct) GetStage ¶
func (backRepoGroup *BackRepoGroupStruct) GetStage() (stage *models.StageStruct)
func (*BackRepoGroupStruct) ResetReversePointers ¶
func (backRepoGroup *BackRepoGroupStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
BackRepoGroup.ResetReversePointers commits all staged instances of Group to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoGroupStruct) ResetReversePointersInstance ¶
func (backRepoGroup *BackRepoGroupStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, group *models.Group) (Error error)
func (*BackRepoGroupStruct) RestorePhaseOne ¶
func (backRepoGroup *BackRepoGroupStruct) RestorePhaseOne(dirPath string)
RestorePhaseOne read the file "GroupDB.json" in dirPath that stores an array of GroupDB and stores it in the database the map BackRepoGroupid_atBckpTime_newID is updated accordingly
func (*BackRepoGroupStruct) RestorePhaseTwo ¶
func (backRepoGroup *BackRepoGroupStruct) RestorePhaseTwo()
RestorePhaseTwo uses all map BackRepo<Group>id_atBckpTime_newID to compute new index
func (*BackRepoGroupStruct) RestoreXLPhaseOne ¶
func (backRepoGroup *BackRepoGroupStruct) RestoreXLPhaseOne(file *xlsx.File)
RestoreXL from the "Group" sheet all GroupDB instances
type BackRepoLayoutStruct ¶
type BackRepoLayoutStruct struct { // stores LayoutDB according to their gorm ID Map_LayoutDBID_LayoutDB map[uint]*LayoutDB // stores LayoutDB ID according to Layout address Map_LayoutPtr_LayoutDBID map[*models.Layout]uint // stores Layout according to their gorm ID Map_LayoutDBID_LayoutPtr map[uint]*models.Layout // contains filtered or unexported fields }
func (*BackRepoLayoutStruct) Backup ¶
func (backRepoLayout *BackRepoLayoutStruct) Backup(dirPath string)
Backup generates a json file from a slice of all LayoutDB instances in the backrepo
func (*BackRepoLayoutStruct) BackupXL ¶
func (backRepoLayout *BackRepoLayoutStruct) BackupXL(file *xlsx.File)
Backup generates a json file from a slice of all LayoutDB instances in the backrepo
func (*BackRepoLayoutStruct) CheckoutPhaseOne ¶
func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseOne() (Error error)
BackRepoLayout.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 (*BackRepoLayoutStruct) CheckoutPhaseOneInstance ¶
func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseOneInstance(layoutDB *LayoutDB) (Error error)
CheckoutPhaseOneInstance takes a layoutDB that has been found in the DB, updates the backRepo and stages the models version of the layoutDB
func (*BackRepoLayoutStruct) CheckoutPhaseTwo ¶
func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoLayout.CheckoutPhaseTwo Checkouts all staged instances of Layout to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoLayoutStruct) CheckoutPhaseTwoInstance ¶
func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, layoutDB *LayoutDB) (Error error)
BackRepoLayout.CheckoutPhaseTwoInstance Checkouts staged instances of Layout to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoLayoutStruct) CommitDeleteInstance ¶
func (backRepoLayout *BackRepoLayoutStruct) CommitDeleteInstance(id uint) (Error error)
BackRepoLayout.CommitDeleteInstance commits deletion of Layout to the BackRepo
func (*BackRepoLayoutStruct) CommitPhaseOne ¶
func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
BackRepoLayout.CommitPhaseOne commits all staged instances of Layout 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 (*BackRepoLayoutStruct) CommitPhaseOneInstance ¶
func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseOneInstance(layout *models.Layout) (Error error)
BackRepoLayout.CommitPhaseOneInstance commits layout staged instances of Layout 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 (*BackRepoLayoutStruct) CommitPhaseTwo ¶
func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoLayout.CommitPhaseTwo commits all staged instances of Layout to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoLayoutStruct) CommitPhaseTwoInstance ¶
func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, layout *models.Layout) (Error error)
BackRepoLayout.CommitPhaseTwoInstance commits {{structname }} of models.Layout to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoLayoutStruct) GetDB ¶
func (backRepoLayout *BackRepoLayoutStruct) GetDB() db.DBInterface
func (*BackRepoLayoutStruct) GetLayoutDBFromLayoutPtr ¶
func (backRepoLayout *BackRepoLayoutStruct) GetLayoutDBFromLayoutPtr(layout *models.Layout) (layoutDB *LayoutDB)
GetLayoutDBFromLayoutPtr is a handy function to access the back repo instance from the stage instance
func (*BackRepoLayoutStruct) GetStage ¶
func (backRepoLayout *BackRepoLayoutStruct) GetStage() (stage *models.StageStruct)
func (*BackRepoLayoutStruct) ResetReversePointers ¶
func (backRepoLayout *BackRepoLayoutStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
BackRepoLayout.ResetReversePointers commits all staged instances of Layout to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoLayoutStruct) ResetReversePointersInstance ¶
func (backRepoLayout *BackRepoLayoutStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, layout *models.Layout) (Error error)
func (*BackRepoLayoutStruct) RestorePhaseOne ¶
func (backRepoLayout *BackRepoLayoutStruct) RestorePhaseOne(dirPath string)
RestorePhaseOne read the file "LayoutDB.json" in dirPath that stores an array of LayoutDB and stores it in the database the map BackRepoLayoutid_atBckpTime_newID is updated accordingly
func (*BackRepoLayoutStruct) RestorePhaseTwo ¶
func (backRepoLayout *BackRepoLayoutStruct) RestorePhaseTwo()
RestorePhaseTwo uses all map BackRepo<Layout>id_atBckpTime_newID to compute new index
func (*BackRepoLayoutStruct) RestoreXLPhaseOne ¶
func (backRepoLayout *BackRepoLayoutStruct) RestoreXLPhaseOne(file *xlsx.File)
RestoreXL from the "Layout" sheet all LayoutDB instances
type BackRepoStruct ¶
type BackRepoStruct struct { // insertion point for per struct back repo declarations BackRepoButton BackRepoButtonStruct BackRepoGroup BackRepoGroupStruct BackRepoLayout BackRepoLayoutStruct 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) CheckoutButton ¶
func (backRepo *BackRepoStruct) CheckoutButton(button *models.Button)
CommitButton allows checkout of a single button (if already staged and with a BackRepo id)
func (*BackRepoStruct) CheckoutGroup ¶
func (backRepo *BackRepoStruct) CheckoutGroup(group *models.Group)
CommitGroup allows checkout of a single group (if already staged and with a BackRepo id)
func (*BackRepoStruct) CheckoutLayout ¶
func (backRepo *BackRepoStruct) CheckoutLayout(layout *models.Layout)
CommitLayout allows checkout of a single layout (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) CommitButton ¶
func (backRepo *BackRepoStruct) CommitButton(button *models.Button)
CommitButton allows commit of a single button (if already staged)
func (*BackRepoStruct) CommitGroup ¶
func (backRepo *BackRepoStruct) CommitGroup(group *models.Group)
CommitGroup allows commit of a single group (if already staged)
func (*BackRepoStruct) CommitLayout ¶
func (backRepo *BackRepoStruct) CommitLayout(layout *models.Layout)
CommitLayout allows commit of a single layout (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(ctx context.Context) <-chan int
type ButtonAPI ¶
type ButtonAPI struct { gorm.Model models.Button_WOP // encoding of pointers // for API, it cannot be embedded ButtonPointersEncoding ButtonPointersEncoding }
ButtonAPI 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 buttonAPI
type ButtonDB ¶
type ButtonDB struct { gorm.Model // Declation for basic field buttonDB.Name Name_Data sql.NullString // Declation for basic field buttonDB.Label Label_Data sql.NullString // Declation for basic field buttonDB.Icon Icon_Data sql.NullString // encoding of pointers // for GORM serialization, it is necessary to embed to Pointer Encoding declaration ButtonPointersEncoding }
ButtonDB describes a button 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 buttonDB
func (*ButtonDB) CopyBasicFieldsFromButton ¶
CopyBasicFieldsFromButton
func (*ButtonDB) CopyBasicFieldsFromButtonWOP ¶
CopyBasicFieldsFromButtonWOP
func (*ButtonDB) CopyBasicFieldsFromButton_WOP ¶
func (buttonDB *ButtonDB) CopyBasicFieldsFromButton_WOP(button *models.Button_WOP)
CopyBasicFieldsFromButton_WOP
func (*ButtonDB) CopyBasicFieldsToButton ¶
CopyBasicFieldsToButton
func (*ButtonDB) CopyBasicFieldsToButtonWOP ¶
CopyBasicFieldsToButtonWOP
func (*ButtonDB) CopyBasicFieldsToButton_WOP ¶
func (buttonDB *ButtonDB) CopyBasicFieldsToButton_WOP(button *models.Button_WOP)
CopyBasicFieldsToButton_WOP
func (*ButtonDB) DecodePointers ¶
func (buttonDB *ButtonDB) DecodePointers(backRepo *BackRepoStruct, button *models.Button)
type ButtonDBResponse ¶
type ButtonDBResponse struct {
ButtonDB
}
ButtonDBResponse provides response swagger:response buttonDBResponse
type ButtonDBs ¶
type ButtonDBs []ButtonDB
ButtonDBs arrays buttonDBs swagger:response buttonDBsResponse
type ButtonPointersEncoding ¶
type ButtonPointersEncoding struct { }
ButtonPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct
type ButtonWOP ¶
type ButtonWOP struct { ID int `xlsx:"0"` Name string `xlsx:"1"` Label string `xlsx:"2"` Icon string `xlsx:"3"` }
ButtonWOP is a Button without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint
type DBLite ¶
type DBLite struct {
// contains filtered or unexported fields
}
DBLite is an in-memory database implementation of DBInterface
func (*DBLite) Create ¶
func (db *DBLite) Create(instanceDB any) (db.DBInterface, error)
Create inserts a new record into the database
func (*DBLite) Delete ¶
func (db *DBLite) Delete(instanceDB any) (db.DBInterface, error)
Delete removes a record from the database
func (*DBLite) Find ¶
func (db *DBLite) Find(instanceDBs any) (db.DBInterface, error)
Find retrieves all records of a type from the database
func (*DBLite) Model ¶
func (db *DBLite) Model(instanceDB any) (db.DBInterface, error)
Model is a placeholder in this implementation
func (*DBLite) Save ¶
func (db *DBLite) Save(instanceDB any) (db.DBInterface, error)
Save updates or inserts a record into the database
type GongstructDB ¶
type GongstructDB interface { }
type GroupAPI ¶
type GroupAPI struct { gorm.Model models.Group_WOP // encoding of pointers // for API, it cannot be embedded GroupPointersEncoding GroupPointersEncoding }
GroupAPI 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 groupAPI
type GroupDB ¶
type GroupDB struct { gorm.Model // Declation for basic field groupDB.Name Name_Data sql.NullString // Declation for basic field groupDB.Percentage Percentage_Data sql.NullFloat64 // encoding of pointers // for GORM serialization, it is necessary to embed to Pointer Encoding declaration GroupPointersEncoding }
GroupDB describes a group 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 groupDB
func (*GroupDB) CopyBasicFieldsFromGroup ¶
CopyBasicFieldsFromGroup
func (*GroupDB) CopyBasicFieldsFromGroupWOP ¶
CopyBasicFieldsFromGroupWOP
func (*GroupDB) CopyBasicFieldsFromGroup_WOP ¶
CopyBasicFieldsFromGroup_WOP
func (*GroupDB) CopyBasicFieldsToGroup ¶
CopyBasicFieldsToGroup
func (*GroupDB) CopyBasicFieldsToGroupWOP ¶
CopyBasicFieldsToGroupWOP
func (*GroupDB) CopyBasicFieldsToGroup_WOP ¶
CopyBasicFieldsToGroup_WOP
func (*GroupDB) DecodePointers ¶
func (groupDB *GroupDB) DecodePointers(backRepo *BackRepoStruct, group *models.Group)
type GroupDBResponse ¶
type GroupDBResponse struct {
GroupDB
}
GroupDBResponse provides response swagger:response groupDBResponse
type GroupPointersEncoding ¶
type GroupPointersEncoding struct { // field Buttons is a slice of pointers to another Struct (optional or 0..1) Buttons IntSlice `gorm:"type:TEXT"` }
GroupPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct
type GroupWOP ¶
GroupWOP is a Group without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint
type IntSlice ¶
type IntSlice []int
type LayoutAPI ¶
type LayoutAPI struct { gorm.Model models.Layout_WOP // encoding of pointers // for API, it cannot be embedded LayoutPointersEncoding LayoutPointersEncoding }
LayoutAPI 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 layoutAPI
type LayoutDB ¶
type LayoutDB struct { gorm.Model // Declation for basic field layoutDB.Name Name_Data sql.NullString // encoding of pointers // for GORM serialization, it is necessary to embed to Pointer Encoding declaration LayoutPointersEncoding }
LayoutDB describes a layout 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 layoutDB
func (*LayoutDB) CopyBasicFieldsFromLayout ¶
CopyBasicFieldsFromLayout
func (*LayoutDB) CopyBasicFieldsFromLayoutWOP ¶
CopyBasicFieldsFromLayoutWOP
func (*LayoutDB) CopyBasicFieldsFromLayout_WOP ¶
func (layoutDB *LayoutDB) CopyBasicFieldsFromLayout_WOP(layout *models.Layout_WOP)
CopyBasicFieldsFromLayout_WOP
func (*LayoutDB) CopyBasicFieldsToLayout ¶
CopyBasicFieldsToLayout
func (*LayoutDB) CopyBasicFieldsToLayoutWOP ¶
CopyBasicFieldsToLayoutWOP
func (*LayoutDB) CopyBasicFieldsToLayout_WOP ¶
func (layoutDB *LayoutDB) CopyBasicFieldsToLayout_WOP(layout *models.Layout_WOP)
CopyBasicFieldsToLayout_WOP
func (*LayoutDB) DecodePointers ¶
func (layoutDB *LayoutDB) DecodePointers(backRepo *BackRepoStruct, layout *models.Layout)
type LayoutDBResponse ¶
type LayoutDBResponse struct {
LayoutDB
}
LayoutDBResponse provides response swagger:response layoutDBResponse
type LayoutDBs ¶
type LayoutDBs []LayoutDB
LayoutDBs arrays layoutDBs swagger:response layoutDBsResponse
type LayoutPointersEncoding ¶
type LayoutPointersEncoding struct { // field Groups is a slice of pointers to another Struct (optional or 0..1) Groups IntSlice `gorm:"type:TEXT"` }
LayoutPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct