orm

package
v0.0.0-...-22ad4ad Latest Latest
Warning

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

Go to latest
Published: Mar 1, 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

do not modify, generated file

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

Index

Constants

This section is empty.

Variables

View Source
var BackRepoButtonid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoGroupid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var BackRepoLayoutid_atBckpTime_newID map[uint]uint

this field is used during the restauration process. it stores the ID at the backup time and is used for renumbering

View Source
var Button_Fields = []string{

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

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

	"ID",
	"Name",
}

Functions

func CopyBackRepoToBackRepoData

func CopyBackRepoToBackRepoData(backRepo *BackRepoStruct, backRepoData *BackRepoData)

func GetID

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

func GetIDPointer

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

func GetInstanceDBFromInstance

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

func GetReverseFieldOwner

func GetReverseFieldOwner[T models.Gongstruct](
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance *T,
	reverseField *models.ReverseField) (res any)

func GetReverseFieldOwnerName

func GetReverseFieldOwnerName(
	stage *models.StageStruct,
	backRepo *BackRepoStruct,
	instance any,
	reverseField *models.ReverseField) (res string)

Types

type BackRepoButtonStruct

type BackRepoButtonStruct struct {
	// stores ButtonDB according to their gorm ID
	Map_ButtonDBID_ButtonDB map[uint]*ButtonDB

	// stores ButtonDB ID according to Button address
	Map_ButtonPtr_ButtonDBID map[*models.Button]uint

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

func (*BackRepoButtonStruct) Backup

func (backRepoButton *BackRepoButtonStruct) Backup(dirPath string)

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

func (*BackRepoButtonStruct) BackupXL

func (backRepoButton *BackRepoButtonStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoButtonStruct) CheckoutPhaseOne

func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseOne() (Error error)

BackRepoButton.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoButtonStruct) CheckoutPhaseOneInstance

func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseOneInstance(buttonDB *ButtonDB) (Error error)

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

func (*BackRepoButtonStruct) CheckoutPhaseTwo

func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoButtonStruct) CheckoutPhaseTwoInstance

func (backRepoButton *BackRepoButtonStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, buttonDB *ButtonDB) (Error error)

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

func (*BackRepoButtonStruct) CommitDeleteInstance

func (backRepoButton *BackRepoButtonStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoButton.CommitDeleteInstance commits deletion of Button to the BackRepo

func (*BackRepoButtonStruct) CommitPhaseOne

func (backRepoButton *BackRepoButtonStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoButton.CommitPhaseOne commits all staged instances of Button to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoButtonStruct) CommitPhaseOneInstance

func (backRepoButton *BackRepoButtonStruct) CommitPhaseOneInstance(button *models.Button) (Error error)

BackRepoButton.CommitPhaseOneInstance commits button staged instances of Button to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoButtonStruct) CommitPhaseTwo

func (backRepoButton *BackRepoButtonStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoButtonStruct) CommitPhaseTwoInstance

func (backRepoButton *BackRepoButtonStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, button *models.Button) (Error error)

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

func (*BackRepoButtonStruct) GetButtonDBFromButtonPtr

func (backRepoButton *BackRepoButtonStruct) GetButtonDBFromButtonPtr(button *models.Button) (buttonDB *ButtonDB)

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

func (*BackRepoButtonStruct) GetDB

func (backRepoButton *BackRepoButtonStruct) GetDB() db.DBInterface

func (*BackRepoButtonStruct) GetStage

func (backRepoButton *BackRepoButtonStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoButtonStruct) ResetReversePointers

func (backRepoButton *BackRepoButtonStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoButtonStruct) ResetReversePointersInstance

func (backRepoButton *BackRepoButtonStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, button *models.Button) (Error error)

func (*BackRepoButtonStruct) RestorePhaseOne

func (backRepoButton *BackRepoButtonStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoButtonStruct) RestorePhaseTwo

func (backRepoButton *BackRepoButtonStruct) RestorePhaseTwo()

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

func (*BackRepoButtonStruct) RestoreXLPhaseOne

