orm

package
v0.0.0-...-589f0e7 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 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

Index

Constants

This section is empty.

Variables

View Source
var BackRepoContentid_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 BackRepoJpgImageid_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 BackRepoPngImageid_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 BackRepoSvgImageid_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 Content_Fields = []string{

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

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

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

	"ID",
	"Name",
	"Content",
}

Functions

func CopyBackRepoToBackRepoData

func CopyBackRepoToBackRepoData(backRepo *BackRepoStruct, backRepoData *BackRepoData)

func GetID

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

func GetIDPointer

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

func GetInstanceDBFromInstance

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

Types

type BackRepoContentStruct

type BackRepoContentStruct struct {
	// stores ContentDB according to their gorm ID
	Map_ContentDBID_ContentDB map[uint]*ContentDB

	// stores ContentDB ID according to Content address
	Map_ContentPtr_ContentDBID map[*models.Content]uint

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

func (*BackRepoContentStruct) Backup

func (backRepoContent *BackRepoContentStruct) Backup(dirPath string)

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

func (*BackRepoContentStruct) BackupXL

func (backRepoContent *BackRepoContentStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoContentStruct) CheckoutPhaseOne

func (backRepoContent *BackRepoContentStruct) CheckoutPhaseOne() (Error error)

BackRepoContent.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 (*BackRepoContentStruct) CheckoutPhaseOneInstance

func (backRepoContent *BackRepoContentStruct) CheckoutPhaseOneInstance(contentDB *ContentDB) (Error error)

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

func (*BackRepoContentStruct) CheckoutPhaseTwo

func (backRepoContent *BackRepoContentStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoContentStruct) CheckoutPhaseTwoInstance

func (backRepoContent *BackRepoContentStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, contentDB *ContentDB) (Error error)

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

func (*BackRepoContentStruct) CommitDeleteInstance

func (backRepoContent *BackRepoContentStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoContent.CommitDeleteInstance commits deletion of Content to the BackRepo

func (*BackRepoContentStruct) CommitPhaseOne

func (backRepoContent *BackRepoContentStruct) CommitPhaseOne(stage *models.Stage) (Error error)

BackRepoContent.CommitPhaseOne commits all staged instances of Content 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 (*BackRepoContentStruct) CommitPhaseOneInstance

func (backRepoContent *BackRepoContentStruct) CommitPhaseOneInstance(content *models.Content) (Error error)

BackRepoContent.CommitPhaseOneInstance commits content staged instances of Content 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 (*BackRepoContentStruct) CommitPhaseTwo

func (backRepoContent *BackRepoContentStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoContentStruct) CommitPhaseTwoInstance

func (backRepoContent *BackRepoContentStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, content *models.Content) (Error error)

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

func (*BackRepoContentStruct) GetContentDBFromContentPtr

func (backRepoContent *BackRepoContentStruct) GetContentDBFromContentPtr(content *models.Content) (contentDB *ContentDB)

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

func (*BackRepoContentStruct) GetDB

func (backRepoContent *BackRepoContentStruct) GetDB() db.DBInterface

func (*BackRepoContentStruct) GetStage

func (backRepoContent *BackRepoContentStruct) GetStage() (stage *models.Stage)

func (*BackRepoContentStruct) ResetReversePointers

func (backRepoContent *BackRepoContentStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoContentStruct) ResetReversePointersInstance

func (backRepoContent *BackRepoContentStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, content *models.Content) (Error error)

func (*BackRepoContentStruct) RestorePhaseOne

func (backRepoContent *BackRepoContentStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoContentStruct) RestorePhaseTwo

func (backRepoContent *BackRepoContentStruct) RestorePhaseTwo()

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

func (*BackRepoContentStruct) RestoreXLPhaseOne

func (backRepoContent *BackRepoContentStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Content" sheet all ContentDB instances

type BackRepoData

type BackRepoData struct {
	ContentAPIs []*ContentAPI

	JpgImageAPIs []*JpgImageAPI

	PngImageAPIs []*PngImageAPI

	SvgImageAPIs []*SvgImageAPI

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

type BackRepoJpgImageStruct

type BackRepoJpgImageStruct struct {
	// stores JpgImageDB according to their gorm ID
	Map_JpgImageDBID_JpgImageDB map[uint]*JpgImageDB

	// stores JpgImageDB ID according to JpgImage address
	Map_JpgImagePtr_JpgImageDBID map[*models.JpgImage]uint

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

func (*BackRepoJpgImageStruct) Backup

func (backRepoJpgImage *BackRepoJpgImageStruct) Backup(dirPath string)

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

func (*BackRepoJpgImageStruct) BackupXL

func (backRepoJpgImage *BackRepoJpgImageStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoJpgImageStruct) CheckoutPhaseOne

func (backRepoJpgImage *BackRepoJpgImageStruct) CheckoutPhaseOne() (Error error)

BackRepoJpgImage.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 (*BackRepoJpgImageStruct) CheckoutPhaseOneInstance

func (backRepoJpgImage *BackRepoJpgImageStruct) CheckoutPhaseOneInstance(jpgimageDB *JpgImageDB) (Error error)

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

func (*BackRepoJpgImageStruct) CheckoutPhaseTwo

func (backRepoJpgImage *BackRepoJpgImageStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoJpgImageStruct) CheckoutPhaseTwoInstance

func (backRepoJpgImage *BackRepoJpgImageStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, jpgimageDB *JpgImageDB) (Error error)

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

func (*BackRepoJpgImageStruct) CommitDeleteInstance

func (backRepoJpgImage *BackRepoJpgImageStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoJpgImage.CommitDeleteInstance commits deletion of JpgImage to the BackRepo

func (*BackRepoJpgImageStruct) CommitPhaseOne

func (backRepoJpgImage *BackRepoJpgImageStruct) CommitPhaseOne(stage *models.Stage) (Error error)

BackRepoJpgImage.CommitPhaseOne commits all staged instances of JpgImage 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 (*BackRepoJpgImageStruct) CommitPhaseOneInstance

func (backRepoJpgImage *BackRepoJpgImageStruct) CommitPhaseOneInstance(jpgimage *models.JpgImage) (Error error)

BackRepoJpgImage.CommitPhaseOneInstance commits jpgimage staged instances of JpgImage 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 (*BackRepoJpgImageStruct) CommitPhaseTwo

func (backRepoJpgImage *BackRepoJpgImageStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoJpgImageStruct) CommitPhaseTwoInstance

func (backRepoJpgImage *BackRepoJpgImageStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, jpgimage *models.JpgImage) (Error error)

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

func (*BackRepoJpgImageStruct) GetDB

func (backRepoJpgImage *BackRepoJpgImageStruct) GetDB() db.DBInterface

func (*BackRepoJpgImageStruct) GetJpgImageDBFromJpgImagePtr

func (backRepoJpgImage *BackRepoJpgImageStruct) GetJpgImageDBFromJpgImagePtr(jpgimage *models.JpgImage) (jpgimageDB *JpgImageDB)

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

func (*BackRepoJpgImageStruct) GetStage

func (backRepoJpgImage *BackRepoJpgImageStruct) GetStage() (stage *models.Stage)

func (*BackRepoJpgImageStruct) ResetReversePointers

func (backRepoJpgImage *BackRepoJpgImageStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoJpgImageStruct) ResetReversePointersInstance

func (backRepoJpgImage *BackRepoJpgImageStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, jpgimage *models.JpgImage) (Error error)

func (*BackRepoJpgImageStruct) RestorePhaseOne

func (backRepoJpgImage *BackRepoJpgImageStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoJpgImageStruct) RestorePhaseTwo

func (backRepoJpgImage *BackRepoJpgImageStruct) RestorePhaseTwo()

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

func (*BackRepoJpgImageStruct) RestoreXLPhaseOne

func (backRepoJpgImage *BackRepoJpgImageStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "JpgImage" sheet all JpgImageDB instances

type BackRepoPngImageStruct

type BackRepoPngImageStruct struct {
	// stores PngImageDB according to their gorm ID
	Map_PngImageDBID_PngImageDB map[uint]*PngImageDB

	// stores PngImageDB ID according to PngImage address
	Map_PngImagePtr_PngImageDBID map[*models.PngImage]uint

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

func (*BackRepoPngImageStruct) Backup

func (backRepoPngImage *BackRepoPngImageStruct) Backup(dirPath string)

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

func (*BackRepoPngImageStruct) BackupXL

func (backRepoPngImage *BackRepoPngImageStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoPngImageStruct) CheckoutPhaseOne

func (backRepoPngImage *BackRepoPngImageStruct) CheckoutPhaseOne() (Error error)

BackRepoPngImage.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 (*BackRepoPngImageStruct) CheckoutPhaseOneInstance

func (backRepoPngImage *BackRepoPngImageStruct) CheckoutPhaseOneInstance(pngimageDB *PngImageDB) (Error error)

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

func (*BackRepoPngImageStruct) CheckoutPhaseTwo

func (backRepoPngImage *BackRepoPngImageStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoPngImageStruct) CheckoutPhaseTwoInstance

func (backRepoPngImage *BackRepoPngImageStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, pngimageDB *PngImageDB) (Error error)

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

func (*BackRepoPngImageStruct) CommitDeleteInstance

func (backRepoPngImage *BackRepoPngImageStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoPngImage.CommitDeleteInstance commits deletion of PngImage to the BackRepo

func (*BackRepoPngImageStruct) CommitPhaseOne

func (backRepoPngImage *BackRepoPngImageStruct) CommitPhaseOne(stage *models.Stage) (Error error)

BackRepoPngImage.CommitPhaseOne commits all staged instances of PngImage 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 (*BackRepoPngImageStruct) CommitPhaseOneInstance

func (backRepoPngImage *BackRepoPngImageStruct) CommitPhaseOneInstance(pngimage *models.PngImage) (Error error)

BackRepoPngImage.CommitPhaseOneInstance commits pngimage staged instances of PngImage 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 (*BackRepoPngImageStruct) CommitPhaseTwo

func (backRepoPngImage *BackRepoPngImageStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoPngImageStruct) CommitPhaseTwoInstance

func (backRepoPngImage *BackRepoPngImageStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, pngimage *models.PngImage) (Error error)

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

func (*BackRepoPngImageStruct) GetDB

func (backRepoPngImage *BackRepoPngImageStruct) GetDB() db.DBInterface

func (*BackRepoPngImageStruct) GetPngImageDBFromPngImagePtr

func (backRepoPngImage *BackRepoPngImageStruct) GetPngImageDBFromPngImagePtr(pngimage *models.PngImage) (pngimageDB *PngImageDB)

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

func (*BackRepoPngImageStruct) GetStage

func (backRepoPngImage *BackRepoPngImageStruct) GetStage() (stage *models.Stage)

func (*BackRepoPngImageStruct) ResetReversePointers

func (backRepoPngImage *BackRepoPngImageStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoPngImageStruct) ResetReversePointersInstance

func (backRepoPngImage *BackRepoPngImageStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, pngimage *models.PngImage) (Error error)

func (*BackRepoPngImageStruct) RestorePhaseOne

func (backRepoPngImage *BackRepoPngImageStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoPngImageStruct) RestorePhaseTwo

func (backRepoPngImage *BackRepoPngImageStruct) RestorePhaseTwo()

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

func (*BackRepoPngImageStruct) RestoreXLPhaseOne

func (backRepoPngImage *BackRepoPngImageStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "PngImage" sheet all PngImageDB instances

type BackRepoStruct

type BackRepoStruct struct {
	// insertion point for per struct back repo declarations
	BackRepoContent BackRepoContentStruct

	BackRepoJpgImage BackRepoJpgImageStruct

	BackRepoPngImage BackRepoPngImageStruct

	BackRepoSvgImage BackRepoSvgImageStruct

	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.Stage, filename string) (backRepo *BackRepoStruct)

func (*BackRepoStruct) Backup

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

Backup the BackRepoStruct

func (*BackRepoStruct) BackupXL

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

Backup in XL the BackRepoStruct

func (*BackRepoStruct) Checkout

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

Checkout the database into the stage

func (*BackRepoStruct) CheckoutContent

func (backRepo *BackRepoStruct) CheckoutContent(content *models.Content)

CommitContent allows checkout of a single content (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutJpgImage

func (backRepo *BackRepoStruct) CheckoutJpgImage(jpgimage *models.JpgImage)

CommitJpgImage allows checkout of a single jpgimage (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutPngImage

func (backRepo *BackRepoStruct) CheckoutPngImage(pngimage *models.PngImage)

CommitPngImage allows checkout of a single pngimage (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutSvgImage

func (backRepo *BackRepoStruct) CheckoutSvgImage(svgimage *models.SvgImage)

CommitSvgImage allows checkout of a single svgimage (if already staged and with a BackRepo id)

func (*BackRepoStruct) Commit

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

Commit the BackRepoStruct inner variables and link to the database

func (*BackRepoStruct) CommitContent

func (backRepo *BackRepoStruct) CommitContent(content *models.Content)

CommitContent allows commit of a single content (if already staged)

func (*BackRepoStruct) CommitJpgImage

func (backRepo *BackRepoStruct) CommitJpgImage(jpgimage *models.JpgImage)

CommitJpgImage allows commit of a single jpgimage (if already staged)

func (*BackRepoStruct) CommitPngImage

func (backRepo *BackRepoStruct) CommitPngImage(pngimage *models.PngImage)

CommitPngImage allows commit of a single pngimage (if already staged)

func (*BackRepoStruct) CommitSvgImage

func (backRepo *BackRepoStruct) CommitSvgImage(svgimage *models.SvgImage)

CommitSvgImage allows commit of a single svgimage (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.Stage)

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.Stage, dirPath string)

Restore the database into the back repo

func (*BackRepoStruct) RestoreXL

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

Restore the database into the back repo

func (*BackRepoStruct) SubscribeToCommitNb

func (backRepoStruct *BackRepoStruct) SubscribeToCommitNb(ctx context.Context) <-chan int

type BackRepoSvgImageStruct

type BackRepoSvgImageStruct struct {
	// stores SvgImageDB according to their gorm ID
	Map_SvgImageDBID_SvgImageDB map[uint]*SvgImageDB

	// stores SvgImageDB ID according to SvgImage address
	Map_SvgImagePtr_SvgImageDBID map[*models.SvgImage]uint

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

func (*BackRepoSvgImageStruct) Backup

func (backRepoSvgImage *BackRepoSvgImageStruct) Backup(dirPath string)

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

func (*BackRepoSvgImageStruct) BackupXL

func (backRepoSvgImage *BackRepoSvgImageStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoSvgImageStruct) CheckoutPhaseOne

func (backRepoSvgImage *BackRepoSvgImageStruct) CheckoutPhaseOne() (Error error)

BackRepoSvgImage.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 (*BackRepoSvgImageStruct) CheckoutPhaseOneInstance

func (backRepoSvgImage *BackRepoSvgImageStruct) CheckoutPhaseOneInstance(svgimageDB *SvgImageDB) (Error error)

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

func (*BackRepoSvgImageStruct) CheckoutPhaseTwo

func (backRepoSvgImage *BackRepoSvgImageStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoSvgImageStruct) CheckoutPhaseTwoInstance

func (backRepoSvgImage *BackRepoSvgImageStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, svgimageDB *SvgImageDB) (Error error)

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

func (*BackRepoSvgImageStruct) CommitDeleteInstance

func (backRepoSvgImage *BackRepoSvgImageStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoSvgImage.CommitDeleteInstance commits deletion of SvgImage to the BackRepo

func (*BackRepoSvgImageStruct) CommitPhaseOne

func (backRepoSvgImage *BackRepoSvgImageStruct) CommitPhaseOne(stage *models.Stage) (Error error)

BackRepoSvgImage.CommitPhaseOne commits all staged instances of SvgImage 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 (*BackRepoSvgImageStruct) CommitPhaseOneInstance

func (backRepoSvgImage *BackRepoSvgImageStruct) CommitPhaseOneInstance(svgimage *models.SvgImage) (Error error)

BackRepoSvgImage.CommitPhaseOneInstance commits svgimage staged instances of SvgImage 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 (*BackRepoSvgImageStruct) CommitPhaseTwo

func (backRepoSvgImage *BackRepoSvgImageStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoSvgImageStruct) CommitPhaseTwoInstance

func (backRepoSvgImage *BackRepoSvgImageStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, svgimage *models.SvgImage) (Error error)

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

func (*BackRepoSvgImageStruct) GetDB

func (backRepoSvgImage *BackRepoSvgImageStruct) GetDB() db.DBInterface

func (*BackRepoSvgImageStruct) GetStage

func (backRepoSvgImage *BackRepoSvgImageStruct) GetStage() (stage *models.Stage)

func (*BackRepoSvgImageStruct) GetSvgImageDBFromSvgImagePtr

func (backRepoSvgImage *BackRepoSvgImageStruct) GetSvgImageDBFromSvgImagePtr(svgimage *models.SvgImage) (svgimageDB *SvgImageDB)

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

func (*BackRepoSvgImageStruct) ResetReversePointers

func (backRepoSvgImage *BackRepoSvgImageStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoSvgImageStruct) ResetReversePointersInstance

func (backRepoSvgImage *BackRepoSvgImageStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, svgimage *models.SvgImage) (Error error)

func (*BackRepoSvgImageStruct) RestorePhaseOne

func (backRepoSvgImage *BackRepoSvgImageStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoSvgImageStruct) RestorePhaseTwo

func (backRepoSvgImage *BackRepoSvgImageStruct) RestorePhaseTwo()

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

func (*BackRepoSvgImageStruct) RestoreXLPhaseOne

func (backRepoSvgImage *BackRepoSvgImageStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "SvgImage" sheet all SvgImageDB instances

type ContentAPI

type ContentAPI struct {
	gorm.Model

	models.Content_WOP

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

ContentAPI 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 contentAPI

type ContentDB

type ContentDB struct {
	gorm.Model

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

	// Declation for basic field contentDB.Content
	Content_Data sql.NullString

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

ContentDB describes a content 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 contentDB

func (*ContentDB) CopyBasicFieldsFromContent

func (contentDB *ContentDB) CopyBasicFieldsFromContent(content *models.Content)

CopyBasicFieldsFromContent

func (*ContentDB) CopyBasicFieldsFromContentWOP

func (contentDB *ContentDB) CopyBasicFieldsFromContentWOP(content *ContentWOP)

CopyBasicFieldsFromContentWOP

func (*ContentDB) CopyBasicFieldsFromContent_WOP

func (contentDB *ContentDB) CopyBasicFieldsFromContent_WOP(content *models.Content_WOP)

CopyBasicFieldsFromContent_WOP

func (*ContentDB) CopyBasicFieldsToContent

func (contentDB *ContentDB) CopyBasicFieldsToContent(content *models.Content)

CopyBasicFieldsToContent

func (*ContentDB) CopyBasicFieldsToContentWOP

func (contentDB *ContentDB) CopyBasicFieldsToContentWOP(content *ContentWOP)

CopyBasicFieldsToContentWOP

func (*ContentDB) CopyBasicFieldsToContent_WOP

func (contentDB *ContentDB) CopyBasicFieldsToContent_WOP(content *models.Content_WOP)

CopyBasicFieldsToContent_WOP

func (*ContentDB) DecodePointers

func (contentDB *ContentDB) DecodePointers(backRepo *BackRepoStruct, content *models.Content)

type ContentDBResponse

type ContentDBResponse struct {
	ContentDB
}

ContentDBResponse provides response swagger:response contentDBResponse

type ContentDBs

type ContentDBs []ContentDB

ContentDBs arrays contentDBs swagger:response contentDBsResponse

type ContentPointersEncoding

type ContentPointersEncoding struct {
}

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

type ContentWOP

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

	Name string `xlsx:"1"`

	Content string `xlsx:"2"`
}

ContentWOP is a Content 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 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 JpgImageAPI

type JpgImageAPI struct {
	gorm.Model

	models.JpgImage_WOP

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

JpgImageAPI 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 jpgimageAPI

type JpgImageDB

type JpgImageDB struct {
	gorm.Model

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

	// Declation for basic field jpgimageDB.Base64Content
	Base64Content_Data sql.NullString

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

JpgImageDB describes a jpgimage 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 jpgimageDB

func (*JpgImageDB) CopyBasicFieldsFromJpgImage

func (jpgimageDB *JpgImageDB) CopyBasicFieldsFromJpgImage(jpgimage *models.JpgImage)

CopyBasicFieldsFromJpgImage

func (*JpgImageDB) CopyBasicFieldsFromJpgImageWOP

func (jpgimageDB *JpgImageDB) CopyBasicFieldsFromJpgImageWOP(jpgimage *JpgImageWOP)

CopyBasicFieldsFromJpgImageWOP

func (*JpgImageDB) CopyBasicFieldsFromJpgImage_WOP

func (jpgimageDB *JpgImageDB) CopyBasicFieldsFromJpgImage_WOP(jpgimage *models.JpgImage_WOP)

CopyBasicFieldsFromJpgImage_WOP

func (*JpgImageDB) CopyBasicFieldsToJpgImage

func (jpgimageDB *JpgImageDB) CopyBasicFieldsToJpgImage(jpgimage *models.JpgImage)

CopyBasicFieldsToJpgImage

func (*JpgImageDB) CopyBasicFieldsToJpgImageWOP

func (jpgimageDB *JpgImageDB) CopyBasicFieldsToJpgImageWOP(jpgimage *JpgImageWOP)

CopyBasicFieldsToJpgImageWOP

func (*JpgImageDB) CopyBasicFieldsToJpgImage_WOP

func (jpgimageDB *JpgImageDB) CopyBasicFieldsToJpgImage_WOP(jpgimage *models.JpgImage_WOP)

CopyBasicFieldsToJpgImage_WOP

func (*JpgImageDB) DecodePointers

func (jpgimageDB *JpgImageDB) DecodePointers(backRepo *BackRepoStruct, jpgimage *models.JpgImage)

type JpgImageDBResponse

type JpgImageDBResponse struct {
	JpgImageDB
}

JpgImageDBResponse provides response swagger:response jpgimageDBResponse

type JpgImageDBs

type JpgImageDBs []JpgImageDB

JpgImageDBs arrays jpgimageDBs swagger:response jpgimageDBsResponse

type JpgImagePointersEncoding

type JpgImagePointersEncoding struct {
}

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

type JpgImageWOP

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

	Name string `xlsx:"1"`

	Base64Content string `xlsx:"2"`
}

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

type PngImageAPI

type PngImageAPI struct {
	gorm.Model

	models.PngImage_WOP

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

PngImageAPI 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 pngimageAPI

type PngImageDB

type PngImageDB struct {
	gorm.Model

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

	// Declation for basic field pngimageDB.Base64Content
	Base64Content_Data sql.NullString

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

PngImageDB describes a pngimage 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 pngimageDB

func (*PngImageDB) CopyBasicFieldsFromPngImage

func (pngimageDB *PngImageDB) CopyBasicFieldsFromPngImage(pngimage *models.PngImage)

CopyBasicFieldsFromPngImage

func (*PngImageDB) CopyBasicFieldsFromPngImageWOP

func (pngimageDB *PngImageDB) CopyBasicFieldsFromPngImageWOP(pngimage *PngImageWOP)

CopyBasicFieldsFromPngImageWOP

func (*PngImageDB) CopyBasicFieldsFromPngImage_WOP

func (pngimageDB *PngImageDB) CopyBasicFieldsFromPngImage_WOP(pngimage *models.PngImage_WOP)

CopyBasicFieldsFromPngImage_WOP

func (*PngImageDB) CopyBasicFieldsToPngImage

func (pngimageDB *PngImageDB) CopyBasicFieldsToPngImage(pngimage *models.PngImage)

CopyBasicFieldsToPngImage

func (*PngImageDB) CopyBasicFieldsToPngImageWOP

func (pngimageDB *PngImageDB) CopyBasicFieldsToPngImageWOP(pngimage *PngImageWOP)

CopyBasicFieldsToPngImageWOP

func (*PngImageDB) CopyBasicFieldsToPngImage_WOP

func (pngimageDB *PngImageDB) CopyBasicFieldsToPngImage_WOP(pngimage *models.PngImage_WOP)

CopyBasicFieldsToPngImage_WOP

func (*PngImageDB) DecodePointers

func (pngimageDB *PngImageDB) DecodePointers(backRepo *BackRepoStruct, pngimage *models.PngImage)

type PngImageDBResponse

type PngImageDBResponse struct {
	PngImageDB
}

PngImageDBResponse provides response swagger:response pngimageDBResponse

type PngImageDBs

type PngImageDBs []PngImageDB

PngImageDBs arrays pngimageDBs swagger:response pngimageDBsResponse

type PngImagePointersEncoding

type PngImagePointersEncoding struct {
}

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

type PngImageWOP

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

	Name string `xlsx:"1"`

	Base64Content string `xlsx:"2"`
}

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

type SvgImageAPI

type SvgImageAPI struct {
	gorm.Model

	models.SvgImage_WOP

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

SvgImageAPI 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 svgimageAPI

type SvgImageDB

type SvgImageDB struct {
	gorm.Model

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

	// Declation for basic field svgimageDB.Content
	Content_Data sql.NullString

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

SvgImageDB describes a svgimage 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 svgimageDB

func (*SvgImageDB) CopyBasicFieldsFromSvgImage

func (svgimageDB *SvgImageDB) CopyBasicFieldsFromSvgImage(svgimage *models.SvgImage)

CopyBasicFieldsFromSvgImage

func (*SvgImageDB) CopyBasicFieldsFromSvgImageWOP

func (svgimageDB *SvgImageDB) CopyBasicFieldsFromSvgImageWOP(svgimage *SvgImageWOP)

CopyBasicFieldsFromSvgImageWOP

func (*SvgImageDB) CopyBasicFieldsFromSvgImage_WOP

func (svgimageDB *SvgImageDB) CopyBasicFieldsFromSvgImage_WOP(svgimage *models.SvgImage_WOP)

CopyBasicFieldsFromSvgImage_WOP

func (*SvgImageDB) CopyBasicFieldsToSvgImage

func (svgimageDB *SvgImageDB) CopyBasicFieldsToSvgImage(svgimage *models.SvgImage)

CopyBasicFieldsToSvgImage

func (*SvgImageDB) CopyBasicFieldsToSvgImageWOP

func (svgimageDB *SvgImageDB) CopyBasicFieldsToSvgImageWOP(svgimage *SvgImageWOP)

CopyBasicFieldsToSvgImageWOP

func (*SvgImageDB) CopyBasicFieldsToSvgImage_WOP

func (svgimageDB *SvgImageDB) CopyBasicFieldsToSvgImage_WOP(svgimage *models.SvgImage_WOP)

CopyBasicFieldsToSvgImage_WOP

func (*SvgImageDB) DecodePointers

func (svgimageDB *SvgImageDB) DecodePointers(backRepo *BackRepoStruct, svgimage *models.SvgImage)

type SvgImageDBResponse

type SvgImageDBResponse struct {
	SvgImageDB
}

SvgImageDBResponse provides response swagger:response svgimageDBResponse

type SvgImageDBs

type SvgImageDBs []SvgImageDB

SvgImageDBs arrays svgimageDBs swagger:response svgimageDBsResponse

type SvgImagePointersEncoding

type SvgImagePointersEncoding struct {
}

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

type SvgImageWOP

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

	Name string `xlsx:"1"`

	Content string `xlsx:"2"`
}

SvgImageWOP is a SvgImage 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