Documentation ¶
Overview ¶
Default generated models package docs (at least one file is necessary in a models package)
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
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
- Variables
- 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 CodeGenerator(mdlPkg *ModelPkg, pkgName string, pkgGoPath string, generatedFilePath string, ...)
- func CompareGongstructByName[T PointerToGongstruct](a, b T) int
- func ComputePkgNameFromPkgPath(pkgPathArg string) (pkgName string)
- func ComputePkgPathFromGoModFile(pkgPathArg string) (pkgName, fullPkgPath string)
- func CopyBranch[Type Gongstruct](from *Type) (to *Type)
- func EvictInOtherSlices[OwningType PointerToGongstruct, FieldType PointerToGongstruct](stage *StageStruct, owningInstance OwningType, sliceField []FieldType, ...)
- func File2lines(filePath string) ([]string, error)
- func GenerateFieldParser(fieldList *[]*ast.Field, owningGongstruct *GongStruct, ...)
- func GetAssociationName[Type Gongstruct]() *Type
- func GetFieldStringValue[Type Gongstruct](instance Type, fieldName string) (res string)
- func GetFieldStringValueFromPointer[Type PointerToGongstruct](instance Type, fieldName string) (res string)
- func GetFields[Type Gongstruct]() (res []string)
- func GetFieldsFromPointer[Type PointerToGongstruct]() (res []string)
- func GetGongstrucsSorted[T PointerToGongstruct](stage *StageStruct) (sortedSlice []T)
- func GetGongstructInstancesMap[Type Gongstruct](stage *StageStruct) *map[string]*Type
- func GetGongstructInstancesSet[Type Gongstruct](stage *StageStruct) *map[*Type]any
- func GetGongstructInstancesSetFromPointerType[Type PointerToGongstruct](stage *StageStruct) *map[Type]any
- func GetGongstructName[Type Gongstruct]() (res string)
- func GetPointerReverseMap[Start, End Gongstruct](fieldname string, stage *StageStruct) map[*End][]*Start
- func GetPointerToGongstructName[Type PointerToGongstruct]() (res string)
- func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string, stage *StageStruct) map[*End]*Start
- func GongGetMap[Type GongstructMapString](stage *StageStruct) *Type
- func GongGetSet[Type GongstructSet](stage *StageStruct) *Type
- func InsertStringToFile(path, str string, preceedingLineContent string) error
- func IntToLetters(number int32) (letters string)
- func IsNamedStructWithoutEmbedded(_type *ast.StructType, mapStructWithNameField map[string]any) bool
- func IsStaged[Type Gongstruct](stage *StageStruct, instance *Type) (ok bool)
- func LinesFromReader(r io.Reader) ([]string, error)
- func MultiCodeGenerator(mdlPkg *ModelPkg, pkgName string, pkgGoPath string, path string, ...)
- func ParseAstFile(stage *StageStruct, pathToFile string) error
- func ParseAstFileFromAst(stage *StageStruct, inFile *ast.File, fset *token.FileSet) error
- func ParseEmbedModel(embeddedDir embed.FS, source string) map[string]*ast.Package
- func RemoveContents(dir string) error
- func Replace1(template, match1, replace1 string) string
- func Replace10(...) string
- func Replace2(template, match1, replace1, match2, replace2 string) string
- func Replace3(template, match1, replace1, match2, replace2, match3, replace3 string) string
- func Replace4(...) string
- func Replace5(...) string
- func Replace6(...) string
- func Replace7(...) string
- func Replace8(...) string
- func Replace9(...) string
- func ReplaceOldDeclarationsInFile(pathToFile string) error
- func Serialize[Type Gongstruct](stage *StageStruct, tab Tabulator)
- func SerializeExcelize[Type Gongstruct](stage *StageStruct, f *excelize.File)
- func SerializeStage(stage *StageStruct, 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 SetOrchestratorOnAfterUpdate[Type Gongstruct](stage *StageStruct)
- func SimpleCodeGenerator(mdlPkg *ModelPkg, pkgName string, pkgGoPath string, generatedFilePath string, ...)
- func SimpleCodeGeneratorForGongStructWithNameField(mdlPkg *ModelPkg, pkgName string, pkgGoPath string, generatedFilePath string, ...)
- func SortGongstructSetByName[T PointerToGongstruct](set map[T]any) (sortedSlice []T)
- func StageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
- func UnmarshallGongstructStaging(stage *StageStruct, cmap *ast.CommentMap, assignStmt *ast.AssignStmt, ...) (instance any, identifier string, gongstructName string, fieldName string)
- func UnstageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
- func VerySimpleCodeGenerator(modelPkg *ModelPkg, generatedFilePath string, templateCode string)
- func VerySimpleCodeGeneratorForGongStructWithNameField(mdlPkg *ModelPkg, pkgName string, pkgGoPath string, generatedFilePath string, ...)
- func Walk(relativePathToModel string, modelPkg *ModelPkg)
- func WalkParser(parserPkgs map[string]*ast.Package, modelPkg *ModelPkg, ...)
- type AllModelsStructCreateInterface
- type AllModelsStructDeleteInterface
- type BackRepoInterface
- type ExcelizeTabulator
- type FieldInterface
- type FileInterface
- type GONG__ExpressionType
- type GONG__Identifier
- type GongBasicField
- func (gongbasicfield *GongBasicField) Checkout(stage *StageStruct) *GongBasicField
- func (gongbasicfield *GongBasicField) Commit(stage *StageStruct) *GongBasicField
- func (gongbasicfield *GongBasicField) CommitVoid(stage *StageStruct)
- func (from *GongBasicField) CopyBasicFields(to *GongBasicField)
- func (gongBasicField *GongBasicField) GetBasicKind() types.BasicKind
- func (gongBasicField *GongBasicField) GetCompositeStructName() string
- func (gongBasicField *GongBasicField) GetIndex() int
- func (gongbasicfield *GongBasicField) GetName() (res string)
- func (gongbasicfield *GongBasicField) Stage(stage *StageStruct) *GongBasicField
- func (gongbasicfield *GongBasicField) Unstage(stage *StageStruct) *GongBasicField
- func (gongbasicfield *GongBasicField) UnstageVoid(stage *StageStruct)
- type GongBasicField_WOP
- type GongEnum
- func (gongenum *GongEnum) Checkout(stage *StageStruct) *GongEnum
- func (gongenum *GongEnum) Commit(stage *StageStruct) *GongEnum
- func (gongenum *GongEnum) CommitVoid(stage *StageStruct)
- func (from *GongEnum) CopyBasicFields(to *GongEnum)
- func (gongenum *GongEnum) GetName() (res string)
- func (gongenum *GongEnum) Stage(stage *StageStruct) *GongEnum
- func (gongenum *GongEnum) Unstage(stage *StageStruct) *GongEnum
- func (gongenum *GongEnum) UnstageVoid(stage *StageStruct)
- type GongEnumType
- func (gongenumtype GongEnumType) CodeValues() (res []int)
- func (gongenumtype GongEnumType) Codes() (res []string)
- func (gongenumtype *GongEnumType) FromCodeString(input string) (err error)
- func (gongenumtype *GongEnumType) FromInt(input int) (err error)
- func (gongenumtype *GongEnumType) ToCodeString() (res string)
- func (gongenumtype GongEnumType) ToInt() (res int)
- type GongEnumValue
- func (gongenumvalue *GongEnumValue) Checkout(stage *StageStruct) *GongEnumValue
- func (gongenumvalue *GongEnumValue) Commit(stage *StageStruct) *GongEnumValue
- func (gongenumvalue *GongEnumValue) CommitVoid(stage *StageStruct)
- func (from *GongEnumValue) CopyBasicFields(to *GongEnumValue)
- func (gongenumvalue *GongEnumValue) GetName() (res string)
- func (gongenumvalue *GongEnumValue) Stage(stage *StageStruct) *GongEnumValue
- func (gongenumvalue *GongEnumValue) Unstage(stage *StageStruct) *GongEnumValue
- func (gongenumvalue *GongEnumValue) UnstageVoid(stage *StageStruct)
- type GongEnumValue_WOP
- type GongEnum_WOP
- type GongLink
- func (gonglink *GongLink) Checkout(stage *StageStruct) *GongLink
- func (gonglink *GongLink) Commit(stage *StageStruct) *GongLink
- func (gonglink *GongLink) CommitVoid(stage *StageStruct)
- func (from *GongLink) CopyBasicFields(to *GongLink)
- func (gonglink *GongLink) GetName() (res string)
- func (gonglink *GongLink) Stage(stage *StageStruct) *GongLink
- func (gonglink *GongLink) Unstage(stage *StageStruct) *GongLink
- func (gonglink *GongLink) UnstageVoid(stage *StageStruct)
- type GongLink_WOP
- type GongNote
- func (gongnote *GongNote) Checkout(stage *StageStruct) *GongNote
- func (gongnote *GongNote) Commit(stage *StageStruct) *GongNote
- func (gongnote *GongNote) CommitVoid(stage *StageStruct)
- func (from *GongNote) CopyBasicFields(to *GongNote)
- func (gongnote *GongNote) GetName() (res string)
- func (gongnote *GongNote) Stage(stage *StageStruct) *GongNote
- func (gongnote *GongNote) Unstage(stage *StageStruct) *GongNote
- func (gongnote *GongNote) UnstageVoid(stage *StageStruct)
- type GongNote_WOP
- type GongStruct
- func (gongstruct *GongStruct) Checkout(stage *StageStruct) *GongStruct
- func (gongstruct *GongStruct) Commit(stage *StageStruct) *GongStruct
- func (gongstruct *GongStruct) CommitVoid(stage *StageStruct)
- func (gongStruct *GongStruct) ComputeFielProloguesEpilogues(field FieldInterface) (...)
- func (from *GongStruct) CopyBasicFields(to *GongStruct)
- func (gongstruct *GongStruct) GetName() (res string)
- func (gongStruct *GongStruct) HasNameField() (hasNameField bool)
- func (gongstruct *GongStruct) Stage(stage *StageStruct) *GongStruct
- func (gongstruct *GongStruct) Unstage(stage *StageStruct) *GongStruct
- func (gongstruct *GongStruct) UnstageVoid(stage *StageStruct)
- type GongStructInterface
- type GongStruct_WOP
- type GongTimeField
- func (gongtimefield *GongTimeField) Checkout(stage *StageStruct) *GongTimeField
- func (gongtimefield *GongTimeField) Commit(stage *StageStruct) *GongTimeField
- func (gongtimefield *GongTimeField) CommitVoid(stage *StageStruct)
- func (from *GongTimeField) CopyBasicFields(to *GongTimeField)
- func (gongTimeField *GongTimeField) GetCompositeStructName() string
- func (gongTimeField *GongTimeField) GetIndex() int
- func (gongtimefield *GongTimeField) GetName() (res string)
- func (gongtimefield *GongTimeField) Stage(stage *StageStruct) *GongTimeField
- func (gongtimefield *GongTimeField) Unstage(stage *StageStruct) *GongTimeField
- func (gongtimefield *GongTimeField) UnstageVoid(stage *StageStruct)
- type GongTimeField_WOP
- type Gongstruct
- type GongstructEnumIntField
- type GongstructEnumStringField
- type GongstructMapString
- type GongstructSet
- type GongtructBasicField
- type Meta
- func (meta *Meta) Checkout(stage *StageStruct) *Meta
- func (meta *Meta) Commit(stage *StageStruct) *Meta
- func (meta *Meta) CommitVoid(stage *StageStruct)
- func (from *Meta) CopyBasicFields(to *Meta)
- func (meta *Meta) GetName() (res string)
- func (meta *Meta) Stage(stage *StageStruct) *Meta
- func (meta *Meta) Unstage(stage *StageStruct) *Meta
- func (meta *Meta) UnstageVoid(stage *StageStruct)
- type MetaReference
- func (metareference *MetaReference) Checkout(stage *StageStruct) *MetaReference
- func (metareference *MetaReference) Commit(stage *StageStruct) *MetaReference
- func (metareference *MetaReference) CommitVoid(stage *StageStruct)
- func (from *MetaReference) CopyBasicFields(to *MetaReference)
- func (metareference *MetaReference) GetName() (res string)
- func (metareference *MetaReference) Stage(stage *StageStruct) *MetaReference
- func (metareference *MetaReference) Unstage(stage *StageStruct) *MetaReference
- func (metareference *MetaReference) UnstageVoid(stage *StageStruct)
- type MetaReference_WOP
- type Meta_WOP
- type ModelPkg
- func CopyBranchModelPkg(mapOrigCopy map[any]any, modelpkgFrom *ModelPkg) (modelpkgTo *ModelPkg)
- func LoadEmbedded(stage *StageStruct, goModelsDir embed.FS) (modelPkg *ModelPkg, err error)
- func LoadSource(stage *StageStruct, pkgPath string) (modelPkg *ModelPkg, err error)
- func NewModelPkg(stage *StageStruct) (modelPkg *ModelPkg)
- func (modelpkg *ModelPkg) Checkout(stage *StageStruct) *ModelPkg
- func (modelpkg *ModelPkg) Commit(stage *StageStruct) *ModelPkg
- func (modelpkg *ModelPkg) CommitVoid(stage *StageStruct)
- func (from *ModelPkg) CopyBasicFields(to *ModelPkg)
- func (modelPkg *ModelPkg) GenerateDocs(docPackage *doc.Package)
- func (modelpkg *ModelPkg) GetName() (res string)
- func (modelPkg *ModelPkg) GetStage() (stage *StageStruct)
- func (modelPkg *ModelPkg) SerializeToStage()
- func (modelPkg *ModelPkg) SetStage(stage *StageStruct)
- func (modelpkg *ModelPkg) Stage(stage *StageStruct) *ModelPkg
- func (modelpkg *ModelPkg) Unstage(stage *StageStruct) *ModelPkg
- func (modelpkg *ModelPkg) UnstageVoid(stage *StageStruct)
- type ModelPkg_WOP
- type OnAfterCreateInterface
- type OnAfterDeleteInterface
- type OnAfterReadInterface
- type OnAfterUpdateInterface
- type OnInitCommitInterface
- type PointerToGongStructField
- func (pointertogongstructfield *PointerToGongStructField) Checkout(stage *StageStruct) *PointerToGongStructField
- func (pointertogongstructfield *PointerToGongStructField) Commit(stage *StageStruct) *PointerToGongStructField
- func (pointertogongstructfield *PointerToGongStructField) CommitVoid(stage *StageStruct)
- func (from *PointerToGongStructField) CopyBasicFields(to *PointerToGongStructField)
- func (pointerToGongStructField *PointerToGongStructField) GetCompositeStructName() string
- func (pointerToGongStructField *PointerToGongStructField) GetIndex() int
- func (pointertogongstructfield *PointerToGongStructField) GetName() (res string)
- func (pointertogongstructfield *PointerToGongStructField) Stage(stage *StageStruct) *PointerToGongStructField
- func (pointertogongstructfield *PointerToGongStructField) Unstage(stage *StageStruct) *PointerToGongStructField
- func (pointertogongstructfield *PointerToGongStructField) UnstageVoid(stage *StageStruct)
- type PointerToGongStructField_WOP
- type PointerToGongstruct
- type PointerToGongstructEnumIntField
- type PointerToGongstructEnumStringField
- type ReverseField
- type SliceOfPointerToGongStructField
- func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Checkout(stage *StageStruct) *SliceOfPointerToGongStructField
- func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Commit(stage *StageStruct) *SliceOfPointerToGongStructField
- func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) CommitVoid(stage *StageStruct)
- func (from *SliceOfPointerToGongStructField) CopyBasicFields(to *SliceOfPointerToGongStructField)
- func (sliceOfPointerToGongStructField *SliceOfPointerToGongStructField) GetCompositeStructName() string
- func (sliceOfPointerToGongStructField *SliceOfPointerToGongStructField) GetIndex() int
- func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) GetName() (res string)
- func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Stage(stage *StageStruct) *SliceOfPointerToGongStructField
- func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Unstage(stage *StageStruct) *SliceOfPointerToGongStructField
- func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) UnstageVoid(stage *StageStruct)
- type SliceOfPointerToGongStructField_WOP
- type StageStruct
- func (stage *StageStruct) Backup(dirPath string)
- func (stage *StageStruct) BackupXL(dirPath string)
- func (stage *StageStruct) Checkout()
- func (stage *StageStruct) Commit()
- func (stage *StageStruct) CommitWithSuspendedCallbacks()
- func (stage *StageStruct) ComputeReverseMaps()
- func (stage *StageStruct) GetPath() string
- func (stage *StageStruct) GetType() string
- func (stage *StageStruct) IsStagedGongBasicField(gongbasicfield *GongBasicField) (ok bool)
- func (stage *StageStruct) IsStagedGongEnum(gongenum *GongEnum) (ok bool)
- func (stage *StageStruct) IsStagedGongEnumValue(gongenumvalue *GongEnumValue) (ok bool)
- func (stage *StageStruct) IsStagedGongLink(gonglink *GongLink) (ok bool)
- func (stage *StageStruct) IsStagedGongNote(gongnote *GongNote) (ok bool)
- func (stage *StageStruct) IsStagedGongStruct(gongstruct *GongStruct) (ok bool)
- func (stage *StageStruct) IsStagedGongTimeField(gongtimefield *GongTimeField) (ok bool)
- func (stage *StageStruct) IsStagedMeta(meta *Meta) (ok bool)
- func (stage *StageStruct) IsStagedMetaReference(metareference *MetaReference) (ok bool)
- func (stage *StageStruct) IsStagedModelPkg(modelpkg *ModelPkg) (ok bool)
- func (stage *StageStruct) IsStagedPointerToGongStructField(pointertogongstructfield *PointerToGongStructField) (ok bool)
- func (stage *StageStruct) IsStagedSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField) (ok bool)
- 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)
- func (stage *StageStruct) StageBranchGongBasicField(gongbasicfield *GongBasicField)
- func (stage *StageStruct) StageBranchGongEnum(gongenum *GongEnum)
- func (stage *StageStruct) StageBranchGongEnumValue(gongenumvalue *GongEnumValue)
- func (stage *StageStruct) StageBranchGongLink(gonglink *GongLink)
- func (stage *StageStruct) StageBranchGongNote(gongnote *GongNote)
- func (stage *StageStruct) StageBranchGongStruct(gongstruct *GongStruct)
- func (stage *StageStruct) StageBranchGongTimeField(gongtimefield *GongTimeField)
- func (stage *StageStruct) StageBranchMeta(meta *Meta)
- func (stage *StageStruct) StageBranchMetaReference(metareference *MetaReference)
- func (stage *StageStruct) StageBranchModelPkg(modelpkg *ModelPkg)
- func (stage *StageStruct) StageBranchPointerToGongStructField(pointertogongstructfield *PointerToGongStructField)
- func (stage *StageStruct) StageBranchSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField)
- func (stage *StageStruct) Unstage()
- func (stage *StageStruct) UnstageBranchGongBasicField(gongbasicfield *GongBasicField)
- func (stage *StageStruct) UnstageBranchGongEnum(gongenum *GongEnum)
- func (stage *StageStruct) UnstageBranchGongEnumValue(gongenumvalue *GongEnumValue)
- func (stage *StageStruct) UnstageBranchGongLink(gonglink *GongLink)
- func (stage *StageStruct) UnstageBranchGongNote(gongnote *GongNote)
- func (stage *StageStruct) UnstageBranchGongStruct(gongstruct *GongStruct)
- func (stage *StageStruct) UnstageBranchGongTimeField(gongtimefield *GongTimeField)
- func (stage *StageStruct) UnstageBranchMeta(meta *Meta)
- func (stage *StageStruct) UnstageBranchMetaReference(metareference *MetaReference)
- func (stage *StageStruct) UnstageBranchModelPkg(modelpkg *ModelPkg)
- func (stage *StageStruct) UnstageBranchPointerToGongStructField(pointertogongstructfield *PointerToGongStructField)
- func (stage *StageStruct) UnstageBranchSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField)
- type Tabulator
Constants ¶
const IdentifiersDecls = `
{{Identifier}} := (&models.{{GeneratedStructName}}{}).Stage(stage)`
const N = 1000
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 ¶
var GeneratedModelFiles = []string{
"gong.go",
"../..embed.go",
"../embed.go",
"gong_coder.go",
"gong_ast.go",
"gong_serialize.go",
"gong_slices.go",
"gong_marshall.go",
"gong_graph.go",
"gong_enum.go",
"gong_callbacks.go",
"gong_orchestrator.go",
"gong_wop.go",
}
var Primes []int
list of prime numbers
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 CodeGenerator ¶
func CodeGenerator( mdlPkg *ModelPkg, pkgName string, pkgGoPath string, generatedFilePath string, templateCode string, subTemplateCode map[string]string, subSubTemplateCode map[string]string, subSubToSubMap map[string]string, forGongStructWithNameFieldOnly bool, forGongStructWithHasOnUpdateSignatureOnly bool)
SimpleCodeGenerator generates from elements of mdlPkg the file generatedFilePath with templateCode and with subTemplateCode (code that accumulates per struct) with subSubTemplateCode (code that accumulates per field of each struct)
func CompareGongstructByName ¶
func CompareGongstructByName[T PointerToGongstruct](a, b T) int
func ComputePkgNameFromPkgPath ¶
ComputePkgNameFromPkgPath computes the name of the package from the current working directory
func CopyBranch ¶
func CopyBranch[Type Gongstruct](from *Type) (to *Type)
CopyBranch stages instance and apply CopyBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the instance
the algorithm stops along the course of graph if a vertex is already staged
func EvictInOtherSlices ¶
func EvictInOtherSlices[OwningType PointerToGongstruct, FieldType PointerToGongstruct]( stage *StageStruct, owningInstance OwningType, sliceField []FieldType, fieldName string)
EvictInOtherSlices allows for adherance between the gong association model and go.
Says you have a Astruct struct with a slice field "anarrayofb []*Bstruct"
go allows many Astruct instance to have the anarrayofb field that have the same pointers. go slices are MANY-MANY association.
With gong it is only ZERO-ONE-MANY associations, a Bstruct can be pointed only once by an Astruct instance through a given field. This follows the requirement that gong is suited for full stack programming and therefore the association is encoded as a reverse pointer (not as a joint table). In gong, a named struct is translated in a table and each table is a named struct.
EvictInOtherSlices removes the fields instances from other fields of other instance
Note : algo is in O(N)log(N) of nb of Astruct and Bstruct instances
func File2lines ¶
func GenerateFieldParser ¶
func GenerateFieldParser( fieldList *[]*ast.Field, owningGongstruct *GongStruct, map_Structname_fieldList *map[string]*[]*ast.Field, modelPkg *ModelPkg, compositeTypeStructName string, prefix string, )
GenerateFieldParser generates Gongfields of owningGongstruct
by using the map_Structname_fieldList for embedded struct fields and modelPkg for access existing gongstructs and gongenums
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 GetFieldStringValueFromPointer ¶
func GetFieldStringValueFromPointer[Type PointerToGongstruct](instance Type, fieldName string) (res string)
func GetFields ¶
func GetFields[Type Gongstruct]() (res []string)
GetFields return the array of the fields
func GetFieldsFromPointer ¶
func GetFieldsFromPointer[Type PointerToGongstruct]() (res []string)
GetFieldsFromPointer return the array of the fields
func GetGongstrucsSorted ¶
func GetGongstrucsSorted[T PointerToGongstruct](stage *StageStruct) (sortedSlice []T)
func GetGongstructInstancesMap ¶
func GetGongstructInstancesMap[Type Gongstruct](stage *StageStruct) *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](stage *StageStruct) *map[*Type]any
GetGongstructInstancesSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier
func GetGongstructInstancesSetFromPointerType ¶
func GetGongstructInstancesSetFromPointerType[Type PointerToGongstruct](stage *StageStruct) *map[Type]any
GetGongstructInstancesSetFromPointerType 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, stage *StageStruct) 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 GetPointerToGongstructName ¶
func GetPointerToGongstructName[Type PointerToGongstruct]() (res string)
GetPointerToGongstructName returns the name of the Gongstruct this can be usefull if one want program robust to refactoring
func GetSliceOfPointersReverseMap ¶
func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string, stage *StageStruct) 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](stage *StageStruct) *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](stage *StageStruct) *Type
GongGetSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func InsertStringToFile ¶
*
- Insert sting to n-th line of file.
- If you want to insert a line, append newline '\n' to the end of the string.
func IntToLetters ¶
func IsNamedStructWithoutEmbedded ¶
func IsNamedStructWithoutEmbedded(_type *ast.StructType, mapStructWithNameField map[string]any) bool
IsNamedStructWithoutEmbedded checks if any field (including embedded fields) has a field named "Name" of type string.
func IsStaged ¶
func IsStaged[Type Gongstruct](stage *StageStruct, instance *Type) (ok bool)
func MultiCodeGenerator ¶
func ParseAstFile ¶
func ParseAstFile(stage *StageStruct, pathToFile string) error
ParseAstFile Parse pathToFile and stages all instances declared in the file
func ParseAstFileFromAst ¶
ParseAstFile Parse pathToFile and stages all instances declared in the file
func ParseEmbedModel ¶
func RemoveContents ¶
func ReplaceOldDeclarationsInFile ¶
ReplaceOldDeclarationsInFile replaces specific text in a file at the given path.
func Serialize ¶
func Serialize[Type Gongstruct](stage *StageStruct, tab Tabulator)
func SerializeExcelize ¶
func SerializeExcelize[Type Gongstruct](stage *StageStruct, f *excelize.File)
func SerializeStage ¶
func SerializeStage(stage *StageStruct, 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 SetOrchestratorOnAfterUpdate ¶
func SetOrchestratorOnAfterUpdate[Type Gongstruct](stage *StageStruct)
func SimpleCodeGenerator ¶
func SimpleCodeGenerator( mdlPkg *ModelPkg, pkgName string, pkgGoPath string, generatedFilePath string, templateCode string, subTemplateCode map[string]string)
SimpleCodeGenerator generates from elements of mdlPkg the file generatedFilePath with templateCode and with subTemplateCode (code that accumulates per struct)
func SimpleCodeGeneratorForGongStructWithNameField ¶
func SimpleCodeGeneratorForGongStructWithNameField( mdlPkg *ModelPkg, pkgName string, pkgGoPath string, generatedFilePath string, templateCode string, subTemplateCode map[string]string)
SimpleCodeGenerator generates from elements of mdlPkg the file generatedFilePath with templateCode and with subTemplateCode (code that accumulates per struct)
func SortGongstructSetByName ¶
func SortGongstructSetByName[T PointerToGongstruct](set map[T]any) (sortedSlice []T)
func StageBranch ¶
func StageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
StageBranch stages instance and apply StageBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the instance
the algorithm stops along the course of graph if a vertex is already staged
func UnmarshallGongstructStaging ¶
func UnmarshallGongstructStaging(stage *StageStruct, cmap *ast.CommentMap, assignStmt *ast.AssignStmt, astCoordinate_ string) ( instance any, identifier string, gongstructName string, fieldName string)
UnmarshallGoStaging unmarshall a go assign statement
func UnstageBranch ¶
func UnstageBranch[Type Gongstruct](stage *StageStruct, instance *Type)
UnstageBranch stages instance and apply UnstageBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the insance
the algorithm stops along the course of graph if a vertex is already staged
func VerySimpleCodeGenerator ¶
VerySimpleCodeGenerator generates from elements of mdlPkg the file generatedFilePath with templateCode
func Walk ¶
Walk parses go files in the `models` directory pointed by relativePathToModel and fills up modelPkg with its Gongstruct & Gongenum
if useParse is used, Walk uses go/parser.Parser
Walk leverages go Parser capabilities to fetch identifiers in go files ¶
The algo is in several steps: - First pass gather Gongstruct & Gongenums identifiers - Second pass parses fields and link them to other Gongstructs
func WalkParser ¶
Types ¶
type AllModelsStructCreateInterface ¶
type AllModelsStructCreateInterface interface { CreateORMGongBasicField(GongBasicField *GongBasicField) CreateORMGongEnum(GongEnum *GongEnum) CreateORMGongEnumValue(GongEnumValue *GongEnumValue) CreateORMGongLink(GongLink *GongLink) CreateORMGongNote(GongNote *GongNote) CreateORMGongStruct(GongStruct *GongStruct) CreateORMGongTimeField(GongTimeField *GongTimeField) CreateORMMeta(Meta *Meta) CreateORMMetaReference(MetaReference *MetaReference) CreateORMModelPkg(ModelPkg *ModelPkg) CreateORMPointerToGongStructField(PointerToGongStructField *PointerToGongStructField) CreateORMSliceOfPointerToGongStructField(SliceOfPointerToGongStructField *SliceOfPointerToGongStructField) }
swagger:ignore
type AllModelsStructDeleteInterface ¶
type AllModelsStructDeleteInterface interface { DeleteORMGongBasicField(GongBasicField *GongBasicField) DeleteORMGongEnum(GongEnum *GongEnum) DeleteORMGongEnumValue(GongEnumValue *GongEnumValue) DeleteORMGongLink(GongLink *GongLink) DeleteORMGongNote(GongNote *GongNote) DeleteORMGongStruct(GongStruct *GongStruct) DeleteORMGongTimeField(GongTimeField *GongTimeField) DeleteORMMeta(Meta *Meta) DeleteORMMetaReference(MetaReference *MetaReference) DeleteORMModelPkg(ModelPkg *ModelPkg) DeleteORMPointerToGongStructField(PointerToGongStructField *PointerToGongStructField) DeleteORMSliceOfPointerToGongStructField(SliceOfPointerToGongStructField *SliceOfPointerToGongStructField) }
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 CommitGongBasicField(gongbasicfield *GongBasicField) CheckoutGongBasicField(gongbasicfield *GongBasicField) CommitGongEnum(gongenum *GongEnum) CheckoutGongEnum(gongenum *GongEnum) CommitGongEnumValue(gongenumvalue *GongEnumValue) CheckoutGongEnumValue(gongenumvalue *GongEnumValue) CommitGongLink(gonglink *GongLink) CheckoutGongLink(gonglink *GongLink) CommitGongNote(gongnote *GongNote) CheckoutGongNote(gongnote *GongNote) CommitGongStruct(gongstruct *GongStruct) CheckoutGongStruct(gongstruct *GongStruct) CommitGongTimeField(gongtimefield *GongTimeField) CheckoutGongTimeField(gongtimefield *GongTimeField) CommitMeta(meta *Meta) CheckoutMeta(meta *Meta) CommitMetaReference(metareference *MetaReference) CheckoutMetaReference(metareference *MetaReference) CommitModelPkg(modelpkg *ModelPkg) CheckoutModelPkg(modelpkg *ModelPkg) CommitPointerToGongStructField(pointertogongstructfield *PointerToGongStructField) CheckoutPointerToGongStructField(pointertogongstructfield *PointerToGongStructField) CommitSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField) CheckoutSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField) GetLastCommitFromBackNb() uint GetLastPushFromFrontNb() uint }
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 FieldInterface ¶
type FieldInterface interface { GetName() string GetIndex() int // get the field index with its belonging gongstruct // GetCompositeStructName provides, if it is from a composite struct, the name of the composite struct // where the field is present. // It is empty otherwise GetCompositeStructName() string }
type FileInterface ¶
type FileInterface interface {
Path() string
}
type GONG__ExpressionType ¶
type GONG__ExpressionType string
swagger:ignore
const ( GONG__STRUCT_INSTANCE GONG__ExpressionType = "STRUCT_INSTANCE" GONG__FIELD_OR_CONST_VALUE GONG__ExpressionType = "FIELD_OR_CONST_VALUE" GONG__FIELD_VALUE GONG__ExpressionType = "FIELD_VALUE" GONG__ENUM_CAST_INT GONG__ExpressionType = "ENUM_CAST_INT" GONG__ENUM_CAST_STRING GONG__ExpressionType = "ENUM_CAST_STRING" GONG__IDENTIFIER_CONST GONG__ExpressionType = "IDENTIFIER_CONST" )
type GONG__Identifier ¶
type GONG__Identifier struct { Ident string Type GONG__ExpressionType }
type GongBasicField ¶
type GongBasicField struct { Name string BasicKindName string GongEnum *GongEnum // not null if it is an enum variable DeclaredType string // "time.Duration" for instance (the underlying type being int64) CompositeStructName string Index int // IsDocLink is true if the field is a string field // that is set at compile time by a DocLink directive //gong:ident IsDocLink bool // if there is a gong:text gong directive IsTextArea bool // IsBespokeWidth indicates wether the field shall be displayed with a // beskope width // this is set with a gong:width <width in px> gong directive IsBespokeWidth bool BespokeWidth int // IsBespokeHeight bool BespokeHeight int // contains filtered or unexported fields }
func CopyBranchGongBasicField ¶
func CopyBranchGongBasicField(mapOrigCopy map[any]any, gongbasicfieldFrom *GongBasicField) (gongbasicfieldTo *GongBasicField)
insertion point for stage branch per struct
func (*GongBasicField) Checkout ¶
func (gongbasicfield *GongBasicField) Checkout(stage *StageStruct) *GongBasicField
Checkout gongbasicfield to the back repo (if it is already staged)
func (*GongBasicField) Commit ¶
func (gongbasicfield *GongBasicField) Commit(stage *StageStruct) *GongBasicField
commit gongbasicfield to the back repo (if it is already staged)
func (*GongBasicField) CommitVoid ¶
func (gongbasicfield *GongBasicField) CommitVoid(stage *StageStruct)
func (*GongBasicField) CopyBasicFields ¶
func (from *GongBasicField) CopyBasicFields(to *GongBasicField)
func (*GongBasicField) GetBasicKind ¶
func (gongBasicField *GongBasicField) GetBasicKind() types.BasicKind
func (*GongBasicField) GetCompositeStructName ¶
func (gongBasicField *GongBasicField) GetCompositeStructName() string
func (*GongBasicField) GetIndex ¶
func (gongBasicField *GongBasicField) GetIndex() int
func (*GongBasicField) GetName ¶
func (gongbasicfield *GongBasicField) GetName() (res string)
for satisfaction of GongStruct interface
func (*GongBasicField) Stage ¶
func (gongbasicfield *GongBasicField) Stage(stage *StageStruct) *GongBasicField
insertion point for cumulative sub template with model space calls Stage puts gongbasicfield to the model stage
func (*GongBasicField) Unstage ¶
func (gongbasicfield *GongBasicField) Unstage(stage *StageStruct) *GongBasicField
Unstage removes gongbasicfield off the model stage
func (*GongBasicField) UnstageVoid ¶
func (gongbasicfield *GongBasicField) UnstageVoid(stage *StageStruct)
UnstageVoid removes gongbasicfield off the model stage
type GongBasicField_WOP ¶
type GongBasicField_WOP struct { // insertion point Name string BasicKindName string DeclaredType string CompositeStructName string Index int IsDocLink bool IsTextArea bool IsBespokeWidth bool BespokeWidth int IsBespokeHeight bool BespokeHeight int }
insertion point
type GongEnum ¶
type GongEnum struct { Name string Type GongEnumType GongEnumValues []*GongEnumValue }
GongEnum is a go const declared as enum that is selected by the gongc compiler
func CopyBranchGongEnum ¶
func (*GongEnum) Checkout ¶
func (gongenum *GongEnum) Checkout(stage *StageStruct) *GongEnum
Checkout gongenum to the back repo (if it is already staged)
func (*GongEnum) Commit ¶
func (gongenum *GongEnum) Commit(stage *StageStruct) *GongEnum
commit gongenum to the back repo (if it is already staged)
func (*GongEnum) CommitVoid ¶
func (gongenum *GongEnum) CommitVoid(stage *StageStruct)
func (*GongEnum) CopyBasicFields ¶
func (*GongEnum) Stage ¶
func (gongenum *GongEnum) Stage(stage *StageStruct) *GongEnum
Stage puts gongenum to the model stage
func (*GongEnum) Unstage ¶
func (gongenum *GongEnum) Unstage(stage *StageStruct) *GongEnum
Unstage removes gongenum off the model stage
func (*GongEnum) UnstageVoid ¶
func (gongenum *GongEnum) UnstageVoid(stage *StageStruct)
UnstageVoid removes gongenum off the model stage
type GongEnumType ¶
type GongEnumType int
const ( Int GongEnumType = iota String )
func (GongEnumType) CodeValues ¶
func (gongenumtype GongEnumType) CodeValues() (res []int)
func (GongEnumType) Codes ¶
func (gongenumtype GongEnumType) Codes() (res []string)
func (*GongEnumType) FromCodeString ¶
func (gongenumtype *GongEnumType) FromCodeString(input string) (err error)
func (*GongEnumType) FromInt ¶
func (gongenumtype *GongEnumType) FromInt(input int) (err error)
func (*GongEnumType) ToCodeString ¶
func (gongenumtype *GongEnumType) ToCodeString() (res string)
func (GongEnumType) ToInt ¶
func (gongenumtype GongEnumType) ToInt() (res int)
insertion point of enum utility functions Utility function for GongEnumType 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 GongEnumValue ¶
GongEnumValue is a go const declared as Value of an enum that is selected by the gongc compiler
func CopyBranchGongEnumValue ¶
func CopyBranchGongEnumValue(mapOrigCopy map[any]any, gongenumvalueFrom *GongEnumValue) (gongenumvalueTo *GongEnumValue)
func (*GongEnumValue) Checkout ¶
func (gongenumvalue *GongEnumValue) Checkout(stage *StageStruct) *GongEnumValue
Checkout gongenumvalue to the back repo (if it is already staged)
func (*GongEnumValue) Commit ¶
func (gongenumvalue *GongEnumValue) Commit(stage *StageStruct) *GongEnumValue
commit gongenumvalue to the back repo (if it is already staged)
func (*GongEnumValue) CommitVoid ¶
func (gongenumvalue *GongEnumValue) CommitVoid(stage *StageStruct)
func (*GongEnumValue) CopyBasicFields ¶
func (from *GongEnumValue) CopyBasicFields(to *GongEnumValue)
func (*GongEnumValue) GetName ¶
func (gongenumvalue *GongEnumValue) GetName() (res string)
for satisfaction of GongStruct interface
func (*GongEnumValue) Stage ¶
func (gongenumvalue *GongEnumValue) Stage(stage *StageStruct) *GongEnumValue
Stage puts gongenumvalue to the model stage
func (*GongEnumValue) Unstage ¶
func (gongenumvalue *GongEnumValue) Unstage(stage *StageStruct) *GongEnumValue
Unstage removes gongenumvalue off the model stage
func (*GongEnumValue) UnstageVoid ¶
func (gongenumvalue *GongEnumValue) UnstageVoid(stage *StageStruct)
UnstageVoid removes gongenumvalue off the model stage
type GongEnumValue_WOP ¶
type GongEnum_WOP ¶
type GongEnum_WOP struct { // insertion point Name string Type GongEnumType }
type GongLink ¶
type GongLink struct { // store the link without the brackets, for instance or "Astruct" or "AstructBstructUse" in // "Astruct.AstructBstructUse" Name string Recv string // "Astruct" if docLink is "Astruct.AstructBstructUse" ImportPath string }
GongLink stores the result of the parsing of a Doc Link
It is appended to a GongNote see [Doc Links](https://tip.golang.org/doc/comment) which has been added to the go in 1.19 and is accessible in the [AST](https://pkg.go.dev/go/doc/comment@go1.19.4#DocLink).
func CopyBranchGongLink ¶
func (*GongLink) Checkout ¶
func (gonglink *GongLink) Checkout(stage *StageStruct) *GongLink
Checkout gonglink to the back repo (if it is already staged)
func (*GongLink) Commit ¶
func (gonglink *GongLink) Commit(stage *StageStruct) *GongLink
commit gonglink to the back repo (if it is already staged)
func (*GongLink) CommitVoid ¶
func (gonglink *GongLink) CommitVoid(stage *StageStruct)
func (*GongLink) CopyBasicFields ¶
func (*GongLink) Stage ¶
func (gonglink *GongLink) Stage(stage *StageStruct) *GongLink
Stage puts gonglink to the model stage
func (*GongLink) Unstage ¶
func (gonglink *GongLink) Unstage(stage *StageStruct) *GongLink
Unstage removes gonglink off the model stage
func (*GongLink) UnstageVoid ¶
func (gonglink *GongLink) UnstageVoid(stage *StageStruct)
UnstageVoid removes gonglink off the model stage
type GongLink_WOP ¶
type GongNote ¶
type GongNote struct { Name string Body string // conversion of the comment into HTML (uses of go comment ) BodyHTML string Links []*GongLink }
Gongnote is a documentation note that contribues to the model documentation
A Gongnote is a go comment that contains the keywork "GONGNOTE(<Name>): <body>" for instance .... GONGDOC(NoteOnOrganizationOfLineAndPoints): first line this is an example of a note that could be displayed on a diagram.
The comment can be standalone or attached to a declation/var const NoteOnOrganizationOfLineAndPoints = ""
func CopyBranchGongNote ¶
func (*GongNote) Checkout ¶
func (gongnote *GongNote) Checkout(stage *StageStruct) *GongNote
Checkout gongnote to the back repo (if it is already staged)
func (*GongNote) Commit ¶
func (gongnote *GongNote) Commit(stage *StageStruct) *GongNote
commit gongnote to the back repo (if it is already staged)
func (*GongNote) CommitVoid ¶
func (gongnote *GongNote) CommitVoid(stage *StageStruct)
func (*GongNote) CopyBasicFields ¶
func (*GongNote) Stage ¶
func (gongnote *GongNote) Stage(stage *StageStruct) *GongNote
Stage puts gongnote to the model stage
func (*GongNote) Unstage ¶
func (gongnote *GongNote) Unstage(stage *StageStruct) *GongNote
Unstage removes gongnote off the model stage
func (*GongNote) UnstageVoid ¶
func (gongnote *GongNote) UnstageVoid(stage *StageStruct)
UnstageVoid removes gongnote off the model stage
type GongNote_WOP ¶
type GongStruct ¶
type GongStruct struct { Name string // Fields (stored according to the source file order) // swagger:ignore Fields []FieldInterface `gorm:"-"` // Slice of Fields by their type (not populated by the gongc) GongBasicFields []*GongBasicField GongTimeFields []*GongTimeField PointerToGongStructFields []*PointerToGongStructField SliceOfPointerToGongStructFields []*SliceOfPointerToGongStructField // HasOnAfterUpdateSignature is used to generate orchestrator code HasOnAfterUpdateSignature bool // IsIgnoredForFront, if true, let the compiler avoid generation of code // in the angular front // .frontignore file provides a pattern for parsing go files similar to the gitingore syntax "*" // every GongStruct defined in matched go file has IsIgnoredForFront set to true IsIgnoredForFront bool }
GongStruct is a go struct that is selected by the gongc compiler swagger:model
func CopyBranchGongStruct ¶
func CopyBranchGongStruct(mapOrigCopy map[any]any, gongstructFrom *GongStruct) (gongstructTo *GongStruct)
func (*GongStruct) Checkout ¶
func (gongstruct *GongStruct) Checkout(stage *StageStruct) *GongStruct
Checkout gongstruct to the back repo (if it is already staged)
func (*GongStruct) Commit ¶
func (gongstruct *GongStruct) Commit(stage *StageStruct) *GongStruct
commit gongstruct to the back repo (if it is already staged)
func (*GongStruct) CommitVoid ¶
func (gongstruct *GongStruct) CommitVoid(stage *StageStruct)
func (*GongStruct) ComputeFielProloguesEpilogues ¶
func (gongStruct *GongStruct) ComputeFielProloguesEpilogues(field FieldInterface) ( prologueDB, epilogueDB, prologuePointerEncoding, epiloguePointerEncoding, prologueWOP, epilogueWOP string)
ComputeFielProloguesEpilogues computes wether the field shall be preceded by the prologue declaring the containing anonymous struct
func (*GongStruct) CopyBasicFields ¶
func (from *GongStruct) CopyBasicFields(to *GongStruct)
func (*GongStruct) GetName ¶
func (gongstruct *GongStruct) GetName() (res string)
for satisfaction of GongStruct interface
func (*GongStruct) HasNameField ¶
func (gongStruct *GongStruct) HasNameField() (hasNameField bool)
HasNameField indicates wether the gong struct has a field with Name "Name"
This is important since - only Gong Struct with Name field can be stored in DB - only Gong Struct without file
func (*GongStruct) Stage ¶
func (gongstruct *GongStruct) Stage(stage *StageStruct) *GongStruct
Stage puts gongstruct to the model stage
func (*GongStruct) Unstage ¶
func (gongstruct *GongStruct) Unstage(stage *StageStruct) *GongStruct
Unstage removes gongstruct off the model stage
func (*GongStruct) UnstageVoid ¶
func (gongstruct *GongStruct) UnstageVoid(stage *StageStruct)
UnstageVoid removes gongstruct off the model stage
type GongStructInterface ¶
type GongStructInterface interface {
GetName() (res string)
}
GongStructInterface is the interface met by GongStructs It allows runtime reflexion of instances (without the hassle of the "reflect" package)
type GongStruct_WOP ¶
type GongTimeField ¶
func CopyBranchGongTimeField ¶
func CopyBranchGongTimeField(mapOrigCopy map[any]any, gongtimefieldFrom *GongTimeField) (gongtimefieldTo *GongTimeField)
func (*GongTimeField) Checkout ¶
func (gongtimefield *GongTimeField) Checkout(stage *StageStruct) *GongTimeField
Checkout gongtimefield to the back repo (if it is already staged)
func (*GongTimeField) Commit ¶
func (gongtimefield *GongTimeField) Commit(stage *StageStruct) *GongTimeField
commit gongtimefield to the back repo (if it is already staged)
func (*GongTimeField) CommitVoid ¶
func (gongtimefield *GongTimeField) CommitVoid(stage *StageStruct)
func (*GongTimeField) CopyBasicFields ¶
func (from *GongTimeField) CopyBasicFields(to *GongTimeField)
func (*GongTimeField) GetCompositeStructName ¶
func (gongTimeField *GongTimeField) GetCompositeStructName() string
func (*GongTimeField) GetIndex ¶
func (gongTimeField *GongTimeField) GetIndex() int
func (*GongTimeField) GetName ¶
func (gongtimefield *GongTimeField) GetName() (res string)
for satisfaction of GongStruct interface
func (*GongTimeField) Stage ¶
func (gongtimefield *GongTimeField) Stage(stage *StageStruct) *GongTimeField
Stage puts gongtimefield to the model stage
func (*GongTimeField) Unstage ¶
func (gongtimefield *GongTimeField) Unstage(stage *StageStruct) *GongTimeField
Unstage removes gongtimefield off the model stage
func (*GongTimeField) UnstageVoid ¶
func (gongtimefield *GongTimeField) UnstageVoid(stage *StageStruct)
UnstageVoid removes gongtimefield off the model stage
type GongTimeField_WOP ¶
type Gongstruct ¶
type Gongstruct interface { }
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 GongstructEnumIntField ¶
type GongstructEnumIntField interface { int | GongEnumType Codes() []string CodeValues() []int }
type GongstructMapString ¶
type GongstructSet ¶
type GongtructBasicField ¶
type Meta ¶
type Meta struct { Name string Text string // references to symbols in the code MetaReferences []*MetaReference }
Meta is a fallback solution explained to the meta keyword proposal
func (*Meta) Checkout ¶
func (meta *Meta) Checkout(stage *StageStruct) *Meta
Checkout meta to the back repo (if it is already staged)
func (*Meta) Commit ¶
func (meta *Meta) Commit(stage *StageStruct) *Meta
commit meta to the back repo (if it is already staged)
func (*Meta) CommitVoid ¶
func (meta *Meta) CommitVoid(stage *StageStruct)
func (*Meta) CopyBasicFields ¶
func (*Meta) Stage ¶
func (meta *Meta) Stage(stage *StageStruct) *Meta
Stage puts meta to the model stage
func (*Meta) Unstage ¶
func (meta *Meta) Unstage(stage *StageStruct) *Meta
Unstage removes meta off the model stage
func (*Meta) UnstageVoid ¶
func (meta *Meta) UnstageVoid(stage *StageStruct)
UnstageVoid removes meta off the model stage
type MetaReference ¶
type MetaReference struct {
Name string
}
func CopyBranchMetaReference ¶
func CopyBranchMetaReference(mapOrigCopy map[any]any, metareferenceFrom *MetaReference) (metareferenceTo *MetaReference)
func (*MetaReference) Checkout ¶
func (metareference *MetaReference) Checkout(stage *StageStruct) *MetaReference
Checkout metareference to the back repo (if it is already staged)
func (*MetaReference) Commit ¶
func (metareference *MetaReference) Commit(stage *StageStruct) *MetaReference
commit metareference to the back repo (if it is already staged)
func (*MetaReference) CommitVoid ¶
func (metareference *MetaReference) CommitVoid(stage *StageStruct)
func (*MetaReference) CopyBasicFields ¶
func (from *MetaReference) CopyBasicFields(to *MetaReference)
func (*MetaReference) GetName ¶
func (metareference *MetaReference) GetName() (res string)
for satisfaction of GongStruct interface
func (*MetaReference) Stage ¶
func (metareference *MetaReference) Stage(stage *StageStruct) *MetaReference
Stage puts metareference to the model stage
func (*MetaReference) Unstage ¶
func (metareference *MetaReference) Unstage(stage *StageStruct) *MetaReference
Unstage removes metareference off the model stage
func (*MetaReference) UnstageVoid ¶
func (metareference *MetaReference) UnstageVoid(stage *StageStruct)
UnstageVoid removes metareference off the model stage
type MetaReference_WOP ¶
type MetaReference_WOP struct { // insertion point Name string }
type ModelPkg ¶
type ModelPkg struct { Name string // should be "models" PkgPath string // for instance "github.com/.../models" // Stage_ is where the ModelPkg lives Stage_ *StageStruct GongStructs map[string]*GongStruct `gorm:"-"` // sql3Lite does not support maps GongEnums map[string]*GongEnum `gorm:"-"` GongNotes map[string]*GongNote `gorm:"-"` // PathToGoSubDirectory for instance "/tmp" PathToGoSubDirectory string // OrmPkgGenPath is target path for orm package, for instance "/tmp/libraryorm" OrmPkgGenPath string // DbOrmPkgGenPath is target path for orm package, for instance "/tmp/libraryorm/db" DbOrmPkgGenPath string // DbOrmPkgGenPath is target path for orm package, for instance "/tmp/libraryorm/db" DbLiteOrmPkgGenPath string // DbPkgGenPath is target path for orm package, for instance "/tmp/libraryorm/db" DbPkgGenPath string // ControllersPkgGenPath is target path for controllers package ControllersPkgGenPath string // FullstackPkgGenPath is target path for Fullstack package FullstackPkgGenPath string // StackPkgGenPath is target path for Stack package StackPkgGenPath string // StaticPkgGenPath is target path for Static package StaticPkgGenPath string // ProbePkgGenPath is target path for Data package ProbePkgGenPath string // NgWorkspacePath is the path to the Ng Workspace NgWorkspacePath string // NgWorkspaceName is the name of the angular workspace // // note : initialy the name was "ng" for all angular workspace but "npm workspaces" // does not support workspaces that have the same name (it does not know // about aliasing) NgWorkspaceName string // NgDataLibrarySourceCodeDirectory is the "<pkgName>/src/lib" directory where, // by angular CLI convention, // the source code for the library's components, // services, modules, and other features are located. // // gongc regenerates at each compilation a material angular library "<pkgName>" for // having the code related to data manipulation of objects of the // stack NgDataLibrarySourceCodeDirectory string // NgSpecificLibrarySourceCodeDirectory is the "<pkgName>specific/src/lib" // where the developper stores its specific code for the front component // // This library is generated once at the stack creation NgSpecificLibrarySourceCodeDirectory string // MaterialLibDatamodelTargetPath is the "<pkgName>datamodel/src/lib" // // gongc regenerates at each compilation a material angular library "<pkgName>datamodel" for // having the code related to inclusion of the gongdoc stack and the gong stack // for docmenting the stack with UML diagrams (gongdoc) and providing a meta inspection // of the declarations of the stack MaterialLibDatamodelTargetPath string }
ModelPkg is the go package where the gong source code is located
It contains the list of GongStructs & GongEnum
func CopyBranchModelPkg ¶
func LoadEmbedded ¶
func LoadEmbedded(stage *StageStruct, goModelsDir embed.FS) (modelPkg *ModelPkg, err error)
dir, initialized with a //go:embed directive, is the root the embedded source code usualy, it embeds go/models go/diagrams
func LoadSource ¶
func LoadSource(stage *StageStruct, pkgPath string) (modelPkg *ModelPkg, err error)
func NewModelPkg ¶
func NewModelPkg(stage *StageStruct) (modelPkg *ModelPkg)
func (*ModelPkg) Checkout ¶
func (modelpkg *ModelPkg) Checkout(stage *StageStruct) *ModelPkg
Checkout modelpkg to the back repo (if it is already staged)
func (*ModelPkg) Commit ¶
func (modelpkg *ModelPkg) Commit(stage *StageStruct) *ModelPkg
commit modelpkg to the back repo (if it is already staged)
func (*ModelPkg) CommitVoid ¶
func (modelpkg *ModelPkg) CommitVoid(stage *StageStruct)
func (*ModelPkg) CopyBasicFields ¶
func (*ModelPkg) GenerateDocs ¶
GenerateDocs populates modelPkg with Gongnote presnt in the docPackage
func (*ModelPkg) GetStage ¶
func (modelPkg *ModelPkg) GetStage() (stage *StageStruct)
func (*ModelPkg) SerializeToStage ¶
func (modelPkg *ModelPkg) SerializeToStage()
SerializeToStage stages modelPkg and recursively stage all structs and all fields of all structs
func (*ModelPkg) SetStage ¶
func (modelPkg *ModelPkg) SetStage(stage *StageStruct)
func (*ModelPkg) Stage ¶
func (modelpkg *ModelPkg) Stage(stage *StageStruct) *ModelPkg
Stage puts modelpkg to the model stage
func (*ModelPkg) Unstage ¶
func (modelpkg *ModelPkg) Unstage(stage *StageStruct) *ModelPkg
Unstage removes modelpkg off the model stage
func (*ModelPkg) UnstageVoid ¶
func (modelpkg *ModelPkg) UnstageVoid(stage *StageStruct)
UnstageVoid removes modelpkg off the model stage
type ModelPkg_WOP ¶
type ModelPkg_WOP struct { // insertion point Name string PkgPath string PathToGoSubDirectory string OrmPkgGenPath string DbOrmPkgGenPath string DbLiteOrmPkgGenPath string DbPkgGenPath string ControllersPkgGenPath string FullstackPkgGenPath string StackPkgGenPath string StaticPkgGenPath string ProbePkgGenPath string NgWorkspacePath string NgWorkspaceName string NgDataLibrarySourceCodeDirectory string NgSpecificLibrarySourceCodeDirectory string MaterialLibDatamodelTargetPath string }
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 PointerToGongStructField ¶
type PointerToGongStructField struct { Name string GongStruct *GongStruct Index int CompositeStructName string // IsType denotes wether this association is to a type // // a pointer to a gongstruct with "gong:type" magic node means that the object points to a type // This means that when a branch is copied, the duplicate meachanism // will stop here and only duplicate the pointer, not the type IsType bool }
PointerToGongStructField swagger:model
func CopyBranchPointerToGongStructField ¶
func CopyBranchPointerToGongStructField(mapOrigCopy map[any]any, pointertogongstructfieldFrom *PointerToGongStructField) (pointertogongstructfieldTo *PointerToGongStructField)
func (*PointerToGongStructField) Checkout ¶
func (pointertogongstructfield *PointerToGongStructField) Checkout(stage *StageStruct) *PointerToGongStructField
Checkout pointertogongstructfield to the back repo (if it is already staged)
func (*PointerToGongStructField) Commit ¶
func (pointertogongstructfield *PointerToGongStructField) Commit(stage *StageStruct) *PointerToGongStructField
commit pointertogongstructfield to the back repo (if it is already staged)
func (*PointerToGongStructField) CommitVoid ¶
func (pointertogongstructfield *PointerToGongStructField) CommitVoid(stage *StageStruct)
func (*PointerToGongStructField) CopyBasicFields ¶
func (from *PointerToGongStructField) CopyBasicFields(to *PointerToGongStructField)
func (*PointerToGongStructField) GetCompositeStructName ¶
func (pointerToGongStructField *PointerToGongStructField) GetCompositeStructName() string
func (*PointerToGongStructField) GetIndex ¶
func (pointerToGongStructField *PointerToGongStructField) GetIndex() int
func (*PointerToGongStructField) GetName ¶
func (pointertogongstructfield *PointerToGongStructField) GetName() (res string)
for satisfaction of GongStruct interface
func (*PointerToGongStructField) Stage ¶
func (pointertogongstructfield *PointerToGongStructField) Stage(stage *StageStruct) *PointerToGongStructField
Stage puts pointertogongstructfield to the model stage
func (*PointerToGongStructField) Unstage ¶
func (pointertogongstructfield *PointerToGongStructField) Unstage(stage *StageStruct) *PointerToGongStructField
Unstage removes pointertogongstructfield off the model stage
func (*PointerToGongStructField) UnstageVoid ¶
func (pointertogongstructfield *PointerToGongStructField) UnstageVoid(stage *StageStruct)
UnstageVoid removes pointertogongstructfield off the model stage
type PointerToGongstruct ¶
type PointerToGongstruct interface { GetName() string CommitVoid(*StageStruct) UnstageVoid(stage *StageStruct) comparable }
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 PointerToGongstructEnumIntField ¶
type PointerToGongstructEnumIntField interface { *GongEnumType FromCodeString(input string) (err error) }
type ReverseField ¶
func GetReverseFields ¶
func GetReverseFields[Type Gongstruct]() (res []ReverseField)
type SliceOfPointerToGongStructField ¶
type SliceOfPointerToGongStructField struct { Name string GongStruct *GongStruct Index int CompositeStructName string }
SliceOfPointerToGongStructField swagger:model
func CopyBranchSliceOfPointerToGongStructField ¶
func CopyBranchSliceOfPointerToGongStructField(mapOrigCopy map[any]any, sliceofpointertogongstructfieldFrom *SliceOfPointerToGongStructField) (sliceofpointertogongstructfieldTo *SliceOfPointerToGongStructField)
func (*SliceOfPointerToGongStructField) Checkout ¶
func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Checkout(stage *StageStruct) *SliceOfPointerToGongStructField
Checkout sliceofpointertogongstructfield to the back repo (if it is already staged)
func (*SliceOfPointerToGongStructField) Commit ¶
func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Commit(stage *StageStruct) *SliceOfPointerToGongStructField
commit sliceofpointertogongstructfield to the back repo (if it is already staged)
func (*SliceOfPointerToGongStructField) CommitVoid ¶
func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) CommitVoid(stage *StageStruct)
func (*SliceOfPointerToGongStructField) CopyBasicFields ¶
func (from *SliceOfPointerToGongStructField) CopyBasicFields(to *SliceOfPointerToGongStructField)
func (*SliceOfPointerToGongStructField) GetCompositeStructName ¶
func (sliceOfPointerToGongStructField *SliceOfPointerToGongStructField) GetCompositeStructName() string
func (*SliceOfPointerToGongStructField) GetIndex ¶
func (sliceOfPointerToGongStructField *SliceOfPointerToGongStructField) GetIndex() int
func (*SliceOfPointerToGongStructField) GetName ¶
func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) GetName() (res string)
for satisfaction of GongStruct interface
func (*SliceOfPointerToGongStructField) Stage ¶
func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Stage(stage *StageStruct) *SliceOfPointerToGongStructField
Stage puts sliceofpointertogongstructfield to the model stage
func (*SliceOfPointerToGongStructField) Unstage ¶
func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) Unstage(stage *StageStruct) *SliceOfPointerToGongStructField
Unstage removes sliceofpointertogongstructfield off the model stage
func (*SliceOfPointerToGongStructField) UnstageVoid ¶
func (sliceofpointertogongstructfield *SliceOfPointerToGongStructField) UnstageVoid(stage *StageStruct)
UnstageVoid removes sliceofpointertogongstructfield off the model stage
type StageStruct ¶
type StageStruct struct { // insertion point for definition of arrays registering instances GongBasicFields map[*GongBasicField]any GongBasicFields_mapString map[string]*GongBasicField // insertion point for slice of pointers maps OnAfterGongBasicFieldCreateCallback OnAfterCreateInterface[GongBasicField] OnAfterGongBasicFieldUpdateCallback OnAfterUpdateInterface[GongBasicField] OnAfterGongBasicFieldDeleteCallback OnAfterDeleteInterface[GongBasicField] OnAfterGongBasicFieldReadCallback OnAfterReadInterface[GongBasicField] GongEnums map[*GongEnum]any GongEnums_mapString map[string]*GongEnum // insertion point for slice of pointers maps GongEnum_GongEnumValues_reverseMap map[*GongEnumValue]*GongEnum OnAfterGongEnumCreateCallback OnAfterCreateInterface[GongEnum] OnAfterGongEnumUpdateCallback OnAfterUpdateInterface[GongEnum] OnAfterGongEnumDeleteCallback OnAfterDeleteInterface[GongEnum] OnAfterGongEnumReadCallback OnAfterReadInterface[GongEnum] GongEnumValues map[*GongEnumValue]any GongEnumValues_mapString map[string]*GongEnumValue // insertion point for slice of pointers maps OnAfterGongEnumValueCreateCallback OnAfterCreateInterface[GongEnumValue] OnAfterGongEnumValueUpdateCallback OnAfterUpdateInterface[GongEnumValue] OnAfterGongEnumValueDeleteCallback OnAfterDeleteInterface[GongEnumValue] OnAfterGongEnumValueReadCallback OnAfterReadInterface[GongEnumValue] GongLinks map[*GongLink]any GongLinks_mapString map[string]*GongLink // insertion point for slice of pointers maps OnAfterGongLinkCreateCallback OnAfterCreateInterface[GongLink] OnAfterGongLinkUpdateCallback OnAfterUpdateInterface[GongLink] OnAfterGongLinkDeleteCallback OnAfterDeleteInterface[GongLink] OnAfterGongLinkReadCallback OnAfterReadInterface[GongLink] GongNotes map[*GongNote]any GongNotes_mapString map[string]*GongNote // insertion point for slice of pointers maps GongNote_Links_reverseMap map[*GongLink]*GongNote OnAfterGongNoteCreateCallback OnAfterCreateInterface[GongNote] OnAfterGongNoteUpdateCallback OnAfterUpdateInterface[GongNote] OnAfterGongNoteDeleteCallback OnAfterDeleteInterface[GongNote] OnAfterGongNoteReadCallback OnAfterReadInterface[GongNote] GongStructs map[*GongStruct]any GongStructs_mapString map[string]*GongStruct // insertion point for slice of pointers maps GongStruct_GongBasicFields_reverseMap map[*GongBasicField]*GongStruct GongStruct_GongTimeFields_reverseMap map[*GongTimeField]*GongStruct GongStruct_PointerToGongStructFields_reverseMap map[*PointerToGongStructField]*GongStruct GongStruct_SliceOfPointerToGongStructFields_reverseMap map[*SliceOfPointerToGongStructField]*GongStruct OnAfterGongStructCreateCallback OnAfterCreateInterface[GongStruct] OnAfterGongStructUpdateCallback OnAfterUpdateInterface[GongStruct] OnAfterGongStructDeleteCallback OnAfterDeleteInterface[GongStruct] OnAfterGongStructReadCallback OnAfterReadInterface[GongStruct] GongTimeFields map[*GongTimeField]any GongTimeFields_mapString map[string]*GongTimeField // insertion point for slice of pointers maps OnAfterGongTimeFieldCreateCallback OnAfterCreateInterface[GongTimeField] OnAfterGongTimeFieldUpdateCallback OnAfterUpdateInterface[GongTimeField] OnAfterGongTimeFieldDeleteCallback OnAfterDeleteInterface[GongTimeField] OnAfterGongTimeFieldReadCallback OnAfterReadInterface[GongTimeField] Metas map[*Meta]any Metas_mapString map[string]*Meta // insertion point for slice of pointers maps Meta_MetaReferences_reverseMap map[*MetaReference]*Meta OnAfterMetaCreateCallback OnAfterCreateInterface[Meta] OnAfterMetaUpdateCallback OnAfterUpdateInterface[Meta] OnAfterMetaDeleteCallback OnAfterDeleteInterface[Meta] OnAfterMetaReadCallback OnAfterReadInterface[Meta] MetaReferences map[*MetaReference]any MetaReferences_mapString map[string]*MetaReference // insertion point for slice of pointers maps OnAfterMetaReferenceCreateCallback OnAfterCreateInterface[MetaReference] OnAfterMetaReferenceUpdateCallback OnAfterUpdateInterface[MetaReference] OnAfterMetaReferenceDeleteCallback OnAfterDeleteInterface[MetaReference] OnAfterMetaReferenceReadCallback OnAfterReadInterface[MetaReference] ModelPkgs map[*ModelPkg]any ModelPkgs_mapString map[string]*ModelPkg // insertion point for slice of pointers maps OnAfterModelPkgCreateCallback OnAfterCreateInterface[ModelPkg] OnAfterModelPkgUpdateCallback OnAfterUpdateInterface[ModelPkg] OnAfterModelPkgDeleteCallback OnAfterDeleteInterface[ModelPkg] OnAfterModelPkgReadCallback OnAfterReadInterface[ModelPkg] PointerToGongStructFields map[*PointerToGongStructField]any PointerToGongStructFields_mapString map[string]*PointerToGongStructField // insertion point for slice of pointers maps OnAfterPointerToGongStructFieldCreateCallback OnAfterCreateInterface[PointerToGongStructField] OnAfterPointerToGongStructFieldUpdateCallback OnAfterUpdateInterface[PointerToGongStructField] OnAfterPointerToGongStructFieldDeleteCallback OnAfterDeleteInterface[PointerToGongStructField] OnAfterPointerToGongStructFieldReadCallback OnAfterReadInterface[PointerToGongStructField] SliceOfPointerToGongStructFields map[*SliceOfPointerToGongStructField]any SliceOfPointerToGongStructFields_mapString map[string]*SliceOfPointerToGongStructField // insertion point for slice of pointers maps OnAfterSliceOfPointerToGongStructFieldCreateCallback OnAfterCreateInterface[SliceOfPointerToGongStructField] OnAfterSliceOfPointerToGongStructFieldUpdateCallback OnAfterUpdateInterface[SliceOfPointerToGongStructField] OnAfterSliceOfPointerToGongStructFieldDeleteCallback OnAfterDeleteInterface[SliceOfPointerToGongStructField] OnAfterSliceOfPointerToGongStructFieldReadCallback OnAfterReadInterface[SliceOfPointerToGongStructField] 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 // store meta package import MetaPackageImportPath string MetaPackageImportAlias string // to be removed after fix of [issue](https://github.com/golang/go/issues/57559) // map to enable docLink renaming when an identifier is renamed Map_DocLink_Renaming map[string]GONG__Identifier // contains filtered or unexported fields }
StageStruct enables storage of staged instances swagger:ignore
func NewStage ¶
func NewStage(path string) (stage *StageStruct)
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) CommitWithSuspendedCallbacks ¶
func (stage *StageStruct) CommitWithSuspendedCallbacks()
func (*StageStruct) ComputeReverseMaps ¶
func (stage *StageStruct) ComputeReverseMaps()
ComputeReverseMaps computes the reverse map, for all intances, for all slice to pointers field Its complexity is in O(n)O(p) where p is the number of pointers
func (*StageStruct) GetPath ¶
func (stage *StageStruct) GetPath() string
func (*StageStruct) GetType ¶
func (stage *StageStruct) GetType() string
func (*StageStruct) IsStagedGongBasicField ¶
func (stage *StageStruct) IsStagedGongBasicField(gongbasicfield *GongBasicField) (ok bool)
insertion point for stage per struct
func (*StageStruct) IsStagedGongEnum ¶
func (stage *StageStruct) IsStagedGongEnum(gongenum *GongEnum) (ok bool)
func (*StageStruct) IsStagedGongEnumValue ¶
func (stage *StageStruct) IsStagedGongEnumValue(gongenumvalue *GongEnumValue) (ok bool)
func (*StageStruct) IsStagedGongLink ¶
func (stage *StageStruct) IsStagedGongLink(gonglink *GongLink) (ok bool)
func (*StageStruct) IsStagedGongNote ¶
func (stage *StageStruct) IsStagedGongNote(gongnote *GongNote) (ok bool)
func (*StageStruct) IsStagedGongStruct ¶
func (stage *StageStruct) IsStagedGongStruct(gongstruct *GongStruct) (ok bool)
func (*StageStruct) IsStagedGongTimeField ¶
func (stage *StageStruct) IsStagedGongTimeField(gongtimefield *GongTimeField) (ok bool)
func (*StageStruct) IsStagedMeta ¶
func (stage *StageStruct) IsStagedMeta(meta *Meta) (ok bool)
func (*StageStruct) IsStagedMetaReference ¶
func (stage *StageStruct) IsStagedMetaReference(metareference *MetaReference) (ok bool)
func (*StageStruct) IsStagedModelPkg ¶
func (stage *StageStruct) IsStagedModelPkg(modelpkg *ModelPkg) (ok bool)
func (*StageStruct) IsStagedPointerToGongStructField ¶
func (stage *StageStruct) IsStagedPointerToGongStructField(pointertogongstructfield *PointerToGongStructField) (ok bool)
func (*StageStruct) IsStagedSliceOfPointerToGongStructField ¶
func (stage *StageStruct) IsStagedSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField) (ok bool)
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
func (*StageStruct) StageBranchGongBasicField ¶
func (stage *StageStruct) StageBranchGongBasicField(gongbasicfield *GongBasicField)
insertion point for stage branch per struct
func (*StageStruct) StageBranchGongEnum ¶
func (stage *StageStruct) StageBranchGongEnum(gongenum *GongEnum)
func (*StageStruct) StageBranchGongEnumValue ¶
func (stage *StageStruct) StageBranchGongEnumValue(gongenumvalue *GongEnumValue)
func (*StageStruct) StageBranchGongLink ¶
func (stage *StageStruct) StageBranchGongLink(gonglink *GongLink)
func (*StageStruct) StageBranchGongNote ¶
func (stage *StageStruct) StageBranchGongNote(gongnote *GongNote)
func (*StageStruct) StageBranchGongStruct ¶
func (stage *StageStruct) StageBranchGongStruct(gongstruct *GongStruct)
func (*StageStruct) StageBranchGongTimeField ¶
func (stage *StageStruct) StageBranchGongTimeField(gongtimefield *GongTimeField)
func (*StageStruct) StageBranchMeta ¶
func (stage *StageStruct) StageBranchMeta(meta *Meta)
func (*StageStruct) StageBranchMetaReference ¶
func (stage *StageStruct) StageBranchMetaReference(metareference *MetaReference)
func (*StageStruct) StageBranchModelPkg ¶
func (stage *StageStruct) StageBranchModelPkg(modelpkg *ModelPkg)
func (*StageStruct) StageBranchPointerToGongStructField ¶
func (stage *StageStruct) StageBranchPointerToGongStructField(pointertogongstructfield *PointerToGongStructField)
func (*StageStruct) StageBranchSliceOfPointerToGongStructField ¶
func (stage *StageStruct) StageBranchSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField)
func (*StageStruct) Unstage ¶
func (stage *StageStruct) Unstage()
func (*StageStruct) UnstageBranchGongBasicField ¶
func (stage *StageStruct) UnstageBranchGongBasicField(gongbasicfield *GongBasicField)
insertion point for unstage branch per struct
func (*StageStruct) UnstageBranchGongEnum ¶
func (stage *StageStruct) UnstageBranchGongEnum(gongenum *GongEnum)
func (*StageStruct) UnstageBranchGongEnumValue ¶
func (stage *StageStruct) UnstageBranchGongEnumValue(gongenumvalue *GongEnumValue)
func (*StageStruct) UnstageBranchGongLink ¶
func (stage *StageStruct) UnstageBranchGongLink(gonglink *GongLink)
func (*StageStruct) UnstageBranchGongNote ¶
func (stage *StageStruct) UnstageBranchGongNote(gongnote *GongNote)
func (*StageStruct) UnstageBranchGongStruct ¶
func (stage *StageStruct) UnstageBranchGongStruct(gongstruct *GongStruct)
func (*StageStruct) UnstageBranchGongTimeField ¶
func (stage *StageStruct) UnstageBranchGongTimeField(gongtimefield *GongTimeField)
func (*StageStruct) UnstageBranchMeta ¶
func (stage *StageStruct) UnstageBranchMeta(meta *Meta)
func (*StageStruct) UnstageBranchMetaReference ¶
func (stage *StageStruct) UnstageBranchMetaReference(metareference *MetaReference)
func (*StageStruct) UnstageBranchModelPkg ¶
func (stage *StageStruct) UnstageBranchModelPkg(modelpkg *ModelPkg)
func (*StageStruct) UnstageBranchPointerToGongStructField ¶
func (stage *StageStruct) UnstageBranchPointerToGongStructField(pointertogongstructfield *PointerToGongStructField)
func (*StageStruct) UnstageBranchSliceOfPointerToGongStructField ¶
func (stage *StageStruct) UnstageBranchSliceOfPointerToGongStructField(sliceofpointertogongstructfield *SliceOfPointerToGongStructField)
Source Files ¶
- check_function_signature.go
- code_generator.go
- compute_package_path_from_go_mod.go
- compute_pkg_name.go
- docs.go
- extract_width_number.go
- field_interface.go
- file_interface.go
- generate_field_parser.go
- generate_notes.go
- generated_models_files.go
- global_variables.go
- gong.go
- gong_ast.go
- gong_basic_field.go
- gong_callbacks.go
- gong_enum.go
- gong_enum_.go
- gong_enum_value.go
- gong_graph.go
- gong_link.go
- gong_marshall.go
- gong_note.go
- gong_orchestrator.go
- gong_serialize.go
- gong_slices.go
- gong_struct.go
- gong_time_field.go
- gong_wop.go
- inspect_meta.go
- is_named_struct.go
- meta.go
- meta_reference.go
- model_pkg.go
- pointer_to_gong_struct_field.go
- prime_number_generator.go
- replace.go
- slice_of_pointer_to_gong_struct_field.go
- utils.go
- walk.go
- walk_parser.go