Documentation ¶
Overview ¶
generated by ModelGongFileTemplate
Index ¶
- Constants
- func AfterCreateFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
- func AfterDeleteFromFront[Type Gongstruct](stage *StageStruct, staged, front *Type)
- func AfterReadFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
- func AfterUpdateFromFront[Type Gongstruct](stage *StageStruct, old, new *Type)
- func CreateORMAnotherDummyData(anotherdummydata *AnotherDummyData)
- func CreateORMCell(cell *Cell)
- func CreateORMDummyData(dummydata *DummyData)
- func CreateORMElement(element *Element)
- func CreateORMMarkdownContent(markdowncontent *MarkdownContent)
- func CreateORMRow(row *Row)
- func DeleteORMAnotherDummyData(anotherdummydata *AnotherDummyData)
- func DeleteORMCell(cell *Cell)
- func DeleteORMDummyData(dummydata *DummyData)
- func DeleteORMElement(element *Element)
- func DeleteORMMarkdownContent(markdowncontent *MarkdownContent)
- func DeleteORMRow(row *Row)
- func GetAssociationName[Type Gongstruct]() *Type
- func GetFieldStringValue[Type Gongstruct](instance Type, fieldName string) (res string)
- func GetFields[Type Gongstruct]() (res []string)
- func GetGongstructInstancesMap[Type Gongstruct]() *map[string]*Type
- func GetGongstructInstancesSet[Type Gongstruct]() *map[*Type]any
- func GetGongstructName[Type Gongstruct]() (res string)
- func GetPointerReverseMap[Start, End Gongstruct](fieldname string) map[*End][]*Start
- func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string) map[*End]*Start
- func GongGetMap[Type GongstructMapString]() *Type
- func GongGetSet[Type GongstructSet]() *Type
- func IntToLetters(number int32) (letters string)
- func ParseAstFile(pathToFile string) error
- func Serialize[Type Gongstruct](tab Tabulator)
- func SerializeExcelize[Type Gongstruct](f *excelize.File)
- func SerializeStage(filename string)
- func SetCallbackAfterCreateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterCreateInterface[Type])
- func SetCallbackAfterDeleteFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterDeleteInterface[Type])
- func SetCallbackAfterReadFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterReadInterface[Type])
- func SetCallbackAfterUpdateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterUpdateInterface[Type])
- func UnmarshallGongstructStaging(assignStmt *ast.AssignStmt, astCoordinate_ string) (instance any, identifier string, gongstructName string, fieldName string)
- type AllModelsStructCreateInterface
- type AllModelsStructDeleteInterface
- type AnotherDummyData
- func (anotherdummydata *AnotherDummyData) Checkout() *AnotherDummyData
- func (anotherdummydata *AnotherDummyData) Commit() *AnotherDummyData
- func (anotherdummydata *AnotherDummyData) DeleteStageAndCommit() *AnotherDummyData
- func (anotherdummydata *AnotherDummyData) GetName() (res string)
- func (anotherdummydata *AnotherDummyData) Stage() *AnotherDummyData
- func (anotherdummydata *AnotherDummyData) StageAndCommit() *AnotherDummyData
- func (anotherdummydata *AnotherDummyData) StageCopy() *AnotherDummyData
- func (anotherdummydata *AnotherDummyData) StageCopyAndCommit() *AnotherDummyData
- func (anotherdummydata *AnotherDummyData) Unstage() *AnotherDummyData
- type BackRepoInterface
- type Cell
- func (cell *Cell) Checkout() *Cell
- func (cell *Cell) Commit() *Cell
- func (cell *Cell) DeleteStageAndCommit() *Cell
- func (cell *Cell) GetName() (res string)
- func (cell *Cell) Stage() *Cell
- func (cell *Cell) StageAndCommit() *Cell
- func (cell *Cell) StageCopy() *Cell
- func (cell *Cell) StageCopyAndCommit() *Cell
- func (cell *Cell) Unstage() *Cell
- type DummnyTypeInt
- type DummyData
- func (dummydata *DummyData) Checkout() *DummyData
- func (dummydata *DummyData) Commit() *DummyData
- func (dummydata *DummyData) DeleteStageAndCommit() *DummyData
- func (dummydata *DummyData) GetName() (res string)
- func (dummydata *DummyData) Stage() *DummyData
- func (dummydata *DummyData) StageAndCommit() *DummyData
- func (dummydata *DummyData) StageCopy() *DummyData
- func (dummydata *DummyData) StageCopyAndCommit() *DummyData
- func (dummydata *DummyData) Unstage() *DummyData
- type Element
- func (element *Element) AppendContent(content string)
- func (element *Element) Checkout() *Element
- func (element *Element) Commit() *Element
- func (element *Element) DeleteStageAndCommit() *Element
- func (element *Element) GetContent() string
- func (element *Element) GetName() (res string)
- func (element *Element) GetSubElements() []*Element
- func (element *Element) GetType() ElementType
- func (element *Element) SetContent(content string)
- func (element *Element) Stage() *Element
- func (element *Element) StageAndCommit() *Element
- func (element *Element) StageCopy() *Element
- func (element *Element) StageCopyAndCommit() *Element
- func (element *Element) Unstage() *Element
- type ElementInterface
- type ElementType
- type ExcelizeTabulator
- type GongStructInterface
- type Gongstruct
- type GongstructMapString
- type GongstructSet
- type MarkdownContent
- func (markdowncontent *MarkdownContent) Checkout() *MarkdownContent
- func (markdowncontent *MarkdownContent) Commit() *MarkdownContent
- func (markdowncontent *MarkdownContent) DeleteStageAndCommit() *MarkdownContent
- func (markdowncontent *MarkdownContent) GetName() (res string)
- func (markdownContent *MarkdownContent) RecursiveUpdateContent(element *Element, depth int)
- func (markdowncontent *MarkdownContent) Stage() *MarkdownContent
- func (markdowncontent *MarkdownContent) StageAndCommit() *MarkdownContent
- func (markdowncontent *MarkdownContent) StageCopy() *MarkdownContent
- func (markdowncontent *MarkdownContent) StageCopyAndCommit() *MarkdownContent
- func (markdowncontent *MarkdownContent) Unstage() *MarkdownContent
- func (markdownContent *MarkdownContent) UpdateContent()
- type OnAfterCreateInterface
- type OnAfterDeleteInterface
- type OnAfterReadInterface
- type OnAfterUpdateInterface
- type OnInitCommitInterface
- type PointerToGongstruct
- type Row
- func (row *Row) Checkout() *Row
- func (row *Row) Commit() *Row
- func (row *Row) DeleteStageAndCommit() *Row
- func (row *Row) GetName() (res string)
- func (row *Row) Stage() *Row
- func (row *Row) StageAndCommit() *Row
- func (row *Row) StageCopy() *Row
- func (row *Row) StageCopyAndCommit() *Row
- func (row *Row) Unstage() *Row
- type StageStruct
- func (stage *StageStruct) Backup(dirPath string)
- func (stage *StageStruct) BackupXL(dirPath string)
- func (stage *StageStruct) Checkout()
- func (stage *StageStruct) Commit()
- func (stageStruct *StageStruct) CreateReverseMap_DummyData_DummyPointerToGongStruct() (res map[*AnotherDummyData][]*DummyData)
- func (stageStruct *StageStruct) CreateReverseMap_Element_Rows() (res map[*Row]*Element)
- func (stageStruct *StageStruct) CreateReverseMap_Element_SubElements() (res map[*Element]*Element)
- func (stageStruct *StageStruct) CreateReverseMap_MarkdownContent_Root() (res map[*Element][]*MarkdownContent)
- func (stageStruct *StageStruct) CreateReverseMap_Row_Cells() (res map[*Cell]*Row)
- func (stage *StageStruct) Marshall(file *os.File, modelsPackageName, packageName string)
- func (stage *StageStruct) Nil()
- func (stage *StageStruct) Reset()
- func (stage *StageStruct) Restore(dirPath string)
- func (stage *StageStruct) RestoreXL(dirPath string)
- type Tabulator
Constants ¶
const IdentifiersDecls = `
{{Identifier}} := (&models.{{GeneratedStructName}}{Name: ` + "`" + `{{GeneratedFieldNameValue}}` + "`" + `}).Stage()`
const NumberInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
const PointerFieldInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
const SliceOfPointersFieldInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = append({{Identifier}}.{{GeneratedFieldName}}, {{GeneratedFieldNameValue}})`
const StringEnumInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
const StringInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = ` + "`" + `{{GeneratedFieldNameValue}}` + "`"
const TimeInitStatement = `` /* 129-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AfterCreateFromFront ¶
func AfterCreateFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
AfterCreateFromFront is called after a create from front
func AfterDeleteFromFront ¶
func AfterDeleteFromFront[Type Gongstruct](stage *StageStruct, staged, front *Type)
AfterDeleteFromFront is called after a delete from front
func AfterReadFromFront ¶
func AfterReadFromFront[Type Gongstruct](stage *StageStruct, instance *Type)
AfterReadFromFront is called after a Read from front
func AfterUpdateFromFront ¶
func AfterUpdateFromFront[Type Gongstruct](stage *StageStruct, old, new *Type)
AfterUpdateFromFront is called after a update from front
func CreateORMAnotherDummyData ¶
func CreateORMAnotherDummyData(anotherdummydata *AnotherDummyData)
CreateORMAnotherDummyData enables dynamic staging of a AnotherDummyData instance
func CreateORMCell ¶
func CreateORMCell(cell *Cell)
CreateORMCell enables dynamic staging of a Cell instance
func CreateORMDummyData ¶
func CreateORMDummyData(dummydata *DummyData)
CreateORMDummyData enables dynamic staging of a DummyData instance
func CreateORMElement ¶
func CreateORMElement(element *Element)
CreateORMElement enables dynamic staging of a Element instance
func CreateORMMarkdownContent ¶
func CreateORMMarkdownContent(markdowncontent *MarkdownContent)
CreateORMMarkdownContent enables dynamic staging of a MarkdownContent instance
func CreateORMRow ¶
func CreateORMRow(row *Row)
CreateORMRow enables dynamic staging of a Row instance
func DeleteORMAnotherDummyData ¶
func DeleteORMAnotherDummyData(anotherdummydata *AnotherDummyData)
DeleteORMAnotherDummyData enables dynamic staging of a AnotherDummyData instance
func DeleteORMCell ¶
func DeleteORMCell(cell *Cell)
DeleteORMCell enables dynamic staging of a Cell instance
func DeleteORMDummyData ¶
func DeleteORMDummyData(dummydata *DummyData)
DeleteORMDummyData enables dynamic staging of a DummyData instance
func DeleteORMElement ¶
func DeleteORMElement(element *Element)
DeleteORMElement enables dynamic staging of a Element instance
func DeleteORMMarkdownContent ¶
func DeleteORMMarkdownContent(markdowncontent *MarkdownContent)
DeleteORMMarkdownContent enables dynamic staging of a MarkdownContent instance
func DeleteORMRow ¶
func DeleteORMRow(row *Row)
DeleteORMRow enables dynamic staging of a Row instance
func GetAssociationName ¶
func GetAssociationName[Type Gongstruct]() *Type
GetAssociationName is a generic function that returns an instance of Type where each association is filled with an instance whose name is the name of the association
This function can be handy for generating navigation function that are refactorable
func GetFieldStringValue ¶
func GetFieldStringValue[Type Gongstruct](instance Type, fieldName string) (res string)
func GetFields ¶
func GetFields[Type Gongstruct]() (res []string)
GetFields return the array of the fields
func GetGongstructInstancesMap ¶
func GetGongstructInstancesMap[Type Gongstruct]() *map[string]*Type
GetGongstructInstancesMap returns the map of staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func GetGongstructInstancesSet ¶
func GetGongstructInstancesSet[Type Gongstruct]() *map[*Type]any
GetGongstructInstancesSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier
func GetGongstructName ¶
func GetGongstructName[Type Gongstruct]() (res string)
GetGongstructName returns the name of the Gongstruct this can be usefull if one want program robust to refactoring
func GetPointerReverseMap ¶
func GetPointerReverseMap[Start, End Gongstruct](fieldname string) map[*End][]*Start
GetPointerReverseMap allows backtrack navigation of any Start.Fieldname associations (0..1) that is a pointer from one staged Gongstruct (type Start) instances to another (type End)
The function provides a map with keys as instances of End and values to arrays of *Start the map is construed by iterating over all Start instances and populationg keys with End instances and values with slice of Start instances
func GetSliceOfPointersReverseMap ¶
func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string) map[*End]*Start
GetSliceOfPointersReverseMap allows backtrack navigation of any Start.Fieldname associations (0..N) between one staged Gongstruct instances and many others
The function provides a map with keys as instances of End and values to *Start instances the map is construed by iterating over all Start instances and populating keys with End instances and values with the Start instances
func GongGetMap ¶
func GongGetMap[Type GongstructMapString]() *Type
GongGetMap returns the map of staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func GongGetSet ¶
func GongGetSet[Type GongstructSet]() *Type
GongGetSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func IntToLetters ¶
func ParseAstFile ¶
ParseAstFile Parse pathToFile and stages all instances declared in the file
func Serialize ¶
func Serialize[Type Gongstruct](tab Tabulator)
func SerializeExcelize ¶
func SerializeExcelize[Type Gongstruct](f *excelize.File)
func SerializeStage ¶
func SerializeStage(filename string)
func SetCallbackAfterCreateFromFront ¶
func SetCallbackAfterCreateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterCreateInterface[Type])
func SetCallbackAfterDeleteFromFront ¶
func SetCallbackAfterDeleteFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterDeleteInterface[Type])
func SetCallbackAfterReadFromFront ¶
func SetCallbackAfterReadFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterReadInterface[Type])
func SetCallbackAfterUpdateFromFront ¶
func SetCallbackAfterUpdateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterUpdateInterface[Type])
SetCallbackAfterUpdateFromFront is a function to set up callback that is robust to refactoring
func UnmarshallGongstructStaging ¶
func UnmarshallGongstructStaging(assignStmt *ast.AssignStmt, astCoordinate_ string) ( instance any, identifier string, gongstructName string, fieldName string)
UnmarshallGoStaging unmarshall a go assign statement
Types ¶
type AllModelsStructCreateInterface ¶
type AllModelsStructCreateInterface interface { CreateORMAnotherDummyData(AnotherDummyData *AnotherDummyData) CreateORMCell(Cell *Cell) CreateORMDummyData(DummyData *DummyData) CreateORMElement(Element *Element) CreateORMMarkdownContent(MarkdownContent *MarkdownContent) CreateORMRow(Row *Row) }
swagger:ignore
type AllModelsStructDeleteInterface ¶
type AllModelsStructDeleteInterface interface { DeleteORMAnotherDummyData(AnotherDummyData *AnotherDummyData) DeleteORMCell(Cell *Cell) DeleteORMDummyData(DummyData *DummyData) DeleteORMElement(Element *Element) DeleteORMMarkdownContent(MarkdownContent *MarkdownContent) DeleteORMRow(Row *Row) }
type AnotherDummyData ¶
type AnotherDummyData struct {
Name string
}
func (*AnotherDummyData) Checkout ¶
func (anotherdummydata *AnotherDummyData) Checkout() *AnotherDummyData
Checkout anotherdummydata to the back repo (if it is already staged)
func (*AnotherDummyData) Commit ¶
func (anotherdummydata *AnotherDummyData) Commit() *AnotherDummyData
commit anotherdummydata to the back repo (if it is already staged)
func (*AnotherDummyData) DeleteStageAndCommit ¶
func (anotherdummydata *AnotherDummyData) DeleteStageAndCommit() *AnotherDummyData
DeleteStageAndCommit appends anotherdummydata to the model stage and commit to the orm repo
func (*AnotherDummyData) GetName ¶
func (anotherdummydata *AnotherDummyData) GetName() (res string)
for satisfaction of GongStruct interface
func (*AnotherDummyData) Stage ¶
func (anotherdummydata *AnotherDummyData) Stage() *AnotherDummyData
insertion point for cumulative sub template with model space calls Stage puts anotherdummydata to the model stage
func (*AnotherDummyData) StageAndCommit ¶
func (anotherdummydata *AnotherDummyData) StageAndCommit() *AnotherDummyData
StageAndCommit appends anotherdummydata to the model stage and commit to the orm repo
func (*AnotherDummyData) StageCopy ¶
func (anotherdummydata *AnotherDummyData) StageCopy() *AnotherDummyData
StageCopy appends a copy of anotherdummydata to the model stage
func (*AnotherDummyData) StageCopyAndCommit ¶
func (anotherdummydata *AnotherDummyData) StageCopyAndCommit() *AnotherDummyData
StageCopyAndCommit appends a copy of anotherdummydata to the model stage and commit to the orm repo
func (*AnotherDummyData) Unstage ¶
func (anotherdummydata *AnotherDummyData) Unstage() *AnotherDummyData
Unstage removes anotherdummydata off the model stage
type BackRepoInterface ¶
type BackRepoInterface interface { Commit(stage *StageStruct) Checkout(stage *StageStruct) Backup(stage *StageStruct, dirPath string) Restore(stage *StageStruct, dirPath string) BackupXL(stage *StageStruct, dirPath string) RestoreXL(stage *StageStruct, dirPath string) // insertion point for Commit and Checkout signatures CommitAnotherDummyData(anotherdummydata *AnotherDummyData) CheckoutAnotherDummyData(anotherdummydata *AnotherDummyData) CommitCell(cell *Cell) CheckoutCell(cell *Cell) CommitDummyData(dummydata *DummyData) CheckoutDummyData(dummydata *DummyData) CommitElement(element *Element) CheckoutElement(element *Element) CommitMarkdownContent(markdowncontent *MarkdownContent) CheckoutMarkdownContent(markdowncontent *MarkdownContent) CommitRow(row *Row) CheckoutRow(row *Row) GetLastCommitFromBackNb() uint GetLastPushFromFrontNb() uint }
type Cell ¶
type Cell struct {
Name string
}
func (*Cell) DeleteStageAndCommit ¶
DeleteStageAndCommit appends cell to the model stage and commit to the orm repo
func (*Cell) StageAndCommit ¶
StageAndCommit appends cell to the model stage and commit to the orm repo
func (*Cell) StageCopyAndCommit ¶
StageCopyAndCommit appends a copy of cell to the model stage and commit to the orm repo
type DummnyTypeInt ¶
type DummnyTypeInt int
const ( ONE DummnyTypeInt = 1 TWO DummnyTypeInt = 2 )
values for EnumType
func (*DummnyTypeInt) FromCodeString ¶
func (dummnytypeint *DummnyTypeInt) FromCodeString(input string) (err error)
func (*DummnyTypeInt) FromInt ¶
func (dummnytypeint *DummnyTypeInt) FromInt(input int) (err error)
func (*DummnyTypeInt) ToCodeString ¶
func (dummnytypeint *DummnyTypeInt) ToCodeString() (res string)
func (DummnyTypeInt) ToInt ¶
func (dummnytypeint DummnyTypeInt) ToInt() (res int)
insertion point of enum utility functions Utility function for DummnyTypeInt if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type DummyData ¶
type DummyData struct { Name string DummyString string DummyInt int DummyFloat float64 DummyBool bool DummyEnumString ElementType DummyEnumInt DummnyTypeInt DummyTime time.Time DummyDuration time.Duration DummyPointerToGongStruct *AnotherDummyData }
func (*DummyData) DeleteStageAndCommit ¶
DeleteStageAndCommit appends dummydata to the model stage and commit to the orm repo
func (*DummyData) StageAndCommit ¶
StageAndCommit appends dummydata to the model stage and commit to the orm repo
func (*DummyData) StageCopyAndCommit ¶
StageCopyAndCommit appends a copy of dummydata to the model stage and commit to the orm repo
type Element ¶
type Element struct { Name string Content string // kinda polymorphism Type ElementType SubElements []*Element // Rows is set up when element is a Table Rows []*Row }
func GenerateTableOfDummnies ¶
func GenerateTableOfDummnies() (element *Element)
func (*Element) AppendContent ¶
func (*Element) DeleteStageAndCommit ¶
DeleteStageAndCommit appends element to the model stage and commit to the orm repo
func (*Element) GetContent ¶
func (*Element) GetSubElements ¶
func (*Element) GetType ¶
func (element *Element) GetType() ElementType
func (*Element) SetContent ¶
func (*Element) StageAndCommit ¶
StageAndCommit appends element to the model stage and commit to the orm repo
func (*Element) StageCopyAndCommit ¶
StageCopyAndCommit appends a copy of element to the model stage and commit to the orm repo
type ElementInterface ¶
type ElementInterface interface { GetType() ElementType GetContent() string SetContent(content string) AppendContent(content string) GetSubElements() []ElementInterface }
type ElementType ¶
type ElementType string
const ( PARAGRAPH ElementType = "Paragraph" TITLE ElementType = "Title" TABLE ElementType = "Table" )
values for EnumType
func (*ElementType) FromCodeString ¶
func (elementtype *ElementType) FromCodeString(input string) (err error)
func (*ElementType) FromString ¶
func (elementtype *ElementType) FromString(input string) (err error)
func (*ElementType) ToCodeString ¶
func (elementtype *ElementType) ToCodeString() (res string)
func (ElementType) ToString ¶
func (elementtype ElementType) ToString() (res string)
Utility function for ElementType if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value
type ExcelizeTabulator ¶
type ExcelizeTabulator struct {
// contains filtered or unexported fields
}
func (*ExcelizeTabulator) AddCell ¶
func (tab *ExcelizeTabulator) AddCell(sheetName string, rowId, columnIndex int, value string)
func (*ExcelizeTabulator) AddRow ¶
func (tab *ExcelizeTabulator) AddRow(sheetName string) (rowId int)
func (*ExcelizeTabulator) AddSheet ¶
func (tab *ExcelizeTabulator) AddSheet(sheetName string)
func (*ExcelizeTabulator) SetExcelizeFile ¶
func (tab *ExcelizeTabulator) SetExcelizeFile(f *excelize.File)
type GongStructInterface ¶
type GongStructInterface interface { GetName() (res string) GetFields() (res []string) GetFieldStringValue(fieldName string) (res string) }
GongStructInterface is the interface met by GongStructs It allows runtime reflexion of instances (without the hassle of the "reflect" package)
type Gongstruct ¶
type Gongstruct interface { // insertion point for generic types AnotherDummyData | Cell | DummyData | Element | MarkdownContent | Row }
Gongstruct is the type parameter for generated generic function that allows - access to staged instances - navigation between staged instances by going backward association links between gongstruct - full refactoring of Gongstruct identifiers / fields
type GongstructMapString ¶
type GongstructSet ¶
type MarkdownContent ¶
func (*MarkdownContent) Checkout ¶
func (markdowncontent *MarkdownContent) Checkout() *MarkdownContent
Checkout markdowncontent to the back repo (if it is already staged)
func (*MarkdownContent) Commit ¶
func (markdowncontent *MarkdownContent) Commit() *MarkdownContent
commit markdowncontent to the back repo (if it is already staged)
func (*MarkdownContent) DeleteStageAndCommit ¶
func (markdowncontent *MarkdownContent) DeleteStageAndCommit() *MarkdownContent
DeleteStageAndCommit appends markdowncontent to the model stage and commit to the orm repo
func (*MarkdownContent) GetName ¶
func (markdowncontent *MarkdownContent) GetName() (res string)
for satisfaction of GongStruct interface
func (*MarkdownContent) RecursiveUpdateContent ¶
func (markdownContent *MarkdownContent) RecursiveUpdateContent(element *Element, depth int)
func (*MarkdownContent) Stage ¶
func (markdowncontent *MarkdownContent) Stage() *MarkdownContent
Stage puts markdowncontent to the model stage
func (*MarkdownContent) StageAndCommit ¶
func (markdowncontent *MarkdownContent) StageAndCommit() *MarkdownContent
StageAndCommit appends markdowncontent to the model stage and commit to the orm repo
func (*MarkdownContent) StageCopy ¶
func (markdowncontent *MarkdownContent) StageCopy() *MarkdownContent
StageCopy appends a copy of markdowncontent to the model stage
func (*MarkdownContent) StageCopyAndCommit ¶
func (markdowncontent *MarkdownContent) StageCopyAndCommit() *MarkdownContent
StageCopyAndCommit appends a copy of markdowncontent to the model stage and commit to the orm repo
func (*MarkdownContent) Unstage ¶
func (markdowncontent *MarkdownContent) Unstage() *MarkdownContent
Unstage removes markdowncontent off the model stage
func (*MarkdownContent) UpdateContent ¶
func (markdownContent *MarkdownContent) UpdateContent()
UpdateContent updates Content from the root
type OnAfterCreateInterface ¶
type OnAfterCreateInterface[Type Gongstruct] interface { OnAfterCreate(stage *StageStruct, instance *Type) }
OnAfterCreateInterface callback when an instance is updated from the front
type OnAfterDeleteInterface ¶
type OnAfterDeleteInterface[Type Gongstruct] interface { OnAfterDelete(stage *StageStruct, staged, front *Type) }
OnAfterDeleteInterface callback when an instance is updated from the front
type OnAfterReadInterface ¶
type OnAfterReadInterface[Type Gongstruct] interface { OnAfterRead(stage *StageStruct, instance *Type) }
OnAfterReadInterface callback when an instance is updated from the front
type OnAfterUpdateInterface ¶
type OnAfterUpdateInterface[Type Gongstruct] interface { OnAfterUpdate(stage *StageStruct, old, new *Type) }
OnAfterUpdateInterface callback when an instance is updated from the front
type OnInitCommitInterface ¶
type OnInitCommitInterface interface {
BeforeCommit(stage *StageStruct)
}
type PointerToGongstruct ¶
type PointerToGongstruct interface { *AnotherDummyData | *Cell | *DummyData | *Element | *MarkdownContent | *Row GetName() string }
Gongstruct is the type parameter for generated generic function that allows - access to staged instances - navigation between staged instances by going backward association links between gongstruct - full refactoring of Gongstruct identifiers / fields
type Row ¶
func (*Row) DeleteStageAndCommit ¶
DeleteStageAndCommit appends row to the model stage and commit to the orm repo
func (*Row) StageAndCommit ¶
StageAndCommit appends row to the model stage and commit to the orm repo
func (*Row) StageCopyAndCommit ¶
StageCopyAndCommit appends a copy of row to the model stage and commit to the orm repo
type StageStruct ¶
type StageStruct struct { AnotherDummyDatas map[*AnotherDummyData]any AnotherDummyDatas_mapString map[string]*AnotherDummyData OnAfterAnotherDummyDataCreateCallback OnAfterCreateInterface[AnotherDummyData] OnAfterAnotherDummyDataUpdateCallback OnAfterUpdateInterface[AnotherDummyData] OnAfterAnotherDummyDataDeleteCallback OnAfterDeleteInterface[AnotherDummyData] OnAfterAnotherDummyDataReadCallback OnAfterReadInterface[AnotherDummyData] Cells map[*Cell]any Cells_mapString map[string]*Cell OnAfterCellCreateCallback OnAfterCreateInterface[Cell] OnAfterCellUpdateCallback OnAfterUpdateInterface[Cell] OnAfterCellDeleteCallback OnAfterDeleteInterface[Cell] OnAfterCellReadCallback OnAfterReadInterface[Cell] DummyDatas map[*DummyData]any DummyDatas_mapString map[string]*DummyData OnAfterDummyDataCreateCallback OnAfterCreateInterface[DummyData] OnAfterDummyDataUpdateCallback OnAfterUpdateInterface[DummyData] OnAfterDummyDataDeleteCallback OnAfterDeleteInterface[DummyData] OnAfterDummyDataReadCallback OnAfterReadInterface[DummyData] Elements map[*Element]any Elements_mapString map[string]*Element OnAfterElementCreateCallback OnAfterCreateInterface[Element] OnAfterElementUpdateCallback OnAfterUpdateInterface[Element] OnAfterElementDeleteCallback OnAfterDeleteInterface[Element] OnAfterElementReadCallback OnAfterReadInterface[Element] MarkdownContents map[*MarkdownContent]any MarkdownContents_mapString map[string]*MarkdownContent OnAfterMarkdownContentCreateCallback OnAfterCreateInterface[MarkdownContent] OnAfterMarkdownContentUpdateCallback OnAfterUpdateInterface[MarkdownContent] OnAfterMarkdownContentDeleteCallback OnAfterDeleteInterface[MarkdownContent] OnAfterMarkdownContentReadCallback OnAfterReadInterface[MarkdownContent] Rows map[*Row]any Rows_mapString map[string]*Row OnAfterRowCreateCallback OnAfterCreateInterface[Row] OnAfterRowUpdateCallback OnAfterUpdateInterface[Row] OnAfterRowDeleteCallback OnAfterDeleteInterface[Row] OnAfterRowReadCallback OnAfterReadInterface[Row] AllModelsStructCreateCallback AllModelsStructCreateInterface AllModelsStructDeleteCallback AllModelsStructDeleteInterface BackRepo BackRepoInterface // if set will be called before each commit to the back repo OnInitCommitCallback OnInitCommitInterface OnInitCommitFromFrontCallback OnInitCommitInterface OnInitCommitFromBackCallback OnInitCommitInterface // store the number of instance per gongstruct Map_GongStructName_InstancesNb map[string]int }
StageStruct enables storage of staged instances swagger:ignore
var Stage StageStruct = StageStruct{ AnotherDummyDatas: make(map[*AnotherDummyData]any), AnotherDummyDatas_mapString: make(map[string]*AnotherDummyData), Cells: make(map[*Cell]any), Cells_mapString: make(map[string]*Cell), DummyDatas: make(map[*DummyData]any), DummyDatas_mapString: make(map[string]*DummyData), Elements: make(map[*Element]any), Elements_mapString: make(map[string]*Element), MarkdownContents: make(map[*MarkdownContent]any), MarkdownContents_mapString: make(map[string]*MarkdownContent), Rows: make(map[*Row]any), Rows_mapString: make(map[string]*Row), Map_GongStructName_InstancesNb: make(map[string]int), }
swagger:ignore instructs the gong compiler (gongc) to avoid this particular struct
func (*StageStruct) Backup ¶
func (stage *StageStruct) Backup(dirPath string)
backup generates backup files in the dirPath
func (*StageStruct) BackupXL ¶
func (stage *StageStruct) BackupXL(dirPath string)
backup generates backup files in the dirPath
func (*StageStruct) Checkout ¶
func (stage *StageStruct) Checkout()
func (*StageStruct) Commit ¶
func (stage *StageStruct) Commit()
func (*StageStruct) CreateReverseMap_DummyData_DummyPointerToGongStruct ¶
func (stageStruct *StageStruct) CreateReverseMap_DummyData_DummyPointerToGongStruct() (res map[*AnotherDummyData][]*DummyData)
generate function for reverse association maps of DummyData
func (*StageStruct) CreateReverseMap_Element_Rows ¶
func (stageStruct *StageStruct) CreateReverseMap_Element_Rows() (res map[*Row]*Element)
func (*StageStruct) CreateReverseMap_Element_SubElements ¶
func (stageStruct *StageStruct) CreateReverseMap_Element_SubElements() (res map[*Element]*Element)
generate function for reverse association maps of Element
func (*StageStruct) CreateReverseMap_MarkdownContent_Root ¶
func (stageStruct *StageStruct) CreateReverseMap_MarkdownContent_Root() (res map[*Element][]*MarkdownContent)
generate function for reverse association maps of MarkdownContent
func (*StageStruct) CreateReverseMap_Row_Cells ¶
func (stageStruct *StageStruct) CreateReverseMap_Row_Cells() (res map[*Cell]*Row)
generate function for reverse association maps of Row
func (*StageStruct) Marshall ¶
func (stage *StageStruct) Marshall(file *os.File, modelsPackageName, packageName string)
Marshall marshall the stage content into the file as an instanciation into a stage
func (*StageStruct) Nil ¶
func (stage *StageStruct) Nil()
func (*StageStruct) Reset ¶
func (stage *StageStruct) Reset()
func (*StageStruct) Restore ¶
func (stage *StageStruct) Restore(dirPath string)
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath
func (*StageStruct) RestoreXL ¶
func (stage *StageStruct) RestoreXL(dirPath string)
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath