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
do not modify, generated file
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
Index ¶
- Variables
- func CopyBackRepoToBackRepoData(backRepo *BackRepoStruct, backRepoData *BackRepoData)
- func GetID[T models.Gongstruct](stage *models.StageStruct, backRepo *BackRepoStruct, instance *T) (id int)
- func GetIDPointer[T models.PointerToGongstruct](stage *models.StageStruct, backRepo *BackRepoStruct, instance T) (id int)
- func GetInstanceDBFromInstance[T models.Gongstruct, T2 GongstructDB](stage *models.StageStruct, backRepo *BackRepoStruct, instance *T) (ret *T2)
- func GetReverseFieldOwner[T models.Gongstruct](stage *models.StageStruct, backRepo *BackRepoStruct, instance *T, ...) (res any)
- func GetReverseFieldOwnerName[T models.Gongstruct](stage *models.StageStruct, backRepo *BackRepoStruct, instance *T, ...) (res string)
- type AAPI
- type ADB
- func (aDB *ADB) CopyBasicFieldsFromA(a *models.A)
- func (aDB *ADB) CopyBasicFieldsFromAWOP(a *AWOP)
- func (aDB *ADB) CopyBasicFieldsFromA_WOP(a *models.A_WOP)
- func (aDB *ADB) CopyBasicFieldsToA(a *models.A)
- func (aDB *ADB) CopyBasicFieldsToAWOP(a *AWOP)
- func (aDB *ADB) CopyBasicFieldsToA_WOP(a *models.A_WOP)
- func (aDB *ADB) DecodePointers(backRepo *BackRepoStruct, a *models.A)
- type ADBResponse
- type ADBs
- type APointersEncoding
- type AWOP
- type BAPI
- type BDB
- func (bDB *BDB) CopyBasicFieldsFromB(b *models.B)
- func (bDB *BDB) CopyBasicFieldsFromBWOP(b *BWOP)
- func (bDB *BDB) CopyBasicFieldsFromB_WOP(b *models.B_WOP)
- func (bDB *BDB) CopyBasicFieldsToB(b *models.B)
- func (bDB *BDB) CopyBasicFieldsToBWOP(b *BWOP)
- func (bDB *BDB) CopyBasicFieldsToB_WOP(b *models.B_WOP)
- func (bDB *BDB) DecodePointers(backRepo *BackRepoStruct, b *models.B)
- type BDBResponse
- type BDBs
- type BPointersEncoding
- type BWOP
- type BackRepoAStruct
- func (backRepoA *BackRepoAStruct) Backup(dirPath string)
- func (backRepoA *BackRepoAStruct) BackupXL(file *xlsx.File)
- func (backRepoA *BackRepoAStruct) CheckoutPhaseOne() (Error error)
- func (backRepoA *BackRepoAStruct) CheckoutPhaseOneInstance(aDB *ADB) (Error error)
- func (backRepoA *BackRepoAStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoA *BackRepoAStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, aDB *ADB) (Error error)
- func (backRepoA *BackRepoAStruct) CommitDeleteInstance(id uint) (Error error)
- func (backRepoA *BackRepoAStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
- func (backRepoA *BackRepoAStruct) CommitPhaseOneInstance(a *models.A) (Error error)
- func (backRepoA *BackRepoAStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoA *BackRepoAStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, a *models.A) (Error error)
- func (backRepoA *BackRepoAStruct) GetADBFromAPtr(a *models.A) (aDB *ADB)
- func (backRepoA *BackRepoAStruct) GetDB() db.DBInterface
- func (backRepoA *BackRepoAStruct) GetStage() (stage *models.StageStruct)
- func (backRepoA *BackRepoAStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
- func (backRepoA *BackRepoAStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, a *models.A) (Error error)
- func (backRepoA *BackRepoAStruct) RestorePhaseOne(dirPath string)
- func (backRepoA *BackRepoAStruct) RestorePhaseTwo()
- func (backRepoA *BackRepoAStruct) RestoreXLPhaseOne(file *xlsx.File)
- type BackRepoBStruct
- func (backRepoB *BackRepoBStruct) Backup(dirPath string)
- func (backRepoB *BackRepoBStruct) BackupXL(file *xlsx.File)
- func (backRepoB *BackRepoBStruct) CheckoutPhaseOne() (Error error)
- func (backRepoB *BackRepoBStruct) CheckoutPhaseOneInstance(bDB *BDB) (Error error)
- func (backRepoB *BackRepoBStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoB *BackRepoBStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, bDB *BDB) (Error error)
- func (backRepoB *BackRepoBStruct) CommitDeleteInstance(id uint) (Error error)
- func (backRepoB *BackRepoBStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
- func (backRepoB *BackRepoBStruct) CommitPhaseOneInstance(b *models.B) (Error error)
- func (backRepoB *BackRepoBStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
- func (backRepoB *BackRepoBStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, b *models.B) (Error error)
- func (backRepoB *BackRepoBStruct) GetBDBFromBPtr(b *models.B) (bDB *BDB)
- func (backRepoB *BackRepoBStruct) GetDB() db.DBInterface
- func (backRepoB *BackRepoBStruct) GetStage() (stage *models.StageStruct)
- func (backRepoB *BackRepoBStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
- func (backRepoB *BackRepoBStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, b *models.B) (Error error)
- func (backRepoB *BackRepoBStruct) RestorePhaseOne(dirPath string)
- func (backRepoB *BackRepoBStruct) RestorePhaseTwo()
- func (backRepoB *BackRepoBStruct) RestoreXLPhaseOne(file *xlsx.File)
- type BackRepoData
- type BackRepoStruct
- func (backRepo *BackRepoStruct) Backup(stage *models.StageStruct, dirPath string)
- func (backRepo *BackRepoStruct) BackupXL(stage *models.StageStruct, dirPath string)
- func (backRepo *BackRepoStruct) Checkout(stage *models.StageStruct)
- func (backRepo *BackRepoStruct) CheckoutA(a *models.A)
- func (backRepo *BackRepoStruct) CheckoutB(b *models.B)
- func (backRepo *BackRepoStruct) Commit(stage *models.StageStruct)
- func (backRepo *BackRepoStruct) CommitA(a *models.A)
- func (backRepo *BackRepoStruct) CommitB(b *models.B)
- func (backRepo *BackRepoStruct) GetLastCommitFromBackNb() uint
- func (backRepo *BackRepoStruct) GetLastPushFromFrontNb() uint
- func (backRepo *BackRepoStruct) GetStage() (stage *models.StageStruct)
- func (backRepo *BackRepoStruct) IncrementCommitFromBackNb() uint
- func (backRepo *BackRepoStruct) IncrementPushFromFrontNb() uint
- func (backRepo *BackRepoStruct) Restore(stage *models.StageStruct, dirPath string)
- func (backRepo *BackRepoStruct) RestoreXL(stage *models.StageStruct, dirPath string)
- func (backRepoStruct *BackRepoStruct) SubscribeToCommitNb(ctx context.Context) <-chan int
- type DBLite
- func (db *DBLite) Create(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Delete(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Find(instanceDBs any) (db.DBInterface, error)
- func (db *DBLite) First(instanceDB any, conds ...any) (db.DBInterface, error)
- func (db *DBLite) Model(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Save(instanceDB any) (db.DBInterface, error)
- func (db *DBLite) Unscoped() (db.DBInterface, error)
- func (db *DBLite) Updates(instanceDB any) (db.DBInterface, error)
- type GongstructDB
- type IntSlice
Constants ¶
This section is empty.
Variables ¶
var A_Fields = []string{
"ID",
"Name",
}
var B_Fields = []string{
"ID",
"Name",
}
var BackRepoAid_atBckpTime_newID map[uint]uint
this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering
var BackRepoBid_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
Functions ¶
func CopyBackRepoToBackRepoData ¶
func CopyBackRepoToBackRepoData(backRepo *BackRepoStruct, backRepoData *BackRepoData)
func GetID ¶
func GetID[T models.Gongstruct]( stage *models.StageStruct, backRepo *BackRepoStruct, instance *T) (id int)
func GetIDPointer ¶
func GetIDPointer[T models.PointerToGongstruct]( stage *models.StageStruct, backRepo *BackRepoStruct, instance T) (id int)
func GetInstanceDBFromInstance ¶
func GetInstanceDBFromInstance[T models.Gongstruct, T2 GongstructDB]( stage *models.StageStruct, backRepo *BackRepoStruct, instance *T) (ret *T2)
func GetReverseFieldOwner ¶
func GetReverseFieldOwner[T models.Gongstruct]( stage *models.StageStruct, backRepo *BackRepoStruct, instance *T, reverseField *models.ReverseField) (res any)
func GetReverseFieldOwnerName ¶
func GetReverseFieldOwnerName[T models.Gongstruct]( stage *models.StageStruct, backRepo *BackRepoStruct, instance *T, reverseField *models.ReverseField) (res string)
Types ¶
type AAPI ¶
type AAPI struct { gorm.Model models.A_WOP // encoding of pointers // for API, it cannot be embedded APointersEncoding APointersEncoding }
AAPI 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 aAPI
type ADB ¶
type ADB struct { gorm.Model // Declation for basic field aDB.Name Name_Data sql.NullString // encoding of pointers // for GORM serialization, it is necessary to embed to Pointer Encoding declaration APointersEncoding }
ADB describes a a 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 aDB
func (*ADB) CopyBasicFieldsFromA ¶
CopyBasicFieldsFromA
func (*ADB) CopyBasicFieldsFromAWOP ¶
CopyBasicFieldsFromAWOP
func (*ADB) CopyBasicFieldsFromA_WOP ¶
CopyBasicFieldsFromA_WOP
func (*ADB) CopyBasicFieldsToAWOP ¶
CopyBasicFieldsToAWOP
func (*ADB) CopyBasicFieldsToA_WOP ¶
CopyBasicFieldsToA_WOP
func (*ADB) DecodePointers ¶
func (aDB *ADB) DecodePointers(backRepo *BackRepoStruct, a *models.A)
type ADBResponse ¶
type ADBResponse struct {
ADB
}
ADBResponse provides response swagger:response aDBResponse
type APointersEncoding ¶
type APointersEncoding struct { }
APointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct
type AWOP ¶
AWOP is a A without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint
type BAPI ¶
type BAPI struct { gorm.Model models.B_WOP // encoding of pointers // for API, it cannot be embedded BPointersEncoding BPointersEncoding }
BAPI 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 bAPI
type BDB ¶
type BDB struct { gorm.Model // Declation for basic field bDB.Name Name_Data sql.NullString // encoding of pointers // for GORM serialization, it is necessary to embed to Pointer Encoding declaration BPointersEncoding }
BDB describes a b 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 bDB
func (*BDB) CopyBasicFieldsFromB ¶
CopyBasicFieldsFromB
func (*BDB) CopyBasicFieldsFromBWOP ¶
CopyBasicFieldsFromBWOP
func (*BDB) CopyBasicFieldsFromB_WOP ¶
CopyBasicFieldsFromB_WOP
func (*BDB) CopyBasicFieldsToBWOP ¶
CopyBasicFieldsToBWOP
func (*BDB) CopyBasicFieldsToB_WOP ¶
CopyBasicFieldsToB_WOP
func (*BDB) DecodePointers ¶
func (bDB *BDB) DecodePointers(backRepo *BackRepoStruct, b *models.B)
type BDBResponse ¶
type BDBResponse struct {
BDB
}
BDBResponse provides response swagger:response bDBResponse
type BPointersEncoding ¶
type BPointersEncoding struct { }
BPointersEncoding encodes pointers to Struct and reverse pointers of slice of poitners to Struct
type BWOP ¶
BWOP is a B without pointers (WOP is an acronym for "Without Pointers") it holds the same basic fields but pointers are encoded into uint
type BackRepoAStruct ¶
type BackRepoAStruct struct { // stores ADB according to their gorm ID Map_ADBID_ADB map[uint]*ADB // stores ADB ID according to A address Map_APtr_ADBID map[*models.A]uint // stores A according to their gorm ID Map_ADBID_APtr map[uint]*models.A // contains filtered or unexported fields }
func (*BackRepoAStruct) Backup ¶
func (backRepoA *BackRepoAStruct) Backup(dirPath string)
Backup generates a json file from a slice of all ADB instances in the backrepo
func (*BackRepoAStruct) BackupXL ¶
func (backRepoA *BackRepoAStruct) BackupXL(file *xlsx.File)
Backup generates a json file from a slice of all ADB instances in the backrepo
func (*BackRepoAStruct) CheckoutPhaseOne ¶
func (backRepoA *BackRepoAStruct) CheckoutPhaseOne() (Error error)
BackRepoA.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 (*BackRepoAStruct) CheckoutPhaseOneInstance ¶
func (backRepoA *BackRepoAStruct) CheckoutPhaseOneInstance(aDB *ADB) (Error error)
CheckoutPhaseOneInstance takes a aDB that has been found in the DB, updates the backRepo and stages the models version of the aDB
func (*BackRepoAStruct) CheckoutPhaseTwo ¶
func (backRepoA *BackRepoAStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoA.CheckoutPhaseTwo Checkouts all staged instances of A to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoAStruct) CheckoutPhaseTwoInstance ¶
func (backRepoA *BackRepoAStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, aDB *ADB) (Error error)
BackRepoA.CheckoutPhaseTwoInstance Checkouts staged instances of A to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoAStruct) CommitDeleteInstance ¶
func (backRepoA *BackRepoAStruct) CommitDeleteInstance(id uint) (Error error)
BackRepoA.CommitDeleteInstance commits deletion of A to the BackRepo
func (*BackRepoAStruct) CommitPhaseOne ¶
func (backRepoA *BackRepoAStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
BackRepoA.CommitPhaseOne commits all staged instances of A 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 (*BackRepoAStruct) CommitPhaseOneInstance ¶
func (backRepoA *BackRepoAStruct) CommitPhaseOneInstance(a *models.A) (Error error)
BackRepoA.CommitPhaseOneInstance commits a staged instances of A 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 (*BackRepoAStruct) CommitPhaseTwo ¶
func (backRepoA *BackRepoAStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoA.CommitPhaseTwo commits all staged instances of A to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoAStruct) CommitPhaseTwoInstance ¶
func (backRepoA *BackRepoAStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, a *models.A) (Error error)
BackRepoA.CommitPhaseTwoInstance commits {{structname }} of models.A to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoAStruct) GetADBFromAPtr ¶
func (backRepoA *BackRepoAStruct) GetADBFromAPtr(a *models.A) (aDB *ADB)
GetADBFromAPtr is a handy function to access the back repo instance from the stage instance
func (*BackRepoAStruct) GetDB ¶
func (backRepoA *BackRepoAStruct) GetDB() db.DBInterface
func (*BackRepoAStruct) GetStage ¶
func (backRepoA *BackRepoAStruct) GetStage() (stage *models.StageStruct)
func (*BackRepoAStruct) ResetReversePointers ¶
func (backRepoA *BackRepoAStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
BackRepoA.ResetReversePointers commits all staged instances of A to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoAStruct) ResetReversePointersInstance ¶
func (backRepoA *BackRepoAStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, a *models.A) (Error error)
func (*BackRepoAStruct) RestorePhaseOne ¶
func (backRepoA *BackRepoAStruct) RestorePhaseOne(dirPath string)
RestorePhaseOne read the file "ADB.json" in dirPath that stores an array of ADB and stores it in the database the map BackRepoAid_atBckpTime_newID is updated accordingly
func (*BackRepoAStruct) RestorePhaseTwo ¶
func (backRepoA *BackRepoAStruct) RestorePhaseTwo()
RestorePhaseTwo uses all map BackRepo<A>id_atBckpTime_newID to compute new index
func (*BackRepoAStruct) RestoreXLPhaseOne ¶
func (backRepoA *BackRepoAStruct) RestoreXLPhaseOne(file *xlsx.File)
RestoreXL from the "A" sheet all ADB instances
type BackRepoBStruct ¶
type BackRepoBStruct struct { // stores BDB according to their gorm ID Map_BDBID_BDB map[uint]*BDB // stores BDB ID according to B address Map_BPtr_BDBID map[*models.B]uint // stores B according to their gorm ID Map_BDBID_BPtr map[uint]*models.B // contains filtered or unexported fields }
func (*BackRepoBStruct) Backup ¶
func (backRepoB *BackRepoBStruct) Backup(dirPath string)
Backup generates a json file from a slice of all BDB instances in the backrepo
func (*BackRepoBStruct) BackupXL ¶
func (backRepoB *BackRepoBStruct) BackupXL(file *xlsx.File)
Backup generates a json file from a slice of all BDB instances in the backrepo
func (*BackRepoBStruct) CheckoutPhaseOne ¶
func (backRepoB *BackRepoBStruct) CheckoutPhaseOne() (Error error)
BackRepoB.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 (*BackRepoBStruct) CheckoutPhaseOneInstance ¶
func (backRepoB *BackRepoBStruct) CheckoutPhaseOneInstance(bDB *BDB) (Error error)
CheckoutPhaseOneInstance takes a bDB that has been found in the DB, updates the backRepo and stages the models version of the bDB
func (*BackRepoBStruct) CheckoutPhaseTwo ¶
func (backRepoB *BackRepoBStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoB.CheckoutPhaseTwo Checkouts all staged instances of B to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoBStruct) CheckoutPhaseTwoInstance ¶
func (backRepoB *BackRepoBStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, bDB *BDB) (Error error)
BackRepoB.CheckoutPhaseTwoInstance Checkouts staged instances of B to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoBStruct) CommitDeleteInstance ¶
func (backRepoB *BackRepoBStruct) CommitDeleteInstance(id uint) (Error error)
BackRepoB.CommitDeleteInstance commits deletion of B to the BackRepo
func (*BackRepoBStruct) CommitPhaseOne ¶
func (backRepoB *BackRepoBStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)
BackRepoB.CommitPhaseOne commits all staged instances of B 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 (*BackRepoBStruct) CommitPhaseOneInstance ¶
func (backRepoB *BackRepoBStruct) CommitPhaseOneInstance(b *models.B) (Error error)
BackRepoB.CommitPhaseOneInstance commits b staged instances of B 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 (*BackRepoBStruct) CommitPhaseTwo ¶
func (backRepoB *BackRepoBStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)
BackRepoB.CommitPhaseTwo commits all staged instances of B to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoBStruct) CommitPhaseTwoInstance ¶
func (backRepoB *BackRepoBStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, b *models.B) (Error error)
BackRepoB.CommitPhaseTwoInstance commits {{structname }} of models.B to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoBStruct) GetBDBFromBPtr ¶
func (backRepoB *BackRepoBStruct) GetBDBFromBPtr(b *models.B) (bDB *BDB)
GetBDBFromBPtr is a handy function to access the back repo instance from the stage instance
func (*BackRepoBStruct) GetDB ¶
func (backRepoB *BackRepoBStruct) GetDB() db.DBInterface
func (*BackRepoBStruct) GetStage ¶
func (backRepoB *BackRepoBStruct) GetStage() (stage *models.StageStruct)
func (*BackRepoBStruct) ResetReversePointers ¶
func (backRepoB *BackRepoBStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)
BackRepoB.ResetReversePointers commits all staged instances of B to the BackRepo Phase Two is the update of instance with the field in the database
func (*BackRepoBStruct) ResetReversePointersInstance ¶
func (backRepoB *BackRepoBStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, b *models.B) (Error error)
func (*BackRepoBStruct) RestorePhaseOne ¶
func (backRepoB *BackRepoBStruct) RestorePhaseOne(dirPath string)
RestorePhaseOne read the file "BDB.json" in dirPath that stores an array of BDB and stores it in the database the map BackRepoBid_atBckpTime_newID is updated accordingly
func (*BackRepoBStruct) RestorePhaseTwo ¶
func (backRepoB *BackRepoBStruct) RestorePhaseTwo()
RestorePhaseTwo uses all map BackRepo<B>id_atBckpTime_newID to compute new index
func (*BackRepoBStruct) RestoreXLPhaseOne ¶
func (backRepoB *BackRepoBStruct) RestoreXLPhaseOne(file *xlsx.File)
RestoreXL from the "B" sheet all BDB instances
type BackRepoData ¶
type BackRepoStruct ¶
type BackRepoStruct struct { // insertion point for per struct back repo declarations BackRepoA BackRepoAStruct BackRepoB BackRepoBStruct 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) CheckoutA ¶
func (backRepo *BackRepoStruct) CheckoutA(a *models.A)
CommitA allows checkout of a single a (if already staged and with a BackRepo id)
func (*BackRepoStruct) CheckoutB ¶
func (backRepo *BackRepoStruct) CheckoutB(b *models.B)
CommitB allows checkout of a single b (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) CommitA ¶
func (backRepo *BackRepoStruct) CommitA(a *models.A)
CommitA allows commit of a single a (if already staged)
func (*BackRepoStruct) CommitB ¶
func (backRepo *BackRepoStruct) CommitB(b *models.B)
CommitB allows commit of a single b (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 DBLite ¶
type DBLite struct {
// contains filtered or unexported fields
}
DBLite is an in-memory database implementation of DBInterface
func (*DBLite) Create ¶
func (db *DBLite) Create(instanceDB any) (db.DBInterface, error)
Create inserts a new record into the database
func (*DBLite) Delete ¶
func (db *DBLite) Delete(instanceDB any) (db.DBInterface, error)
Delete removes a record from the database
func (*DBLite) Find ¶
func (db *DBLite) Find(instanceDBs any) (db.DBInterface, error)
Find retrieves all records of a type from the database
func (*DBLite) Model ¶
func (db *DBLite) Model(instanceDB any) (db.DBInterface, error)
Model is a placeholder in this implementation
func (*DBLite) Save ¶
func (db *DBLite) Save(instanceDB any) (db.DBInterface, error)
Save updates or inserts a record into the database
type GongstructDB ¶
type GongstructDB interface { }