orm

package
v0.0.0-...-1806229 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 17 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

generated by genORMTranslation.go

generated from OrmFileSetupTemplate

Index

Constants

This section is empty.

Variables

View Source
var BackRepoChartConfigurationid_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 BackRepoDataPointid_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 BackRepoDatasetid_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 BackRepoLabelid_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 ChartConfiguration_Fields = []string{

	"ID",
	"Name",
	"ChartType",
	"Width",
	"Heigth",
}
View Source
var DataPoint_Fields = []string{

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

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

	"ID",
	"Name",
}

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB)

AutoMigrate migrates db with with orm Struct

func GetLastCommitFromBackNb

func GetLastCommitFromBackNb() uint

func GetLastPushFromFrontNb

func GetLastPushFromFrontNb() uint

func ResetDB

func ResetDB(db *gorm.DB)

func SetupModels

func SetupModels(logMode bool, filepath string) *gorm.DB

SetupModels connects to the sqlite database

Types

type BackRepoChartConfigurationStruct

type BackRepoChartConfigurationStruct struct {
	// stores ChartConfigurationDB according to their gorm ID
	Map_ChartConfigurationDBID_ChartConfigurationDB *map[uint]*ChartConfigurationDB

	// stores ChartConfigurationDB ID according to ChartConfiguration address
	Map_ChartConfigurationPtr_ChartConfigurationDBID *map[*models.ChartConfiguration]uint

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

func (*BackRepoChartConfigurationStruct) Backup

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) Backup(dirPath string)

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

func (*BackRepoChartConfigurationStruct) BackupXL

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoChartConfigurationStruct) CheckoutPhaseOne

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CheckoutPhaseOne() (Error error)

BackRepoChartConfiguration.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 pahse two)

func (*BackRepoChartConfigurationStruct) CheckoutPhaseOneInstance

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CheckoutPhaseOneInstance(chartconfigurationDB *ChartConfigurationDB) (Error error)

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

func (*BackRepoChartConfigurationStruct) CheckoutPhaseTwo

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoChartConfigurationStruct) CheckoutPhaseTwoInstance

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, chartconfigurationDB *ChartConfigurationDB) (Error error)

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

func (*BackRepoChartConfigurationStruct) CommitDeleteInstance

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoChartConfiguration.CommitDeleteInstance commits deletion of ChartConfiguration to the BackRepo

func (*BackRepoChartConfigurationStruct) CommitPhaseOne

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoChartConfiguration.CommitPhaseOne commits all staged instances of ChartConfiguration 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 (*BackRepoChartConfigurationStruct) CommitPhaseOneInstance

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CommitPhaseOneInstance(chartconfiguration *models.ChartConfiguration) (Error error)

BackRepoChartConfiguration.CommitPhaseOneInstance commits chartconfiguration staged instances of ChartConfiguration 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 (*BackRepoChartConfigurationStruct) CommitPhaseTwo

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoChartConfigurationStruct) CommitPhaseTwoInstance

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, chartconfiguration *models.ChartConfiguration) (Error error)

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

func (*BackRepoChartConfigurationStruct) GetChartConfigurationDBFromChartConfigurationPtr

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) GetChartConfigurationDBFromChartConfigurationPtr(chartconfiguration *models.ChartConfiguration) (chartconfigurationDB *ChartConfigurationDB)

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

func (*BackRepoChartConfigurationStruct) GetDB

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) GetDB() *gorm.DB

func (*BackRepoChartConfigurationStruct) Init

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) Init(db *gorm.DB) (Error error)

BackRepoChartConfiguration.Init set up the BackRepo of the ChartConfiguration

func (*BackRepoChartConfigurationStruct) RestorePhaseOne

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoChartConfigurationStruct) RestorePhaseTwo

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) RestorePhaseTwo()

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

func (*BackRepoChartConfigurationStruct) RestoreXLPhaseOne

