orm

package
v0.0.0-...-7889737 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 20 Imported by: 0

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

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

Constants

This section is empty.

Variables

View Source
var BackRepoCheckboxid_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 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

View Source
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

View Source
var BackRepoSliderid_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 Checkbox_Fields = []string{

	"ID",
	"Name",
	"ValueBool",
	"LabelForTrue",
	"LabelForFalse",
}
View Source
var Group_Fields = []string{

	"ID",
	"Name",
	"Percentage",
}
View Source
var Layout_Fields = []string{

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

	"ID",
	"Name",
	"IsFloat64",
	"IsInt",
	"MinInt",
	"MaxInt",
	"StepInt",
	"ValueInt",
	"MinFloat64",
	"MaxFloat64",
	"StepFloat64",
	"ValueFloat64",
}

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 BackRepoCheckboxStruct

type BackRepoCheckboxStruct struct {
	// stores CheckboxDB according to their gorm ID
	Map_CheckboxDBID_CheckboxDB map[uint]*CheckboxDB

	// stores CheckboxDB ID according to Checkbox address
	Map_CheckboxPtr_CheckboxDBID map[*models.Checkbox]uint

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

func (*BackRepoCheckboxStruct) Backup

func (backRepoCheckbox *BackRepoCheckboxStruct) Backup(dirPath string)

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

func (*BackRepoCheckboxStruct) BackupXL

func (backRepoCheckbox *BackRepoCheckboxStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoCheckboxStruct) CheckoutPhaseOne

func (backRepoCheckbox *BackRepoCheckboxStruct) CheckoutPhaseOne() (Error error)

BackRepoCheckbox.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 (*BackRepoCheckboxStruct) CheckoutPhaseOneInstance

func (backRepoCheckbox *BackRepoCheckboxStruct) CheckoutPhaseOneInstance(checkboxDB *CheckboxDB) (Error error)

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

func (*BackRepoCheckboxStruct) CheckoutPhaseTwo

func (backRepoCheckbox *BackRepoCheckboxStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoCheckboxStruct) CheckoutPhaseTwoInstance

func (backRepoCheckbox *BackRepoCheckboxStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, checkboxDB *CheckboxDB) (Error error)

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

func (*BackRepoCheckboxStruct) CommitDeleteInstance

func (backRepoCheckbox *BackRepoCheckboxStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoCheckbox.CommitDeleteInstance commits deletion of Checkbox to the BackRepo

func (*BackRepoCheckboxStruct) CommitPhaseOne

func (backRepoCheckbox *BackRepoCheckboxStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoCheckbox.CommitPhaseOne commits all staged instances of Checkbox 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 (*BackRepoCheckboxStruct) CommitPhaseOneInstance

func (backRepoCheckbox *BackRepoCheckboxStruct) CommitPhaseOneInstance(checkbox *models.Checkbox) (Error error)

BackRepoCheckbox.CommitPhaseOneInstance commits checkbox staged instances of Checkbox 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 (*BackRepoCheckboxStruct) CommitPhaseTwo

func (backRepoCheckbox *BackRepoCheckboxStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoCheckboxStruct) CommitPhaseTwoInstance

func (backRepoCheckbox *BackRepoCheckboxStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, checkbox *models.Checkbox) (Error error)

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

func (*BackRepoCheckboxStruct) GetCheckboxDBFromCheckboxPtr

func (backRepoCheckbox *BackRepoCheckboxStruct) GetCheckboxDBFromCheckboxPtr(checkbox *models.Checkbox) (checkboxDB *CheckboxDB)

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

func (*BackRepoCheckboxStruct) GetDB

func (backRepoCheckbox *BackRepoCheckboxStruct) GetDB() db.DBInterface

func (*BackRepoCheckboxStruct) GetStage

func (backRepoCheckbox *BackRepoCheckboxStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoCheckboxStruct) ResetReversePointers

func (backRepoCheckbox *BackRepoCheckboxStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoCheckboxStruct) ResetReversePointersInstance

func (backRepoCheckbox *BackRepoCheckboxStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, checkbox *models.Checkbox) (Error error)

func (*BackRepoCheckboxStruct) RestorePhaseOne

func (backRepoCheckbox *BackRepoCheckboxStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoCheckboxStruct) RestorePhaseTwo

func (backRepoCheckbox *BackRepoCheckboxStruct) RestorePhaseTwo()

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

func (*BackRepoCheckboxStruct) RestoreXLPhaseOne

func (backRepoCheckbox *BackRepoCheckboxStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Checkbox" sheet all CheckboxDB instances

type BackRepoData

type BackRepoData struct {
	CheckboxAPIs []*CheckboxAPI

	GroupAPIs []*GroupAPI

	LayoutAPIs []*LayoutAPI

	SliderAPIs []*SliderAPI

	// index of the web socket for this stack type (unique among all stack instances)
	GONG__Index int
}

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 BackRepoSliderStruct

type BackRepoSliderStruct struct {
	// stores SliderDB according to their gorm ID
	Map_SliderDBID_SliderDB map[uint]*SliderDB

	// stores SliderDB ID according to Slider address
	Map_SliderPtr_SliderDBID map[*models.Slider]uint

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

func (*BackRepoSliderStruct) Backup

func (backRepoSlider *BackRepoSliderStruct) Backup(dirPath string)

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

func (*BackRepoSliderStruct) BackupXL

func (backRepoSlider *BackRepoSliderStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoSliderStruct) CheckoutPhaseOne

func (backRepoSlider *BackRepoSliderStruct) CheckoutPhaseOne() (Error error)

BackRepoSlider.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 (*BackRepoSliderStruct) CheckoutPhaseOneInstance

func (backRepoSlider *BackRepoSliderStruct) CheckoutPhaseOneInstance(sliderDB *SliderDB) (Error error)

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

func (*BackRepoSliderStruct) CheckoutPhaseTwo

func (backRepoSlider *BackRepoSliderStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoSliderStruct) CheckoutPhaseTwoInstance

func (backRepoSlider *BackRepoSliderStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, sliderDB *SliderDB) (Error error)

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

func (*BackRepoSliderStruct) CommitDeleteInstance

func (backRepoSlider *BackRepoSliderStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoSlider.CommitDeleteInstance commits deletion of Slider to the BackRepo

func (*BackRepoSliderStruct) CommitPhaseOne

func (backRepoSlider *BackRepoSliderStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoSlider.CommitPhaseOne commits all staged instances of Slider 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 (*BackRepoSliderStruct) CommitPhaseOneInstance

func (backRepoSlider *BackRepoSliderStruct) CommitPhaseOneInstance(slider *models.Slider) (Error error)

BackRepoSlider.CommitPhaseOneInstance commits slider staged instances of Slider 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 (*BackRepoSliderStruct) CommitPhaseTwo

func (backRepoSlider *BackRepoSliderStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoSliderStruct) CommitPhaseTwoInstance

func (backRepoSlider *BackRepoSliderStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, slider *models.Slider) (Error error)

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

func (*BackRepoSliderStruct) GetDB

func (backRepoSlider *BackRepoSliderStruct) GetDB() db.DBInterface

func (*BackRepoSliderStruct) GetSliderDBFromSliderPtr

func (backRepoSlider *BackRepoSliderStruct) GetSliderDBFromSliderPtr(slider *models.Slider) (sliderDB *SliderDB)

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

func (*BackRepoSliderStruct) GetStage

func (backRepoSlider *BackRepoSliderStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoSliderStruct) ResetReversePointers

func (backRepoSlider *BackRepoSliderStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoSliderStruct) ResetReversePointersInstance

func (backRepoSlider *BackRepoSliderStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, slider *models.Slider) (Error error)

func (*BackRepoSliderStruct) RestorePhaseOne

func (backRepoSlider *BackRepoSliderStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoSliderStruct) RestorePhaseTwo

func (backRepoSlider *BackRepoSliderStruct) RestorePhaseTwo()

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

func (*BackRepoSliderStruct) RestoreXLPhaseOne

func (backRepoSlider *BackRepoSliderStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Slider" sheet all SliderDB instances

type BackRepoStruct

type BackRepoStruct struct {
	// insertion point for per struct back repo declarations
	BackRepoCheckbox BackRepoCheckboxStruct

	BackRepoGroup BackRepoGroupStruct

	BackRepoLayout BackRepoLayoutStruct

	BackRepoSlider BackRepoSliderStruct

	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) CheckoutCheckbox

func (backRepo *BackRepoStruct) CheckoutCheckbox(checkbox *models.Checkbox)

CommitCheckbox allows checkout of a single checkbox (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) CheckoutSlider

func (backRepo *BackRepoStruct) CheckoutSlider(slider *models.Slider)

CommitSlider allows checkout of a single slider (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) CommitCheckbox

func (backRepo *BackRepoStruct) CommitCheckbox(checkbox *models.Checkbox)

CommitCheckbox allows commit of a single checkbox (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) CommitSlider

func (backRepo *BackRepoStruct) CommitSlider(slider *models.Slider)

CommitSlider allows commit of a single slider (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 CheckboxAPI

type CheckboxAPI struct {
	gorm.Model

	models.Checkbox_WOP

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

CheckboxAPI 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 checkboxAPI

type CheckboxDB

type CheckboxDB struct {
	gorm.Model

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

	// Declation for basic field checkboxDB.ValueBool
	// provide the sql storage for the boolan
	ValueBool_Data sql.NullBool

	// Declation for basic field checkboxDB.LabelForTrue
	LabelForTrue_Data sql.NullString

	// Declation for basic field checkboxDB.LabelForFalse
	LabelForFalse_Data sql.NullString

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

CheckboxDB describes a checkbox 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 checkboxDB

func (*CheckboxDB) CopyBasicFieldsFromCheckbox

func (checkboxDB *CheckboxDB) CopyBasicFieldsFromCheckbox(checkbox *models.Checkbox)

CopyBasicFieldsFromCheckbox

func (*CheckboxDB) CopyBasicFieldsFromCheckboxWOP

func (checkboxDB *CheckboxDB) CopyBasicFieldsFromCheckboxWOP(checkbox *CheckboxWOP)

CopyBasicFieldsFromCheckboxWOP

func (*CheckboxDB) CopyBasicFieldsFromCheckbox_WOP

func (checkboxDB *CheckboxDB) CopyBasicFieldsFromCheckbox_WOP(checkbox *models.Checkbox_WOP)

CopyBasicFieldsFromCheckbox_WOP

func (*CheckboxDB) CopyBasicFieldsToCheckbox

func (checkboxDB *CheckboxDB) CopyBasicFieldsToCheckbox(checkbox *models.Checkbox)

CopyBasicFieldsToCheckbox

func (*CheckboxDB) CopyBasicFieldsToCheckboxWOP

func (checkboxDB *CheckboxDB) CopyBasicFieldsToCheckboxWOP(checkbox *CheckboxWOP)

CopyBasicFieldsToCheckboxWOP

func (*CheckboxDB) CopyBasicFieldsToCheckbox_WOP

func (checkboxDB *CheckboxDB) CopyBasicFieldsToCheckbox_WOP(checkbox *models.Checkbox_WOP)

CopyBasicFieldsToCheckbox_WOP

func (*CheckboxDB) DecodePointers

func (checkboxDB *CheckboxDB) DecodePointers(backRepo *BackRepoStruct, checkbox *models.Checkbox)

type CheckboxDBResponse

type CheckboxDBResponse struct {
	CheckboxDB
}

CheckboxDBResponse provides response swagger:response checkboxDBResponse

type CheckboxDBs

type CheckboxDBs []CheckboxDB

CheckboxDBs arrays checkboxDBs swagger:response checkboxDBsResponse

type CheckboxPointersEncoding

type CheckboxPointersEncoding struct {
}

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

type CheckboxWOP

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

	Name string `xlsx:"1"`

	ValueBool bool `xlsx:"2"`

	LabelForTrue string `xlsx:"3"`

	LabelForFalse string `xlsx:"4"`
}

CheckboxWOP is a Checkbox 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 NewDBLite

func NewDBLite() *DBLite

NewDBLite creates a new instance of DBLite

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) First

func (db *DBLite) First(instanceDB any, conds ...any) (db.DBInterface, error)

First retrieves the first record 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

func (*DBLite) Unscoped

func (db *DBLite) Unscoped() (db.DBInterface, error)

Unscoped sets the unscoped flag for soft-deletes (not used in this implementation)

func (*DBLite) Updates

func (db *DBLite) Updates(instanceDB any) (db.DBInterface, error)

Updates modifies an existing record in 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

func (groupDB *GroupDB) CopyBasicFieldsFromGroup(group *models.Group)

CopyBasicFieldsFromGroup

func (*GroupDB) CopyBasicFieldsFromGroupWOP

func (groupDB *GroupDB) CopyBasicFieldsFromGroupWOP(group *GroupWOP)

CopyBasicFieldsFromGroupWOP

func (*GroupDB) CopyBasicFieldsFromGroup_WOP

func (groupDB *GroupDB) CopyBasicFieldsFromGroup_WOP(group *models.Group_WOP)

CopyBasicFieldsFromGroup_WOP

func (*GroupDB) CopyBasicFieldsToGroup

func (groupDB *GroupDB) CopyBasicFieldsToGroup(group *models.Group)

CopyBasicFieldsToGroup

func (*GroupDB) CopyBasicFieldsToGroupWOP

func (groupDB *GroupDB) CopyBasicFieldsToGroupWOP(group *GroupWOP)

CopyBasicFieldsToGroupWOP

func (*GroupDB) CopyBasicFieldsToGroup_WOP

func (groupDB *GroupDB) CopyBasicFieldsToGroup_WOP(group *models.Group_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 GroupDBs

type GroupDBs []GroupDB

GroupDBs arrays groupDBs swagger:response groupDBsResponse

type GroupPointersEncoding

type GroupPointersEncoding struct {

	// field Sliders is a slice of pointers to another Struct (optional or 0..1)
	Sliders IntSlice `gorm:"type:TEXT"`

	// field Checkboxes is a slice of pointers to another Struct (optional or 0..1)
	Checkboxes IntSlice `gorm:"type:TEXT"`
}

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

type GroupWOP

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

	Name string `xlsx:"1"`

	Percentage float64 `xlsx:"2"`
}

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

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.

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

func (layoutDB *LayoutDB) CopyBasicFieldsFromLayout(layout *models.Layout)

CopyBasicFieldsFromLayout

func (*LayoutDB) CopyBasicFieldsFromLayoutWOP

func (layoutDB *LayoutDB) CopyBasicFieldsFromLayoutWOP(layout *LayoutWOP)

CopyBasicFieldsFromLayoutWOP

func (*LayoutDB) CopyBasicFieldsFromLayout_WOP

func (layoutDB *LayoutDB) CopyBasicFieldsFromLayout_WOP(layout *models.Layout_WOP)

CopyBasicFieldsFromLayout_WOP

func (*LayoutDB) CopyBasicFieldsToLayout

func (layoutDB *LayoutDB) CopyBasicFieldsToLayout(layout *models.Layout)

CopyBasicFieldsToLayout

func (*LayoutDB) CopyBasicFieldsToLayoutWOP

func (layoutDB *LayoutDB) CopyBasicFieldsToLayoutWOP(layout *LayoutWOP)

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

type LayoutWOP

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

	Name string `xlsx:"1"`
}

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

type SliderAPI

type SliderAPI struct {
	gorm.Model

	models.Slider_WOP

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

SliderAPI 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 sliderAPI

type SliderDB

type SliderDB struct {
	gorm.Model

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

	// Declation for basic field sliderDB.IsFloat64
	// provide the sql storage for the boolan
	IsFloat64_Data sql.NullBool

	// Declation for basic field sliderDB.IsInt
	// provide the sql storage for the boolan
	IsInt_Data sql.NullBool

	// Declation for basic field sliderDB.MinInt
	MinInt_Data sql.NullInt64

	// Declation for basic field sliderDB.MaxInt
	MaxInt_Data sql.NullInt64

	// Declation for basic field sliderDB.StepInt
	StepInt_Data sql.NullInt64

	// Declation for basic field sliderDB.ValueInt
	ValueInt_Data sql.NullInt64

	// Declation for basic field sliderDB.MinFloat64
	MinFloat64_Data sql.NullFloat64

	// Declation for basic field sliderDB.MaxFloat64
	MaxFloat64_Data sql.NullFloat64

	// Declation for basic field sliderDB.StepFloat64
	StepFloat64_Data sql.NullFloat64

	// Declation for basic field sliderDB.ValueFloat64
	ValueFloat64_Data sql.NullFloat64

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

SliderDB describes a slider 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 sliderDB

func (*SliderDB) CopyBasicFieldsFromSlider

func (sliderDB *SliderDB) CopyBasicFieldsFromSlider(slider *models.Slider)

CopyBasicFieldsFromSlider

func (*SliderDB) CopyBasicFieldsFromSliderWOP

func (sliderDB *SliderDB) CopyBasicFieldsFromSliderWOP(slider *SliderWOP)

CopyBasicFieldsFromSliderWOP

func (*SliderDB) CopyBasicFieldsFromSlider_WOP

func (sliderDB *SliderDB) CopyBasicFieldsFromSlider_WOP(slider *models.Slider_WOP)

CopyBasicFieldsFromSlider_WOP

func (*SliderDB) CopyBasicFieldsToSlider

func (sliderDB *SliderDB) CopyBasicFieldsToSlider(slider *models.Slider)

CopyBasicFieldsToSlider

func (*SliderDB) CopyBasicFieldsToSliderWOP

func (sliderDB *SliderDB) CopyBasicFieldsToSliderWOP(slider *SliderWOP)

CopyBasicFieldsToSliderWOP

func (*SliderDB) CopyBasicFieldsToSlider_WOP

func (sliderDB *SliderDB) CopyBasicFieldsToSlider_WOP(slider *models.Slider_WOP)

CopyBasicFieldsToSlider_WOP

func (*SliderDB) DecodePointers

func (sliderDB *SliderDB) DecodePointers(backRepo *BackRepoStruct, slider *models.Slider)

type SliderDBResponse

type SliderDBResponse struct {
	SliderDB
}

SliderDBResponse provides response swagger:response sliderDBResponse

type SliderDBs

type SliderDBs []SliderDB

SliderDBs arrays sliderDBs swagger:response sliderDBsResponse

type SliderPointersEncoding

type SliderPointersEncoding struct {
}

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

type SliderWOP

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

	Name string `xlsx:"1"`

	IsFloat64 bool `xlsx:"2"`

	IsInt bool `xlsx:"3"`

	MinInt int `xlsx:"4"`

	MaxInt int `xlsx:"5"`

	StepInt int `xlsx:"6"`

	ValueInt int `xlsx:"7"`

	MinFloat64 float64 `xlsx:"8"`

	MaxFloat64 float64 `xlsx:"9"`

	StepFloat64 float64 `xlsx:"10"`

	ValueFloat64 float64 `xlsx:"11"`
}

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

Directories

Path Synopsis
generated code - do not edit
generated code - do not edit

Jump to

Keyboard shortcuts

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