func (backRepoButton *BackRepoButtonStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Button" sheet all ButtonDB instances

type BackRepoData

type BackRepoData struct {
	ButtonAPIs []*ButtonAPI

	GroupAPIs []*GroupAPI

	LayoutAPIs []*LayoutAPI

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

type BackRepoGroupStruct

type BackRepoGroupStruct struct {
	// stores GroupDB according to their gorm ID
	Map_GroupDBID_GroupDB map[uint]*GroupDB

	// stores GroupDB ID according to Group address
	Map_GroupPtr_GroupDBID map[*models.Group]uint

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

func (*BackRepoGroupStruct) Backup

func (backRepoGroup *BackRepoGroupStruct) Backup(dirPath string)

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

func (*BackRepoGroupStruct) BackupXL

func (backRepoGroup *BackRepoGroupStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoGroupStruct) CheckoutPhaseOne

func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseOne() (Error error)

BackRepoGroup.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoGroupStruct) CheckoutPhaseOneInstance

func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseOneInstance(groupDB *GroupDB) (Error error)

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

func (*BackRepoGroupStruct) CheckoutPhaseTwo

func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoGroupStruct) CheckoutPhaseTwoInstance

func (backRepoGroup *BackRepoGroupStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, groupDB *GroupDB) (Error error)

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

func (*BackRepoGroupStruct) CommitDeleteInstance

func (backRepoGroup *BackRepoGroupStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoGroup.CommitDeleteInstance commits deletion of Group to the BackRepo

func (*BackRepoGroupStruct) CommitPhaseOne

func (backRepoGroup *BackRepoGroupStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoGroup.CommitPhaseOne commits all staged instances of Group to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoGroupStruct) CommitPhaseOneInstance

func (backRepoGroup *BackRepoGroupStruct) CommitPhaseOneInstance(group *models.Group) (Error error)

BackRepoGroup.CommitPhaseOneInstance commits group staged instances of Group to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoGroupStruct) CommitPhaseTwo

func (backRepoGroup *BackRepoGroupStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoGroupStruct) CommitPhaseTwoInstance

func (backRepoGroup *BackRepoGroupStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, group *models.Group) (Error error)

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

func (*BackRepoGroupStruct) GetDB

func (backRepoGroup *BackRepoGroupStruct) GetDB() db.DBInterface

func (*BackRepoGroupStruct) GetGroupDBFromGroupPtr

func (backRepoGroup *BackRepoGroupStruct) GetGroupDBFromGroupPtr(group *models.Group) (groupDB *GroupDB)

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

func (*BackRepoGroupStruct) GetStage

func (backRepoGroup *BackRepoGroupStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoGroupStruct) ResetReversePointers

func (backRepoGroup *BackRepoGroupStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoGroupStruct) ResetReversePointersInstance

func (backRepoGroup *BackRepoGroupStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, group *models.Group) (Error error)

func (*BackRepoGroupStruct) RestorePhaseOne

func (backRepoGroup *BackRepoGroupStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoGroupStruct) RestorePhaseTwo

func (backRepoGroup *BackRepoGroupStruct) RestorePhaseTwo()

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

func (*BackRepoGroupStruct) RestoreXLPhaseOne

func (backRepoGroup *BackRepoGroupStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Group" sheet all GroupDB instances

type BackRepoLayoutStruct

type BackRepoLayoutStruct struct {
	// stores LayoutDB according to their gorm ID
	Map_LayoutDBID_LayoutDB map[uint]*LayoutDB

	// stores LayoutDB ID according to Layout address
	Map_LayoutPtr_LayoutDBID map[*models.Layout]uint

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

func (*BackRepoLayoutStruct) Backup

func (backRepoLayout *BackRepoLayoutStruct) Backup(dirPath string)

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

func (*BackRepoLayoutStruct) BackupXL

func (backRepoLayout *BackRepoLayoutStruct) BackupXL(file *xlsx.File)

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

func (*BackRepoLayoutStruct) CheckoutPhaseOne

func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseOne() (Error error)

BackRepoLayout.CheckoutPhaseOne Checkouts all BackRepo instances to the Stage

Phase One will result in having instances on the stage aligned with the back repo pointers are not initialized yet (this is for phase two)

func (*BackRepoLayoutStruct) CheckoutPhaseOneInstance

func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseOneInstance(layoutDB *LayoutDB) (Error error)

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

func (*BackRepoLayoutStruct) CheckoutPhaseTwo

func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoLayoutStruct) CheckoutPhaseTwoInstance

func (backRepoLayout *BackRepoLayoutStruct) CheckoutPhaseTwoInstance(backRepo *BackRepoStruct, layoutDB *LayoutDB) (Error error)

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

func (*BackRepoLayoutStruct) CommitDeleteInstance

func (backRepoLayout *BackRepoLayoutStruct) CommitDeleteInstance(id uint) (Error error)

BackRepoLayout.CommitDeleteInstance commits deletion of Layout to the BackRepo

func (*BackRepoLayoutStruct) CommitPhaseOne

func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseOne(stage *models.StageStruct) (Error error)

BackRepoLayout.CommitPhaseOne commits all staged instances of Layout to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoLayoutStruct) CommitPhaseOneInstance

func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseOneInstance(layout *models.Layout) (Error error)

BackRepoLayout.CommitPhaseOneInstance commits layout staged instances of Layout to the BackRepo Phase One is the creation of instance in the database if it is not yet done to get the unique ID for each staged instance

func (*BackRepoLayoutStruct) CommitPhaseTwo

func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseTwo(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoLayoutStruct) CommitPhaseTwoInstance

func (backRepoLayout *BackRepoLayoutStruct) CommitPhaseTwoInstance(backRepo *BackRepoStruct, idx uint, layout *models.Layout) (Error error)

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

func (*BackRepoLayoutStruct) GetDB

func (backRepoLayout *BackRepoLayoutStruct) GetDB() db.DBInterface

func (*BackRepoLayoutStruct) GetLayoutDBFromLayoutPtr

func (backRepoLayout *BackRepoLayoutStruct) GetLayoutDBFromLayoutPtr(layout *models.Layout) (layoutDB *LayoutDB)

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

func (*BackRepoLayoutStruct) GetStage

func (backRepoLayout *BackRepoLayoutStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoLayoutStruct) ResetReversePointers

func (backRepoLayout *BackRepoLayoutStruct) ResetReversePointers(backRepo *BackRepoStruct) (Error error)

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

func (*BackRepoLayoutStruct) ResetReversePointersInstance

func (backRepoLayout *BackRepoLayoutStruct) ResetReversePointersInstance(backRepo *BackRepoStruct, idx uint, layout *models.Layout) (Error error)

func (*BackRepoLayoutStruct) RestorePhaseOne

func (backRepoLayout *BackRepoLayoutStruct) RestorePhaseOne(dirPath string)

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

func (*BackRepoLayoutStruct) RestorePhaseTwo

func (backRepoLayout *BackRepoLayoutStruct) RestorePhaseTwo()

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

func (*BackRepoLayoutStruct) RestoreXLPhaseOne

func (backRepoLayout *BackRepoLayoutStruct) RestoreXLPhaseOne(file *xlsx.File)

RestoreXL from the "Layout" sheet all LayoutDB instances

type BackRepoStruct

type BackRepoStruct struct {
	// insertion point for per struct back repo declarations
	BackRepoButton BackRepoButtonStruct

	BackRepoGroup BackRepoGroupStruct

	BackRepoLayout BackRepoLayoutStruct

	CommitFromBackNb uint // records commit increments when performed by the back

	PushFromFrontNb uint // records commit increments when performed by the front
	// contains filtered or unexported fields
}

BackRepoStruct supports callback functions

func NewBackRepo

func NewBackRepo(stage *models.StageStruct, filename string) (backRepo *BackRepoStruct)

func (*BackRepoStruct) Backup

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

Backup the BackRepoStruct

func (*BackRepoStruct) BackupXL

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

Backup in XL the BackRepoStruct

func (*BackRepoStruct) Checkout

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

Checkout the database into the stage

func (*BackRepoStruct) CheckoutButton

func (backRepo *BackRepoStruct) CheckoutButton(button *models.Button)

CommitButton allows checkout of a single button (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutGroup

func (backRepo *BackRepoStruct) CheckoutGroup(group *models.Group)

CommitGroup allows checkout of a single group (if already staged and with a BackRepo id)

func (*BackRepoStruct) CheckoutLayout

func (backRepo *BackRepoStruct) CheckoutLayout(layout *models.Layout)

CommitLayout allows checkout of a single layout (if already staged and with a BackRepo id)

func (*BackRepoStruct) Commit

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

Commit the BackRepoStruct inner variables and link to the database

func (*BackRepoStruct) CommitButton

func (backRepo *BackRepoStruct) CommitButton(button *models.Button)

CommitButton allows commit of a single button (if already staged)

func (*BackRepoStruct) CommitGroup

func (backRepo *BackRepoStruct) CommitGroup(group *models.Group)

CommitGroup allows commit of a single group (if already staged)

func (*BackRepoStruct) CommitLayout

func (backRepo *BackRepoStruct) CommitLayout(layout *models.Layout)

CommitLayout allows commit of a single layout (if already staged)

func (*BackRepoStruct) GetLastCommitFromBackNb

func (backRepo *BackRepoStruct) GetLastCommitFromBackNb() uint

func (*BackRepoStruct) GetLastPushFromFrontNb

func (backRepo *BackRepoStruct) GetLastPushFromFrontNb() uint

func (*BackRepoStruct) GetStage

func (backRepo *BackRepoStruct) GetStage() (stage *models.StageStruct)

func (*BackRepoStruct) IncrementCommitFromBackNb

func (backRepo *BackRepoStruct) IncrementCommitFromBackNb() uint

func (*BackRepoStruct) IncrementPushFromFrontNb

func (backRepo *BackRepoStruct) IncrementPushFromFrontNb() uint

func (*BackRepoStruct) Restore

func (backRepo *BackRepoStruct) Restore(stage *models.StageStruct, dirPath string)

Restore the database into the back repo

func (*BackRepoStruct) RestoreXL

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

Restore the database into the back repo

func (*BackRepoStruct) SubscribeToCommitNb

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

type ButtonAPI

type ButtonAPI struct {
	gorm.Model

	models.Button_WOP

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

ButtonAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model buttonAPI

type ButtonDB

type ButtonDB struct {
	gorm.Model

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

	// Declation for basic field buttonDB.Label
	Label_Data sql.NullString

	// Declation for basic field buttonDB.Icon
	Icon_Data sql.NullString

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

ButtonDB describes a button in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model buttonDB

func (*ButtonDB) CopyBasicFieldsFromButton

func (buttonDB *ButtonDB) CopyBasicFieldsFromButton(button *models.Button)

CopyBasicFieldsFromButton

func (*ButtonDB) CopyBasicFieldsFromButtonWOP

func (buttonDB *ButtonDB) CopyBasicFieldsFromButtonWOP(button *ButtonWOP)

CopyBasicFieldsFromButtonWOP

func (*ButtonDB) CopyBasicFieldsFromButton_WOP

func (buttonDB *ButtonDB) CopyBasicFieldsFromButton_WOP(button *models.Button_WOP)

CopyBasicFieldsFromButton_WOP

func (*ButtonDB) CopyBasicFieldsToButton

func (buttonDB *ButtonDB) CopyBasicFieldsToButton(button *models.Button)

CopyBasicFieldsToButton

func (*ButtonDB) CopyBasicFieldsToButtonWOP

func (buttonDB *ButtonDB) CopyBasicFieldsToButtonWOP(button *ButtonWOP)

CopyBasicFieldsToButtonWOP

func (*ButtonDB) CopyBasicFieldsToButton_WOP

func (buttonDB *ButtonDB) CopyBasicFieldsToButton_WOP(button *models.Button_WOP)

CopyBasicFieldsToButton_WOP

func (*ButtonDB) DecodePointers

func (buttonDB *ButtonDB) DecodePointers(backRepo *BackRepoStruct, button *models.Button)

type ButtonDBResponse

type ButtonDBResponse struct {
	ButtonDB
}

ButtonDBResponse provides response swagger:response buttonDBResponse

type ButtonDBs

type ButtonDBs []ButtonDB

ButtonDBs arrays buttonDBs swagger:response buttonDBsResponse

type ButtonPointersEncoding

type ButtonPointersEncoding struct {
}

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

type ButtonWOP

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

	Name string `xlsx:"1"`

	Label string `xlsx:"2"`

	Icon string `xlsx:"3"`
}

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

type DBLite

type DBLite struct {
	// contains filtered or unexported fields
}

DBLite is an in-memory database implementation of DBInterface

func NewDBLite

func NewDBLite() *DBLite

NewDBLite creates a new instance of DBLite

func (*DBLite) Create

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

Create inserts a new record into the database

func (*DBLite) Delete

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

Delete removes a record from the database

func (*DBLite) Find

func (db *DBLite) Find(instanceDBs any) (db.DBInterface, error)

Find retrieves all records of a type from the database

func (*DBLite) First

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

First retrieves the first record of a type from the database

func (*DBLite) Model

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

Model is a placeholder in this implementation

func (*DBLite) Save

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

Save updates or inserts a record into the database

func (*DBLite) Unscoped

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

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

func (*DBLite) Updates

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

Updates modifies an existing record in the database

type GongstructDB

type GongstructDB interface {
}

type GroupAPI

type GroupAPI struct {
	gorm.Model

	models.Group_WOP

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

GroupAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model groupAPI

type GroupDB

type GroupDB struct {
	gorm.Model

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

	// Declation for basic field groupDB.Percentage
	Percentage_Data sql.NullFloat64

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

GroupDB describes a group in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model groupDB

func (*GroupDB) CopyBasicFieldsFromGroup

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

CopyBasicFieldsFromGroup

func (*GroupDB) CopyBasicFieldsFromGroupWOP

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

CopyBasicFieldsFromGroupWOP

func (*GroupDB) CopyBasicFieldsFromGroup_WOP

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

CopyBasicFieldsFromGroup_WOP

func (*GroupDB) CopyBasicFieldsToGroup

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

CopyBasicFieldsToGroup

func (*GroupDB) CopyBasicFieldsToGroupWOP

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

CopyBasicFieldsToGroupWOP

func (*GroupDB) CopyBasicFieldsToGroup_WOP

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

CopyBasicFieldsToGroup_WOP

func (*GroupDB) DecodePointers

func (groupDB *GroupDB) DecodePointers(backRepo *BackRepoStruct, group *models.Group)

type GroupDBResponse

type GroupDBResponse struct {
	GroupDB
}

GroupDBResponse provides response swagger:response groupDBResponse

type GroupDBs

type GroupDBs []GroupDB

GroupDBs arrays groupDBs swagger:response groupDBsResponse

type GroupPointersEncoding

type GroupPointersEncoding struct {

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

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

type GroupWOP

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

	Name string `xlsx:"1"`

	Percentage float64 `xlsx:"2"`
}

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

type IntSlice

type IntSlice []int

func (*IntSlice) Scan

func (s *IntSlice) Scan(value interface{}) error

Scan makes IntSlice implement the sql.Scanner interface.

func (IntSlice) Value

func (s IntSlice) Value() (driver.Value, error)

Value makes IntSlice implement the driver.Valuer interface.

type LayoutAPI

type LayoutAPI struct {
	gorm.Model

	models.Layout_WOP

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

LayoutAPI is the input in POST API

for POST, API, one needs the fields of the model as well as the fields from associations ("Has One" and "Has Many") that are generated to fullfill the ORM requirements for associations

swagger:model layoutAPI

type LayoutDB

type LayoutDB struct {
	gorm.Model

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

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

LayoutDB describes a layout in the database

It incorporates the GORM ID, basic fields from the model (because they can be serialized), the encoded version of pointers

swagger:model layoutDB

func (*LayoutDB) CopyBasicFieldsFromLayout

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

CopyBasicFieldsFromLayout

func (*LayoutDB) CopyBasicFieldsFromLayoutWOP

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

CopyBasicFieldsFromLayoutWOP

func (*LayoutDB) CopyBasicFieldsFromLayout_WOP

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

CopyBasicFieldsFromLayout_WOP

func (*LayoutDB) CopyBasicFieldsToLayout

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

CopyBasicFieldsToLayout

func (*LayoutDB) CopyBasicFieldsToLayoutWOP

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

CopyBasicFieldsToLayoutWOP

func (*LayoutDB) CopyBasicFieldsToLayout_WOP

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

CopyBasicFieldsToLayout_WOP

func (*LayoutDB) DecodePointers

func (layoutDB *LayoutDB) DecodePointers(backRepo *BackRepoStruct, layout *models.Layout)

type LayoutDBResponse

type LayoutDBResponse struct {
	LayoutDB
}

LayoutDBResponse provides response swagger:response layoutDBResponse

type LayoutDBs

type LayoutDBs []LayoutDB

LayoutDBs arrays layoutDBs swagger:response layoutDBsResponse

type LayoutPointersEncoding

type LayoutPointersEncoding struct {

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

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

type LayoutWOP

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

	Name string `xlsx:"1"`
}

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

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