func (backRepoChartConfiguration *BackRepoChartConfigurationStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "ChartConfiguration" sheet all ChartConfigurationDB instances

type BackRepoDataPointStruct

type BackRepoDataPointStruct struct {
	// stores DataPointDB according to their gorm ID
	Map_DataPointDBID_DataPointDB *map[uint]*DataPointDB

	// stores DataPointDB ID according to DataPoint address
	Map_DataPointPtr_DataPointDBID *map[*models.DataPoint]uint

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

func (*BackRepoDataPointStruct) Backup

func (backRepoDataPoint *BackRepoDataPointStruct) Backup(dirPath string)

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

func (*BackRepoDataPointStruct) BackupXL

func (backRepoDataPoint *BackRepoDataPointStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoDataPointStruct) CheckoutPhaseOne

func (backRepoDataPoint *BackRepoDataPointStruct) CheckoutPhaseOne() (Error error)

BackRepoDataPoint.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 pahse two)

func (*BackRepoDataPointStruct) CheckoutPhaseOneInstance

func (backRepoDataPoint *BackRepoDataPointStruct) CheckoutPhaseOneInstance(datapointDB *DataPointDB) (Error error)

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

func (*BackRepoDataPointStruct) CheckoutPhaseTwo

func (backRepoDataPoint *BackRepoDataPointStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoDataPointStruct) CheckoutPhaseTwoInstance

func (backRepoDataPoint *BackRepoDataPointStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, datapointDB *DataPointDB) (Error error)

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

func (*BackRepoDataPointStruct) CommitDeleteInstance

func (backRepoDataPoint *BackRepoDataPointStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoDataPoint.CommitDeleteInstance commits deletion of DataPoint to the BackRepo

func (*BackRepoDataPointStruct) CommitPhaseOne

func (backRepoDataPoint *BackRepoDataPointStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoDataPoint.CommitPhaseOne commits all staged instances of DataPoint 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 (*BackRepoDataPointStruct) CommitPhaseOneInstance

func (backRepoDataPoint *BackRepoDataPointStruct) CommitPhaseOneInstance(datapoint *models.DataPoint) (Error error)

BackRepoDataPoint.CommitPhaseOneInstance commits datapoint staged instances of DataPoint 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 (*BackRepoDataPointStruct) CommitPhaseTwo

func (backRepoDataPoint *BackRepoDataPointStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoDataPointStruct) CommitPhaseTwoInstance

func (backRepoDataPoint *BackRepoDataPointStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, datapoint *models.DataPoint) (Error error)

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

func (*BackRepoDataPointStruct) GetDB

func (backRepoDataPoint *BackRepoDataPointStruct) GetDB() *gorm.DB

func (*BackRepoDataPointStruct) GetDataPointDBFromDataPointPtr

func (backRepoDataPoint *BackRepoDataPointStruct) GetDataPointDBFromDataPointPtr(datapoint *models.DataPoint) (datapointDB *DataPointDB)

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

func (*BackRepoDataPointStruct) Init

func (backRepoDataPoint *BackRepoDataPointStruct) Init(db *gorm.DB) (Error error)

BackRepoDataPoint.Init set up the BackRepo of the DataPoint

func (*BackRepoDataPointStruct) RestorePhaseOne

func (backRepoDataPoint *BackRepoDataPointStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoDataPointStruct) RestorePhaseTwo

func (backRepoDataPoint *BackRepoDataPointStruct) RestorePhaseTwo()

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

func (*BackRepoDataPointStruct) RestoreXLPhaseOne

func (backRepoDataPoint *BackRepoDataPointStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "DataPoint" sheet all DataPointDB instances

type BackRepoDatasetStruct

type BackRepoDatasetStruct struct {
	// stores DatasetDB according to their gorm ID
	Map_DatasetDBID_DatasetDB *map[uint]*DatasetDB

	// stores DatasetDB ID according to Dataset address
	Map_DatasetPtr_DatasetDBID *map[*models.Dataset]uint

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

func (*BackRepoDatasetStruct) Backup

func (backRepoDataset *BackRepoDatasetStruct) Backup(dirPath string)

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

func (*BackRepoDatasetStruct) BackupXL

func (backRepoDataset *BackRepoDatasetStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoDatasetStruct) CheckoutPhaseOne

func (backRepoDataset *BackRepoDatasetStruct) CheckoutPhaseOne() (Error error)

BackRepoDataset.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 pahse two)

func (*BackRepoDatasetStruct) CheckoutPhaseOneInstance

func (backRepoDataset *BackRepoDatasetStruct) CheckoutPhaseOneInstance(datasetDB *DatasetDB) (Error error)

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

func (*BackRepoDatasetStruct) CheckoutPhaseTwo

func (backRepoDataset *BackRepoDatasetStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoDatasetStruct) CheckoutPhaseTwoInstance

func (backRepoDataset *BackRepoDatasetStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, datasetDB *DatasetDB) (Error error)

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

func (*BackRepoDatasetStruct) CommitDeleteInstance

func (backRepoDataset *BackRepoDatasetStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoDataset.CommitDeleteInstance commits deletion of Dataset to the BackRepo

func (*BackRepoDatasetStruct) CommitPhaseOne

func (backRepoDataset *BackRepoDatasetStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoDataset.CommitPhaseOne commits all staged instances of Dataset 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 (*BackRepoDatasetStruct) CommitPhaseOneInstance

func (backRepoDataset *BackRepoDatasetStruct) CommitPhaseOneInstance(dataset *models.Dataset) (Error error)

BackRepoDataset.CommitPhaseOneInstance commits dataset staged instances of Dataset 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 (*BackRepoDatasetStruct) CommitPhaseTwo

func (backRepoDataset *BackRepoDatasetStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoDatasetStruct) CommitPhaseTwoInstance

func (backRepoDataset *BackRepoDatasetStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, dataset *models.Dataset) (Error error)

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

func (*BackRepoDatasetStruct) GetDB

func (backRepoDataset *BackRepoDatasetStruct) GetDB() *gorm.DB

func (*BackRepoDatasetStruct) GetDatasetDBFromDatasetPtr

func (backRepoDataset *BackRepoDatasetStruct) GetDatasetDBFromDatasetPtr(dataset *models.Dataset) (datasetDB *DatasetDB)

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

func (*BackRepoDatasetStruct) Init

func (backRepoDataset *BackRepoDatasetStruct) Init(db *gorm.DB) (Error error)

BackRepoDataset.Init set up the BackRepo of the Dataset

func (*BackRepoDatasetStruct) RestorePhaseOne

func (backRepoDataset *BackRepoDatasetStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoDatasetStruct) RestorePhaseTwo

func (backRepoDataset *BackRepoDatasetStruct) RestorePhaseTwo()

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

func (*BackRepoDatasetStruct) RestoreXLPhaseOne

func (backRepoDataset *BackRepoDatasetStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Dataset" sheet all DatasetDB instances

type BackRepoLabelStruct

type BackRepoLabelStruct struct {
	// stores LabelDB according to their gorm ID
	Map_LabelDBID_LabelDB *map[uint]*LabelDB

	// stores LabelDB ID according to Label address
	Map_LabelPtr_LabelDBID *map[*models.Label]uint

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

func (*BackRepoLabelStruct) Backup

func (backRepoLabel *BackRepoLabelStruct) Backup(dirPath string)

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

func (*BackRepoLabelStruct) BackupXL

func (backRepoLabel *BackRepoLabelStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoLabelStruct) CheckoutPhaseOne

func (backRepoLabel *BackRepoLabelStruct) CheckoutPhaseOne() (Error error)

BackRepoLabel.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 pahse two)

func (*BackRepoLabelStruct) CheckoutPhaseOneInstance

func (backRepoLabel *BackRepoLabelStruct) CheckoutPhaseOneInstance(labelDB *LabelDB) (Error error)

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

func (*BackRepoLabelStruct) CheckoutPhaseTwo

func (backRepoLabel *BackRepoLabelStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoLabelStruct) CheckoutPhaseTwoInstance

func (backRepoLabel *BackRepoLabelStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, labelDB *LabelDB) (Error error)

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

func (*BackRepoLabelStruct) CommitDeleteInstance

func (backRepoLabel *BackRepoLabelStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoLabel.CommitDeleteInstance commits deletion of Label to the BackRepo

func (*BackRepoLabelStruct) CommitPhaseOne

func (backRepoLabel *BackRepoLabelStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoLabel.CommitPhaseOne commits all staged instances of Label 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 (*BackRepoLabelStruct) CommitPhaseOneInstance

func (backRepoLabel *BackRepoLabelStruct) CommitPhaseOneInstance(label *models.Label) (Error error)

BackRepoLabel.CommitPhaseOneInstance commits label staged instances of Label 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 (*BackRepoLabelStruct) CommitPhaseTwo

func (backRepoLabel *BackRepoLabelStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoLabelStruct) CommitPhaseTwoInstance

func (backRepoLabel *BackRepoLabelStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, label *models.Label) (Error error)

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

func (*BackRepoLabelStruct) GetDB

func (backRepoLabel *BackRepoLabelStruct) GetDB() *gorm.DB

func (*BackRepoLabelStruct) GetLabelDBFromLabelPtr

func (backRepoLabel *BackRepoLabelStruct) GetLabelDBFromLabelPtr(label *models.Label) (labelDB *LabelDB)

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

func (*BackRepoLabelStruct) Init

func (backRepoLabel *BackRepoLabelStruct) Init(db *gorm.DB) (Error error)

BackRepoLabel.Init set up the BackRepo of the Label

func (*BackRepoLabelStruct) RestorePhaseOne

func (backRepoLabel *BackRepoLabelStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoLabelStruct) RestorePhaseTwo

func (backRepoLabel *BackRepoLabelStruct) RestorePhaseTwo()

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

func (*BackRepoLabelStruct) RestoreXLPhaseOne

func (backRepoLabel *BackRepoLabelStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Label" sheet all LabelDB instances

type BackRepoStruct

type BackRepoStruct struct {
	// insertion point for per struct back repo declarations
	BackRepoChartConfiguration BackRepoChartConfigurationStruct

	BackRepoDataPoint BackRepoDataPointStruct

	BackRepoDataset BackRepoDatasetStruct

	BackRepoLabel BackRepoLabelStruct

	CommitFromBackNb uint // this ng is updated at the BackRepo level but also at the BackRepo<GongStruct> level

	PushFromFrontNb uint // records increments from push from front
}

BackRepoStruct supports callback functions

var 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) CheckoutChartConfiguration

func (backRepo *BackRepoStruct) CheckoutChartConfiguration(chartconfiguration *models.ChartConfiguration)

CommitChartConfiguration allows checkout of a single chartconfiguration (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutDataPoint

func (backRepo *BackRepoStruct) CheckoutDataPoint(datapoint *models.DataPoint)

CommitDataPoint allows checkout of a single datapoint (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutDataset

func (backRepo *BackRepoStruct) CheckoutDataset(dataset *models.Dataset)

CommitDataset allows checkout of a single dataset (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutLabel

func (backRepo *BackRepoStruct) CheckoutLabel(label *models.Label)

CommitLabel allows checkout of a single label (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) CommitChartConfiguration

func (backRepo *BackRepoStruct) CommitChartConfiguration(chartconfiguration *models.ChartConfiguration)

CommitChartConfiguration allows commit of a single chartconfiguration (if already staged)

func (*BackRepoStruct) CommitDataPoint

func (backRepo *BackRepoStruct) CommitDataPoint(datapoint *models.DataPoint)

CommitDataPoint allows commit of a single datapoint (if already staged)

func (*BackRepoStruct) CommitDataset

func (backRepo *BackRepoStruct) CommitDataset(dataset *models.Dataset)

CommitDataset allows commit of a single dataset (if already staged)

func (*BackRepoStruct) CommitLabel

func (backRepo *BackRepoStruct) CommitLabel(label *models.Label)

CommitLabel allows commit of a single label (if already staged)

func (*BackRepoStruct) GetLastCommitFromBackNb

func (backRepo *BackRepoStruct) GetLastCommitFromBackNb() uint

func (*BackRepoStruct) GetLastPushFromFrontNb

func (backRepo *BackRepoStruct) GetLastPushFromFrontNb() uint

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

type ChartConfigurationAPI

type ChartConfigurationAPI struct {
	gorm.Model

	models.ChartConfiguration

	// encoding of pointers
	ChartConfigurationPointersEnconding
}

ChartConfigurationAPI 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 chartconfigurationAPI

type ChartConfigurationDB

type ChartConfigurationDB struct {
	gorm.Model

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

	// Declation for basic field chartconfigurationDB.ChartType
	ChartType_Data sql.NullString

	// Declation for basic field chartconfigurationDB.Width
	Width_Data sql.NullInt64

	// Declation for basic field chartconfigurationDB.Heigth
	Heigth_Data sql.NullInt64
	// encoding of pointers
	ChartConfigurationPointersEnconding
}

ChartConfigurationDB describes a chartconfiguration 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 chartconfigurationDB

func (*ChartConfigurationDB) CopyBasicFieldsFromChartConfiguration

func (chartconfigurationDB *ChartConfigurationDB) CopyBasicFieldsFromChartConfiguration(chartconfiguration *models.ChartConfiguration)

CopyBasicFieldsFromChartConfiguration

func (*ChartConfigurationDB) CopyBasicFieldsFromChartConfigurationWOP

func (chartconfigurationDB *ChartConfigurationDB) CopyBasicFieldsFromChartConfigurationWOP(chartconfiguration *ChartConfigurationWOP)

CopyBasicFieldsFromChartConfigurationWOP

func (*ChartConfigurationDB) CopyBasicFieldsToChartConfiguration

func (chartconfigurationDB *ChartConfigurationDB) CopyBasicFieldsToChartConfiguration(chartconfiguration *models.ChartConfiguration)

CopyBasicFieldsToChartConfiguration

func (*ChartConfigurationDB) CopyBasicFieldsToChartConfigurationWOP

func (chartconfigurationDB *ChartConfigurationDB) CopyBasicFieldsToChartConfigurationWOP(chartconfiguration *ChartConfigurationWOP)

CopyBasicFieldsToChartConfigurationWOP

type ChartConfigurationDBResponse

type ChartConfigurationDBResponse struct {
	ChartConfigurationDB
}

ChartConfigurationDBResponse provides response swagger:response chartconfigurationDBResponse

type ChartConfigurationDBs

type ChartConfigurationDBs []ChartConfigurationDB

ChartConfigurationDBs arrays chartconfigurationDBs swagger:response chartconfigurationDBsResponse

type ChartConfigurationPointersEnconding

type ChartConfigurationPointersEnconding struct {
}

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

type ChartConfigurationWOP

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

	Name string `xlsx:"1"`

	ChartType models.ChartType `xlsx:"2"`

	Width int `xlsx:"3"`

	Heigth int `xlsx:"4"`
}

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

type DataPointAPI

type DataPointAPI struct {
	gorm.Model

	models.DataPoint

	// encoding of pointers
	DataPointPointersEnconding
}

DataPointAPI 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 datapointAPI

type DataPointDB

type DataPointDB struct {
	gorm.Model

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

	// Declation for basic field datapointDB.Value
	Value_Data sql.NullFloat64
	// encoding of pointers
	DataPointPointersEnconding
}

DataPointDB describes a datapoint 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 datapointDB

func (*DataPointDB) CopyBasicFieldsFromDataPoint

func (datapointDB *DataPointDB) CopyBasicFieldsFromDataPoint(datapoint *models.DataPoint)

CopyBasicFieldsFromDataPoint

func (*DataPointDB) CopyBasicFieldsFromDataPointWOP

func (datapointDB *DataPointDB) CopyBasicFieldsFromDataPointWOP(datapoint *DataPointWOP)

CopyBasicFieldsFromDataPointWOP

func (*DataPointDB) CopyBasicFieldsToDataPoint

func (datapointDB *DataPointDB) CopyBasicFieldsToDataPoint(datapoint *models.DataPoint)

CopyBasicFieldsToDataPoint

func (*DataPointDB) CopyBasicFieldsToDataPointWOP

func (datapointDB *DataPointDB) CopyBasicFieldsToDataPointWOP(datapoint *DataPointWOP)

CopyBasicFieldsToDataPointWOP

type DataPointDBResponse

type DataPointDBResponse struct {
	DataPointDB
}

DataPointDBResponse provides response swagger:response datapointDBResponse

type DataPointDBs

type DataPointDBs []DataPointDB

DataPointDBs arrays datapointDBs swagger:response datapointDBsResponse

type DataPointPointersEnconding

type DataPointPointersEnconding struct {

	// Implementation of a reverse ID for field Dataset{}.DataPoints []*DataPoint
	Dataset_DataPointsDBID sql.NullInt64

	// implementation of the index of the withing the slice
	Dataset_DataPointsDBID_Index sql.NullInt64
}

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

type DataPointWOP

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

	Name string `xlsx:"1"`

	Value float64 `xlsx:"2"`
}

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

type DatasetAPI

type DatasetAPI struct {
	gorm.Model

	models.Dataset

	// encoding of pointers
	DatasetPointersEnconding
}

DatasetAPI 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 datasetAPI

type DatasetDB

type DatasetDB struct {
	gorm.Model

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

	// Declation for basic field datasetDB.Label
	Label_Data sql.NullString
	// encoding of pointers
	DatasetPointersEnconding
}

DatasetDB describes a dataset 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 datasetDB

func (*DatasetDB) CopyBasicFieldsFromDataset

func (datasetDB *DatasetDB) CopyBasicFieldsFromDataset(dataset *models.Dataset)

CopyBasicFieldsFromDataset

func (*DatasetDB) CopyBasicFieldsFromDatasetWOP

func (datasetDB *DatasetDB) CopyBasicFieldsFromDatasetWOP(dataset *DatasetWOP)

CopyBasicFieldsFromDatasetWOP

func (*DatasetDB) CopyBasicFieldsToDataset

func (datasetDB *DatasetDB) CopyBasicFieldsToDataset(dataset *models.Dataset)

CopyBasicFieldsToDataset

func (*DatasetDB) CopyBasicFieldsToDatasetWOP

func (datasetDB *DatasetDB) CopyBasicFieldsToDatasetWOP(dataset *DatasetWOP)

CopyBasicFieldsToDatasetWOP

type DatasetDBResponse

type DatasetDBResponse struct {
	DatasetDB
}

DatasetDBResponse provides response swagger:response datasetDBResponse

type DatasetDBs

type DatasetDBs []DatasetDB

DatasetDBs arrays datasetDBs swagger:response datasetDBsResponse

type DatasetPointersEnconding

type DatasetPointersEnconding struct {

	// Implementation of a reverse ID for field ChartConfiguration{}.Datasets []*Dataset
	ChartConfiguration_DatasetsDBID sql.NullInt64

	// implementation of the index of the withing the slice
	ChartConfiguration_DatasetsDBID_Index sql.NullInt64
}

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

type DatasetWOP

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

	Name string `xlsx:"1"`

	Label string `xlsx:"2"`
}

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

type LabelAPI

type LabelAPI struct {
	gorm.Model

	models.Label

	// encoding of pointers
	LabelPointersEnconding
}

LabelAPI 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 labelAPI

type LabelDB

type LabelDB struct {
	gorm.Model

	// Declation for basic field labelDB.Name
	Name_Data sql.NullString
	// encoding of pointers
	LabelPointersEnconding
}

LabelDB describes a label 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 labelDB

func (*LabelDB) CopyBasicFieldsFromLabel

func (labelDB *LabelDB) CopyBasicFieldsFromLabel(label *models.Label)

CopyBasicFieldsFromLabel

func (*LabelDB) CopyBasicFieldsFromLabelWOP

func (labelDB *LabelDB) CopyBasicFieldsFromLabelWOP(label *LabelWOP)

CopyBasicFieldsFromLabelWOP

func (*LabelDB) CopyBasicFieldsToLabel

func (labelDB *LabelDB) CopyBasicFieldsToLabel(label *models.Label)

CopyBasicFieldsToLabel

func (*LabelDB) CopyBasicFieldsToLabelWOP

func (labelDB *LabelDB) CopyBasicFieldsToLabelWOP(label *LabelWOP)

CopyBasicFieldsToLabelWOP

type LabelDBResponse

type LabelDBResponse struct {
	LabelDB
}

LabelDBResponse provides response swagger:response labelDBResponse

type LabelDBs

type LabelDBs []LabelDB

LabelDBs arrays labelDBs swagger:response labelDBsResponse

type LabelPointersEnconding

type LabelPointersEnconding struct {

	// Implementation of a reverse ID for field ChartConfiguration{}.Labels []*Label
	ChartConfiguration_LabelsDBID sql.NullInt64

	// implementation of the index of the withing the slice
	ChartConfiguration_LabelsDBID_Index sql.NullInt64
}

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

type LabelWOP

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

	Name string `xlsx:"1"`
}

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

Jump to

Keyboard shortcuts

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