Documentation
¶
Overview ¶
Default generated models package docs (at least one file is necessary in a models package)
generated boilerplate code edit the file for adding other stages
since the boilerplate stager.go import split which import tree
there can be no tree stager
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
generated code - do not edit
generated code - do not edit
generated code - do not edit
generated code - do not edit
Index ¶
- Constants
- func AfterCreateFromFront[Type Gongstruct](stage *Stage, instance *Type)
- func AfterDeleteFromFront[Type Gongstruct](stage *Stage, staged, front *Type)
- func AfterReadFromFront[Type Gongstruct](stage *Stage, instance *Type)
- func CompareGongstructByName[T PointerToGongstruct](a, b T) int
- func CopyBranch[Type Gongstruct](from *Type) (to *Type)
- func Diff[T1, T2 PointerToGongstruct](stage *Stage, a, b T1, fieldName string, oldSlice, newSlice []T2) (ops string)
- func ExtractMiddleUint(input string) (uint, error)
- func GenerateReproducibleUUIDv4(seedStr string, seedInt uint64) string
- func GetAssociationName[Type Gongstruct]() *Type
- func GetGongstrucsSorted[T PointerToGongstruct](stage *Stage) (sortedSlice []T)
- func GetGongstructInstancesMap[Type Gongstruct](stage *Stage) *map[string]*Type
- func GetGongstructInstancesSet[Type Gongstruct](stage *Stage) *map[*Type]struct{}
- func GetGongstructInstancesSetFromPointerType[Type PointerToGongstruct](stage *Stage) *map[Type]struct{}
- func GetGongstructNameFromPointer(instance GongstructIF) (res string)
- func GetNamedStructInstances[T PointerToGongstruct](set map[T]struct{}, order map[T]uint) (res []string)
- func GetOrder[Type Gongstruct](stage *Stage, instance *Type) uint
- func GetOrderPointerGongstruct[Type PointerToGongstruct](stage *Stage, instance Type) uint
- func GetPointerReverseMap[Start, End Gongstruct](fieldname string, stage *Stage) map[*End][]*Start
- func GetPointerToGongstructName[Type GongstructIF]() (res string)
- func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string, stage *Stage) map[*End][]*Start
- func GetStructInstancesByOrder[T PointerToGongstruct](set map[T]struct{}, order map[T]uint) (res []T)
- func GetStructInstancesByOrderAuto[T PointerToGongstruct](stage *Stage) (res []T)
- func GongCleanPointer[T PointerToGongstruct](stage *Stage, element *T) (modified bool)
- func GongCleanSlice[T PointerToGongstruct](stage *Stage, slice *[]T) (modified bool)
- func GongExtractBool(expr ast.Expr) bool
- func GongExtractExpr(expr ast.Expr) any
- func GongExtractFloat(expr ast.Expr) float64
- func GongExtractInt(expr ast.Expr) int
- func GongExtractString(expr ast.Expr) string
- func GongGetMap[Type GongstructIF](stage *Stage) map[string]Type
- func GongGetSet[Type GongstructSet](stage *Stage) *Type
- func GongParseAstString(stage *Stage, blob string, preserveOrder bool) error
- func GongUnmarshallEnum[T interface{ ... }](ptr T, valueExpr ast.Expr)
- func GongUnmarshallPointer[T PointerToGongstruct](ptr *T, valueExpr ast.Expr, identifierMap map[string]GongstructIF)
- func GongUnmarshallSliceOfPointers[T PointerToGongstruct](slice *[]T, valueExpr ast.Expr, identifierMap map[string]GongstructIF) (err error)
- func IntToLetters(number int32) (letters string)
- func IsStaged[Type Gongstruct](stage *Stage, instance *Type) (ok bool)
- func IsStagedPointerToGongstruct[Type PointerToGongstruct](stage *Stage, instance Type) (ok bool)
- func OnAfterUpdateFromFront[Type Gongstruct](stage *Stage, old, new *Type)
- func ParseAstEmbeddedFile(stage *Stage, directory embed.FS, pathToFile string) error
- func ParseAstFile(stage *Stage, pathToFile string, preserveOrder bool) error
- func ParseAstFileFromAst(stage *Stage, inFile *ast.File, fset *token.FileSet, preserveOrder bool) error
- func SerializeExcelizePointerToGongstruct[Type PointerToGongstruct](stage *Stage, f *excelize.File)
- func SerializeExcelizePointerToGongstruct2[Type PointerToGongstruct](stage *Stage, f *excelize.File, addIDs bool)
- func SerializeStage(stage *Stage, filename string)
- func SerializeStage2(stage *Stage, filename string, addIDs bool)
- func SetCallbackAfterCreateFromFront[Type Gongstruct](stage *Stage, callback OnAfterCreateInterface[Type])
- func SetCallbackAfterDeleteFromFront[Type Gongstruct](stage *Stage, callback OnAfterDeleteInterface[Type])
- func SetCallbackAfterReadFromFront[Type Gongstruct](stage *Stage, callback OnAfterReadInterface[Type])
- func SetCallbackAfterUpdateFromFront[Type Gongstruct](stage *Stage, callback OnAfterUpdateInterface[Type])
- func SetFieldStringValueFromPointer(instance GongstructIF, fieldName string, value GongFieldValue, stage *Stage) error
- func SetOrchestratorOnAfterUpdate[Type Gongstruct](stage *Stage)
- func SortGongstructSetByName[T PointerToGongstruct](set map[T]struct{}) (sortedSlice []T)
- func StageBranch[Type Gongstruct](stage *Stage, instance *Type)
- func ToRawStringLiteral(s string) string
- func UnstageBranch[Type Gongstruct](stage *Stage, instance *Type)
- type AllModelsStructCreateInterface
- type AllModelsStructDeleteInterface
- type BackRepoInterface
- type Button
- func (button *Button) Checkout(stage *Stage) *Button
- func (button *Button) Commit(stage *Stage) *Button
- func (button *Button) CommitVoid(stage *Stage)
- func (from *Button) CopyBasicFields(to *Button)
- func (button *Button) GetName() (res string)
- func (button *Button) GongClean(stage *Stage) (modified bool)
- func (button *Button) GongCopy() GongstructIF
- func (button *Button) GongDiff(stage *Stage, buttonOther *Button) (diffs []string)
- func (button *Button) GongGetFieldHeaders() (res []GongFieldHeader)
- func (button *Button) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
- func (button *Button) GongGetGongstructName() string
- func (button *Button) GongGetIdentifier(stage *Stage) string
- func (button *Button) GongGetOrder(stage *Stage) uint
- func (button *Button) GongGetReferenceIdentifier(stage *Stage) string
- func (inst *Button) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
- func (inst *Button) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
- func (button *Button) GongGetUUID(stage *Stage) (uuid string)
- func (button *Button) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)
- func (button *Button) GongMarshallField(stage *Stage, fieldName string) (res string)
- func (button *Button) GongMarshallIdentifier(stage *Stage) (decl string)
- func (button *Button) GongMarshallUnstaging(stage *Stage) (decl string)
- func (reference *Button) GongReconstructPointersFromInstances(stage *Stage)
- func (reference *Button) GongReconstructPointersFromReferences(stage *Stage, instance *Button)
- func (button *Button) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
- func (button *Button) OnAfterUpdate(stage *Stage, _, frontButton *Button)
- func (button *Button) SetName(name string)
- func (button *Button) Stage(stage *Stage) *Button
- func (button *Button) StagePreserveOrder(stage *Stage, order uint)
- func (button *Button) StageVoid(stage *Stage)
- func (button *Button) Unstage(stage *Stage) *Button
- func (button *Button) UnstageVoid(stage *Stage)
- type ButtonImplInterface
- type ButtonOrchestrator
- type ButtonProxy
- type ButtonUnmarshaller
- type ButtonUpdatedFunc
- type Button_WOP
- type ExcelizeTabulator
- type FontStyleEnum
- func (fontstyleenum FontStyleEnum) CodeValues() (res []string)
- func (fontstyleenum FontStyleEnum) Codes() (res []string)
- func (fontstyleenum *FontStyleEnum) FromCodeString(input string) (err error)
- func (fontstyleenum *FontStyleEnum) FromString(input string) (err error)
- func (fontstyleenum *FontStyleEnum) ToCodeString() (res string)
- func (fontstyleenum FontStyleEnum) ToString() (res string)
- type FunctionalButtonProxy
- type FunctionalNodeProxy
- type GONG__ExpressionType
- type GONG__Identifier
- type GongFieldHeader
- type GongFieldValue
- type GongFieldValueType
- type GongMarshallingMode
- type GongNodeIF
- type GongStructInterface
- type Gong__MouseEvent
- type Gongstruct
- type GongstructEnumIntField
- type GongstructEnumStringField
- type GongstructIF
- type GongstructMapString
- type GongstructSet
- type GongtructBasicField
- type ModelUnmarshaller
- type NamedStruct
- type Node
- func (node *Node) Checkout(stage *Stage) *Node
- func (node *Node) Commit(stage *Stage) *Node
- func (node *Node) CommitVoid(stage *Stage)
- func (from *Node) CopyBasicFields(to *Node)
- func (node *Node) GetName() (res string)
- func (node *Node) GongClean(stage *Stage) (modified bool)
- func (node *Node) GongCopy() GongstructIF
- func (node *Node) GongDiff(stage *Stage, nodeOther *Node) (diffs []string)
- func (node *Node) GongGetFieldHeaders() (res []GongFieldHeader)
- func (node *Node) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
- func (node *Node) GongGetGongstructName() string
- func (node *Node) GongGetIdentifier(stage *Stage) string
- func (node *Node) GongGetOrder(stage *Stage) uint
- func (node *Node) GongGetReferenceIdentifier(stage *Stage) string
- func (inst *Node) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
- func (inst *Node) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
- func (node *Node) GongGetUUID(stage *Stage) (uuid string)
- func (node *Node) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)
- func (node *Node) GongMarshallField(stage *Stage, fieldName string) (res string)
- func (node *Node) GongMarshallIdentifier(stage *Stage) (decl string)
- func (node *Node) GongMarshallUnstaging(stage *Stage) (decl string)
- func (reference *Node) GongReconstructPointersFromInstances(stage *Stage)
- func (reference *Node) GongReconstructPointersFromReferences(stage *Stage, instance *Node)
- func (node *Node) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
- func (node *Node) OnAfterUpdate(stage *Stage, _, frontNode *Node)
- func (node *Node) SetName(name string)
- func (node *Node) Stage(stage *Stage) *Node
- func (node *Node) StagePreserveOrder(stage *Stage, order uint)
- func (node *Node) StageVoid(stage *Stage)
- func (node *Node) Unstage(stage *Stage) *Node
- func (node *Node) UnstageVoid(stage *Stage)
- type NodeImplInterface
- type NodeOnAfterUpdateFunc
- type NodeOrchestrator
- type NodeUnmarshaller
- type Node_WOP
- type OnAfterCreateInterface
- type OnAfterDeleteInterface
- type OnAfterReadInterface
- type OnAfterUpdateInterface
- type OnInitCommitInterface
- type PointerToGongstruct
- type PointerToGongstructEnumIntField
- type PointerToGongstructEnumStringField
- type ProbeIF
- type ReverseField
- type SVGIcon
- func (svgicon *SVGIcon) Checkout(stage *Stage) *SVGIcon
- func (svgicon *SVGIcon) Commit(stage *Stage) *SVGIcon
- func (svgicon *SVGIcon) CommitVoid(stage *Stage)
- func (from *SVGIcon) CopyBasicFields(to *SVGIcon)
- func (svgicon *SVGIcon) GetName() (res string)
- func (svgicon *SVGIcon) GongClean(stage *Stage) (modified bool)
- func (svgicon *SVGIcon) GongCopy() GongstructIF
- func (svgicon *SVGIcon) GongDiff(stage *Stage, svgiconOther *SVGIcon) (diffs []string)
- func (svgicon *SVGIcon) GongGetFieldHeaders() (res []GongFieldHeader)
- func (svgicon *SVGIcon) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
- func (svgicon *SVGIcon) GongGetGongstructName() string
- func (svgicon *SVGIcon) GongGetIdentifier(stage *Stage) string
- func (svgicon *SVGIcon) GongGetOrder(stage *Stage) uint
- func (svgicon *SVGIcon) GongGetReferenceIdentifier(stage *Stage) string
- func (inst *SVGIcon) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
- func (inst *SVGIcon) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
- func (svgicon *SVGIcon) GongGetUUID(stage *Stage) (uuid string)
- func (svgicon *SVGIcon) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)
- func (svgicon *SVGIcon) GongMarshallField(stage *Stage, fieldName string) (res string)
- func (svgicon *SVGIcon) GongMarshallIdentifier(stage *Stage) (decl string)
- func (svgicon *SVGIcon) GongMarshallUnstaging(stage *Stage) (decl string)
- func (reference *SVGIcon) GongReconstructPointersFromInstances(stage *Stage)
- func (reference *SVGIcon) GongReconstructPointersFromReferences(stage *Stage, instance *SVGIcon)
- func (svgicon *SVGIcon) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
- func (svgicon *SVGIcon) SetName(name string)
- func (svgicon *SVGIcon) Stage(stage *Stage) *SVGIcon
- func (svgicon *SVGIcon) StagePreserveOrder(stage *Stage, order uint)
- func (svgicon *SVGIcon) StageVoid(stage *Stage)
- func (svgicon *SVGIcon) Unstage(stage *Stage) *SVGIcon
- func (svgicon *SVGIcon) UnstageVoid(stage *Stage)
- type SVGIconUnmarshaller
- type SVGIcon_WOP
- type Stage
- func (stage *Stage) ApplyBackwardCommit() error
- func (stage *Stage) ApplyForwardCommit() error
- func (stage *Stage) Backup(dirPath string)
- func (stage *Stage) BackupXL(dirPath string)
- func (stage *Stage) Checkout()
- func (stage *Stage) Clean() (modified bool)
- func (stage *Stage) Commit()
- func (stage *Stage) CommitWithSuspendedCallbacks()
- func (stage *Stage) ComputeForwardAndBackwardCommits()
- func (stage *Stage) ComputeInstancesNb()
- func (stage *Stage) ComputeReferenceAndOrders()
- func (stage *Stage) ComputeReverseMaps()
- func (stage *Stage) GetBackwardCommits() []string
- func (stage *Stage) GetCommitsBehind() int
- func (stage *Stage) GetDigramsEmbededDir() embed.FS
- func (stage *Stage) GetForwardCommits() []string
- func (s *Stage) GetGongMarshallingMode() GongMarshallingMode
- func (stage *Stage) GetInstances() (res []GongstructIF)
- func (s *Stage) GetIsWithGenesisCommit() bool
- func (stage *Stage) GetMap_GongStructName_InstancesNb() map[string]int
- func (stage *Stage) GetModelsEmbededDir() embed.FS
- func (stage *Stage) GetName() string
- func (stage *Stage) GetNamedStructNamesByOrder(namedStructName string) (res []string)
- func (stage *Stage) GetNamedStructsNames() (res []string)
- func (stage *Stage) GetProbeFormStageName() string
- func (stage *Stage) GetProbeIF() ProbeIF
- func (stage *Stage) GetProbeNavigationTreeSidebarStageName() string
- func (stage *Stage) GetProbeNotificationTableStageName() string
- func (stage *Stage) GetProbeSplitStageName() string
- func (stage *Stage) GetProbeTableStageName() string
- func (stage *Stage) GetProbeTreeSidebarStageName() string
- func (stage *Stage) GetType() string
- func (stage *Stage) IsInDeltaMode() bool
- func (stage *Stage) IsStagedButton(button *Button) (ok bool)
- func (stage *Stage) IsStagedNode(node *Node) (ok bool)
- func (stage *Stage) IsStagedSVGIcon(svgicon *SVGIcon) (ok bool)
- func (stage *Stage) IsStagedTree(tree *Tree) (ok bool)
- func (stage *Stage) Lock()
- func (stage *Stage) Marshall(file *os.File, modelsPackageName, packageName string)
- func (stage *Stage) MarshallFile(filename, modelsPackageName, packageName string)
- func (stage *Stage) MarshallToString(modelsPackageName, packageName string) (res string, err error)
- func (stage *Stage) Nil()
- func (stage *Stage) RLock()
- func (stage *Stage) RUnlock()
- func (s *Stage) RegisterAfterCommit(hook func(stage *Stage))
- func (s *Stage) RegisterBeforeCommit(hook func(stage *Stage))
- func (stage *Stage) Reset()
- func (stage *Stage) ResetHard()
- func (stage *Stage) ResetMapStrings()
- func (stage *Stage) Restore(dirPath string)
- func (stage *Stage) RestoreXL(dirPath string)
- func (stage *Stage) SetDeltaMode(inDeltaMode bool)
- func (s *Stage) SetGongMarshallingMode(mode GongMarshallingMode)
- func (s *Stage) SetIsWithGenesisCommit(isWithGenesisCommit bool)
- func (stage *Stage) SetProbeIF(probeIF ProbeIF)
- func (stage *Stage) Squash()
- func (stage *Stage) StageBranchButton(button *Button)
- func (stage *Stage) StageBranchNode(node *Node)
- func (stage *Stage) StageBranchSVGIcon(svgicon *SVGIcon)
- func (stage *Stage) StageBranchTree(tree *Tree)
- func (stage *Stage) Unlock()
- func (stage *Stage) UnmarshallFile(pathToFile string, preserveOrder bool) error
- func (stage *Stage) Unstage()
- func (stage *Stage) UnstageBranchButton(button *Button)
- func (stage *Stage) UnstageBranchNode(node *Node)
- func (stage *Stage) UnstageBranchSVGIcon(svgicon *SVGIcon)
- func (stage *Stage) UnstageBranchTree(tree *Tree)
- type Tabulator
- type Target
- type ToolTipPositionEnum
- func (tooltippositionenum ToolTipPositionEnum) CodeValues() (res []string)
- func (tooltippositionenum ToolTipPositionEnum) Codes() (res []string)
- func (tooltippositionenum *ToolTipPositionEnum) FromCodeString(input string) (err error)
- func (tooltippositionenum *ToolTipPositionEnum) FromString(input string) (err error)
- func (tooltippositionenum *ToolTipPositionEnum) ToCodeString() (res string)
- func (tooltippositionenum ToolTipPositionEnum) ToString() (res string)
- type Tree
- func (tree *Tree) Checkout(stage *Stage) *Tree
- func (tree *Tree) Commit(stage *Stage) *Tree
- func (tree *Tree) CommitVoid(stage *Stage)
- func (from *Tree) CopyBasicFields(to *Tree)
- func (tree *Tree) GetName() (res string)
- func (tree *Tree) GongClean(stage *Stage) (modified bool)
- func (tree *Tree) GongCopy() GongstructIF
- func (tree *Tree) GongDiff(stage *Stage, treeOther *Tree) (diffs []string)
- func (tree *Tree) GongGetFieldHeaders() (res []GongFieldHeader)
- func (tree *Tree) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
- func (tree *Tree) GongGetGongstructName() string
- func (tree *Tree) GongGetIdentifier(stage *Stage) string
- func (tree *Tree) GongGetOrder(stage *Stage) uint
- func (tree *Tree) GongGetReferenceIdentifier(stage *Stage) string
- func (inst *Tree) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
- func (inst *Tree) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
- func (tree *Tree) GongGetUUID(stage *Stage) (uuid string)
- func (tree *Tree) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)
- func (tree *Tree) GongMarshallField(stage *Stage, fieldName string) (res string)
- func (tree *Tree) GongMarshallIdentifier(stage *Stage) (decl string)
- func (tree *Tree) GongMarshallUnstaging(stage *Stage) (decl string)
- func (reference *Tree) GongReconstructPointersFromInstances(stage *Stage)
- func (reference *Tree) GongReconstructPointersFromReferences(stage *Stage, instance *Tree)
- func (tree *Tree) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
- func (tree *Tree) SetName(name string)
- func (tree *Tree) Stage(stage *Stage) *Tree
- func (tree *Tree) StagePreserveOrder(stage *Stage, order uint)
- func (tree *Tree) StageVoid(stage *Stage)
- func (tree *Tree) Unstage(stage *Stage) *Tree
- func (tree *Tree) UnstageVoid(stage *Stage)
- type TreeStackName
- func (treestackname TreeStackName) CodeValues() (res []string)
- func (treestackname TreeStackName) Codes() (res []string)
- func (treestackname *TreeStackName) FromCodeString(input string) (err error)
- func (treestackname *TreeStackName) FromString(input string) (err error)
- func (treestackname *TreeStackName) ToCodeString() (res string)
- func (treestackname TreeStackName) ToString() (res string)
- type TreeUnmarshaller
- type Tree_WOP
Constants ¶
const ( ProbeTreeSidebarSuffix = ":sidebar of the probe" ProbeTableSuffix = ":table of the probe" ProbeNotificationTableSuffix = ":notification table of the probe" ProbeFormSuffix = ":form of the probe" ProbeSplitSuffix = ":probe of the probe" )
const ( // it is possible to go apply the nbCommitsBackward forward commits GongNavigationModeNavigating gongStageNavigationMode = "Navigating" )
const GongIdentifiersDecls = `
{{Identifier}} := (&models.{{GeneratedStructName}}{Name: {{GeneratedFieldNameValue}}}).Stage(stage)`
const GongUnstageStmt = `
{{Identifier}}.Unstage(stage)`
const IdentifiersDeclsWithoutNameInit = `
{{Identifier}} := (&models.{{GeneratedStructName}}{}).Stage(stage)`
previous version does not hanldle embedded structs (https://github.com/golang/go/issues/9859) simpler version but the name of the instance cannot be human read before the fields initialization
const MetaFieldStructInitStatement = `
{{Identifier}}.{{GeneratedFieldName}} = ` + `{{GeneratedFieldNameValue}}`
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 *Stage, instance *Type)
AfterCreateFromFront is called after a create from front
func AfterDeleteFromFront ¶
func AfterDeleteFromFront[Type Gongstruct](stage *Stage, staged, front *Type)
AfterDeleteFromFront is called after a delete from front
func AfterReadFromFront ¶
func AfterReadFromFront[Type Gongstruct](stage *Stage, instance *Type)
AfterReadFromFront is called after a Read from front
func CompareGongstructByName ¶
func CompareGongstructByName[T PointerToGongstruct](a, b T) int
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 Diff ¶
func Diff[T1, T2 PointerToGongstruct](stage *Stage, a, b T1, fieldName string, oldSlice, newSlice []T2) (ops string)
Diff returns the sequence of operations to transform oldSlice into newSlice. It requires type T to be comparable (e.g., pointers, ints, strings).
func ExtractMiddleUint ¶
ExtractMiddleUint takes a formatted string and returns the extracted integer.
func GenerateReproducibleUUIDv4 ¶
GenerateReproducibleUUIDv4 creates a deterministic UUIDv4 based on a string and a positive integer.
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 GetGongstrucsSorted ¶
func GetGongstrucsSorted[T PointerToGongstruct](stage *Stage) (sortedSlice []T)
func GetGongstructInstancesMap ¶
func GetGongstructInstancesMap[Type Gongstruct](stage *Stage) *map[string]*Type
GetGongstructInstancesMap returns the map of staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier
func GetGongstructInstancesSet ¶
func GetGongstructInstancesSet[Type Gongstruct](stage *Stage) *map[*Type]struct{}
GetGongstructInstancesSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier
func GetGongstructInstancesSetFromPointerType ¶
func GetGongstructInstancesSetFromPointerType[Type PointerToGongstruct](stage *Stage) *map[Type]struct{}
GetGongstructInstancesSetFromPointerType returns the set staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier
func GetGongstructNameFromPointer ¶
func GetGongstructNameFromPointer(instance GongstructIF) (res string)
func GetNamedStructInstances ¶
func GetNamedStructInstances[T PointerToGongstruct](set map[T]struct{}, order map[T]uint) (res []string)
func GetOrder ¶
func GetOrder[Type Gongstruct](stage *Stage, instance *Type) uint
func GetOrderPointerGongstruct ¶
func GetOrderPointerGongstruct[Type PointerToGongstruct](stage *Stage, instance Type) uint
func GetPointerReverseMap ¶
func GetPointerReverseMap[Start, End Gongstruct](fieldname string, stage *Stage) 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 GongstructIF]() (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 *Stage) 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 GetStructInstancesByOrder ¶
func GetStructInstancesByOrder[T PointerToGongstruct](set map[T]struct{}, order map[T]uint) (res []T)
func GetStructInstancesByOrderAuto ¶
func GetStructInstancesByOrderAuto[T PointerToGongstruct](stage *Stage) (res []T)
GetStructInstancesByOrderAuto returns a slice of generic pointers to gongstructs ordered by their order in the stage.
func GongCleanPointer ¶
func GongCleanPointer[T PointerToGongstruct](stage *Stage, element *T) (modified bool)
GongCleanPointer sets the pointer to nil if the referenced element is not staged. T must be a pointer to a struct that implements PointerToGongstruct.
func GongCleanSlice ¶
func GongCleanSlice[T PointerToGongstruct](stage *Stage, slice *[]T) (modified bool)
GongCleanSlice removes unstaged elements from a slice of pointers of type T. T must be a pointer to a struct that implements PointerToGongstruct.
func GongExtractBool ¶
func GongExtractExpr ¶
func GongExtractFloat ¶
func GongExtractInt ¶
func GongExtractString ¶
func GongGetMap ¶
func GongGetMap[Type GongstructIF](stage *Stage) map[string]Type
GongGetMap returns the map of staged Gonstruct instance by their name Can be usefull if names are unique
func GongGetSet ¶
func GongGetSet[Type GongstructSet](stage *Stage) *Type
GongGetSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier
func GongParseAstString ¶
GongParseAstString parses the Go source code from a string
func GongUnmarshallEnum ¶
GongUnmarshallEnum handles assignment of enum fields (via SelectorExpr or String fallback)
func GongUnmarshallPointer ¶
func GongUnmarshallPointer[T PointerToGongstruct]( ptr *T, valueExpr ast.Expr, identifierMap map[string]GongstructIF)
GongUnmarshallPointer handles assignment of a single pointer field
func GongUnmarshallSliceOfPointers ¶
func GongUnmarshallSliceOfPointers[T PointerToGongstruct]( slice *[]T, valueExpr ast.Expr, identifierMap map[string]GongstructIF) (err error)
GongUnmarshallSliceOfPointers handles append, slices.Delete, and slices.Insert for slice fields
func IntToLetters ¶
func IsStaged ¶
func IsStaged[Type Gongstruct](stage *Stage, instance *Type) (ok bool)
func IsStagedPointerToGongstruct ¶
func IsStagedPointerToGongstruct[Type PointerToGongstruct](stage *Stage, instance Type) (ok bool)
func OnAfterUpdateFromFront ¶
func OnAfterUpdateFromFront[Type Gongstruct](stage *Stage, old, new *Type)
OnAfterUpdateFromFront is called after a update from front
func ParseAstEmbeddedFile ¶
ParseAstEmbeddedFile parses the Go source code from an embedded file
func ParseAstFile ¶
ParseAstFile Parse pathToFile and stages all instances declared in the file
func ParseAstFileFromAst ¶
func ParseAstFileFromAst(stage *Stage, inFile *ast.File, fset *token.FileSet, preserveOrder bool) error
ParseAstFileFromAst traverses the AST and stages instances using the Unmarshaller registry
func SerializeExcelizePointerToGongstruct ¶
func SerializeExcelizePointerToGongstruct[Type PointerToGongstruct](stage *Stage, f *excelize.File)
func SerializeExcelizePointerToGongstruct2 ¶
func SerializeExcelizePointerToGongstruct2[Type PointerToGongstruct](stage *Stage, f *excelize.File, addIDs bool)
func SerializeStage ¶
func SerializeStage2 ¶
func SetCallbackAfterCreateFromFront ¶
func SetCallbackAfterCreateFromFront[Type Gongstruct](stage *Stage, callback OnAfterCreateInterface[Type])
func SetCallbackAfterDeleteFromFront ¶
func SetCallbackAfterDeleteFromFront[Type Gongstruct](stage *Stage, callback OnAfterDeleteInterface[Type])
func SetCallbackAfterReadFromFront ¶
func SetCallbackAfterReadFromFront[Type Gongstruct](stage *Stage, callback OnAfterReadInterface[Type])
func SetCallbackAfterUpdateFromFront ¶
func SetCallbackAfterUpdateFromFront[Type Gongstruct](stage *Stage, callback OnAfterUpdateInterface[Type])
SetCallbackAfterUpdateFromFront is a function to set up callback that is robust to refactoring
func SetFieldStringValueFromPointer ¶
func SetFieldStringValueFromPointer(instance GongstructIF, fieldName string, value GongFieldValue, stage *Stage) error
func SetOrchestratorOnAfterUpdate ¶
func SetOrchestratorOnAfterUpdate[Type Gongstruct](stage *Stage)
func SortGongstructSetByName ¶
func SortGongstructSetByName[T PointerToGongstruct](set map[T]struct{}) (sortedSlice []T)
func StageBranch ¶
func StageBranch[Type Gongstruct](stage *Stage, 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 ToRawStringLiteral ¶
ToRawStringLiteral formats a string into safe Go source code, using backticks to preserve newlines and readability.
func UnstageBranch ¶
func UnstageBranch[Type Gongstruct](stage *Stage, 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
Types ¶
type AllModelsStructCreateInterface ¶
type AllModelsStructCreateInterface interface {
CreateORMButton(Button *Button)
CreateORMNode(Node *Node)
CreateORMSVGIcon(SVGIcon *SVGIcon)
CreateORMTree(Tree *Tree)
}
swagger:ignore
type BackRepoInterface ¶
type BackRepoInterface interface {
Commit(stage *Stage)
Checkout(stage *Stage)
Backup(stage *Stage, dirPath string)
Restore(stage *Stage, dirPath string)
BackupXL(stage *Stage, dirPath string)
RestoreXL(stage *Stage, dirPath string)
// insertion point for Commit and Checkout signatures
CommitButton(button *Button)
CheckoutButton(button *Button)
CommitNode(node *Node)
CheckoutNode(node *Node)
CommitSVGIcon(svgicon *SVGIcon)
CheckoutSVGIcon(svgicon *SVGIcon)
CommitTree(tree *Tree)
CheckoutTree(tree *Tree)
GetLastCommitFromBackNb() uint
GetLastPushFromFrontNb() uint
}
type Button ¶
type Button struct {
Name string // used for indentfication of click
Icon string // material angular icon
// SVG Icon, overides the angular materal icon
SVGIcon *SVGIcon
// Deprecated
Impl ButtonImplInterface
OnUpdate func(stage *Stage, updatedButton *Button)
IsDisabled bool
HasToolTip bool
ToolTipText string
ToolTipPosition ToolTipPositionEnum
}
func CopyBranchButton ¶
insertion point for stage branch per struct
func (*Button) CommitVoid ¶
func (*Button) CopyBasicFields ¶
func (*Button) GongClean ¶
insertion point per named struct Clean garbage collect unstaged instances that are referenced by Button
func (*Button) GongCopy ¶
func (button *Button) GongCopy() GongstructIF
insertion point per named struct
func (*Button) GongDiff ¶
insertion point for diff per struct GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings
func (*Button) GongGetFieldHeaders ¶
func (button *Button) GongGetFieldHeaders() (res []GongFieldHeader)
insertion point for get fields header method
func (*Button) GongGetFieldValue ¶
func (button *Button) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
insertion point for generic get gongstruct field value
func (*Button) GongGetGongstructName ¶
insertion point for generic get gongstruct name
func (*Button) GongGetIdentifier ¶
GongGetIdentifier returns a unique identifier of the instance in the staging area This identifier is composed of the Gongstruct name and the order of the instance in the staging area It is used to identify instances across sessions insertion point per named struct
func (*Button) GongGetOrder ¶
GongGetOrder returns the order of the instance in the staging area This order is set at staging time, and reflects the order of creation of the instances in the staging area It is used when rendering slices of GongstructIF to keep a deterministic order which is important for frontends such as web frontends to avoid unnecessary re-renderings insertion point per named struct
func (*Button) GongGetReferenceIdentifier ¶
GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)
func (*Button) GongGetReverseFieldOwner ¶
func (inst *Button) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
insertion point
func (*Button) GongGetReverseFieldOwnerName ¶
func (inst *Button) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
insertion point
func (*Button) GongGetUUID ¶
insertion point per named struct
func (*Button) GongMarshallAllFields ¶
insertion point for marshall all fields methods
func (*Button) GongMarshallField ¶
insertion point for marshall field methods
func (*Button) GongMarshallIdentifier ¶
MarshallIdentifier returns the code to instantiate the instance in a marshalling file insertion point per named struct
func (*Button) GongMarshallUnstaging ¶
insertion point for unstaging
func (*Button) GongReconstructPointersFromInstances ¶
insertion point for pointer reconstruction from instances
func (*Button) GongReconstructPointersFromReferences ¶
insertion point for pointer reconstruction from references
func (*Button) GongSetFieldValue ¶
func (button *Button) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
insertion point for generic set gongstruct field value
func (*Button) OnAfterUpdate ¶
func (*Button) Stage ¶
insertion point for cumulative sub template with model space calls Stage puts button to the model stage
func (*Button) StagePreserveOrder ¶
StagePreserveOrder puts button to the model stage, and if the astrtuct was not staged before:
- force the order if the order is equal or greater than the stage.ButtonOrder - update stage.ButtonOrder accordingly
func (*Button) UnstageVoid ¶
UnstageVoid removes button off the model stage
type ButtonImplInterface ¶
type ButtonOrchestrator ¶
type ButtonOrchestrator struct {
}
insertion point ButtonOrchestrator
func (*ButtonOrchestrator) OnAfterUpdate ¶
func (orchestrator *ButtonOrchestrator) OnAfterUpdate( gongsvgStage *Stage, stagedButton, backRepoButton *Button)
type ButtonProxy ¶
type ButtonProxy struct {
Value *bool
// contains filtered or unexported fields
}
ButtonProxy is a generic proxy for both int and float64
func NewButtonProxy ¶
func NewButtonProxy( button *Button, target Target, ) *ButtonProxy
NewButtonProxy creates a new proxy for a button
func (*ButtonProxy) ButtonUpdated ¶
func (proxy *ButtonProxy) ButtonUpdated(*Stage, *Button, *Button)
Updated handles updating values when the button changes
type ButtonUnmarshaller ¶
type ButtonUnmarshaller struct{}
insertion point per named struct
func (*ButtonUnmarshaller) Initialize ¶
func (u *ButtonUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)
func (*ButtonUnmarshaller) UnmarshallField ¶
func (u *ButtonUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error
type ButtonUpdatedFunc ¶
If you want to avoid cluttering your package with many tiny struct definitions (like AddProductButtonNodeProxy), you can define one generic adapter struct that delegates logic to a function.
This allows you to write the logic "anonymously" (inline) using a closure.
addButton := &tree.Button{
Name: "Product" + " " + string(buttons.BUTTON_add),
Icon: string(buttons.BUTTON_add),
}
node.Buttons = append(node.Buttons, addButton)
// Use the generic proxy and define logic inline
addButton.Impl = &FunctionalButtonProxy{
OnUpdated: func(stage *tree.Stage, button *tree.Button, updatedButton *tree.Button) {
...
},
}
Define a function signature that matches the interface method logic
type Button_WOP ¶
type Button_WOP struct {
Name string
Icon string
IsDisabled bool
HasToolTip bool
ToolTipText string
ToolTipPosition ToolTipPositionEnum
}
insertion point
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 FontStyleEnum ¶
type FontStyleEnum string
const ( NORMAL FontStyleEnum = "NORMAL" ITALIC FontStyleEnum = "ITALIC" )
func (FontStyleEnum) CodeValues ¶
func (fontstyleenum FontStyleEnum) CodeValues() (res []string)
func (FontStyleEnum) Codes ¶
func (fontstyleenum FontStyleEnum) Codes() (res []string)
func (*FontStyleEnum) FromCodeString ¶
func (fontstyleenum *FontStyleEnum) FromCodeString(input string) (err error)
func (*FontStyleEnum) FromString ¶
func (fontstyleenum *FontStyleEnum) FromString(input string) (err error)
func (*FontStyleEnum) ToCodeString ¶
func (fontstyleenum *FontStyleEnum) ToCodeString() (res string)
func (FontStyleEnum) ToString ¶
func (fontstyleenum FontStyleEnum) ToString() (res string)
insertion point of enum utility functions Utility function for FontStyleEnum 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 FunctionalButtonProxy ¶
type FunctionalButtonProxy struct {
OnUpdated ButtonUpdatedFunc
}
Generic Proxy that implements models.ButtonImplInterface
func (*FunctionalButtonProxy) ButtonUpdated ¶
func (p *FunctionalButtonProxy) ButtonUpdated(stage *Stage, button *Button, updatedButton *Button)
Implement the interface method
type FunctionalNodeProxy ¶
type FunctionalNodeProxy struct {
OnUpdate NodeOnAfterUpdateFunc
}
func (*FunctionalNodeProxy) OnAfterUpdate ¶
func (p *FunctionalNodeProxy) OnAfterUpdate(stage *Stage, stagedNode *Node, frontNode *Node)
Implement the interface method
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 GongFieldHeader ¶
type GongFieldHeader struct {
Name string
GongFieldValueType
TargetGongstructName string
}
func GetFieldsFromPointer ¶
func GetFieldsFromPointer[Type PointerToGongstruct]() (res []GongFieldHeader)
GetFieldsFromPointer return the array of the fields
type GongFieldValue ¶
type GongFieldValue struct {
GongFieldValueType
// contains filtered or unexported fields
}
func GetFieldStringValueFromPointer ¶
func GetFieldStringValueFromPointer(instance GongstructIF, fieldName string, stage *Stage) (res GongFieldValue)
func (*GongFieldValue) GetValueBool ¶
func (gongValueField *GongFieldValue) GetValueBool() bool
func (*GongFieldValue) GetValueFloat ¶
func (gongValueField *GongFieldValue) GetValueFloat() float64
func (*GongFieldValue) GetValueInt ¶
func (gongValueField *GongFieldValue) GetValueInt() int
func (*GongFieldValue) GetValueString ¶
func (gongValueField *GongFieldValue) GetValueString() string
type GongFieldValueType ¶
type GongFieldValueType string
const ( GongFieldValueTypeInt GongFieldValueType = "GongFieldValueTypeInt" GongFieldValueTypeIntDuration GongFieldValueType = "GongFieldValueTypeIntDuration" GongFieldValueTypeFloat GongFieldValueType = "GongFieldValueTypeFloat" GongFieldValueTypeBool GongFieldValueType = "GongFieldValueTypeBool" GongFieldValueTypeString GongFieldValueType = "GongFieldValueTypeString" GongFieldValueTypeDate GongFieldValueType = "GongFieldValueTypeDate" GongFieldValueTypeBasicKind GongFieldValueType = "GongFieldValueTypeBasicKind" GongFieldValueTypePointer GongFieldValueType = "GongFieldValueTypePointer" GongFieldValueTypeSliceOfPointers GongFieldValueType = "GongFieldValueTypeSliceOfPointers" )
type GongMarshallingMode ¶
type GongMarshallingMode string
const ( // the whole stage is generated at each marshall. This is the default GongMarshallingNormal GongMarshallingMode = "GongMarshallingNormal" // only the last commit is append to the marshall file GongMarshallingAppendCommit GongMarshallingMode = "GongMarshallingAppendCommit" )
type GongNodeIF ¶
type GongNodeIF interface {
}
type GongStructInterface ¶
type GongStructInterface interface {
GetName() (res string)
// GetID() (res int)
// GetFields() (res []string)
// GetFieldStringValue(fieldName string) (res string)
GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
GongGetGongstructName() string
}
GongStructInterface is the interface met by GongStructs It allows runtime reflexion of instances (without the hassle of the "reflect" package)
type Gong__MouseEvent ¶
type Gong__MouseEvent struct {
ShiftKey bool
}
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 GongstructIF ¶
type GongstructIF interface {
GetName() string
SetName(string)
CommitVoid(*Stage)
StageVoid(*Stage)
UnstageVoid(stage *Stage)
GongGetFieldHeaders() []GongFieldHeader
GongClean(stage *Stage) (modified bool)
GongGetFieldValue(fieldName string, stage *Stage) GongFieldValue
GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
GongGetGongstructName() string
GongGetOrder(stage *Stage) uint
GongGetReferenceIdentifier(stage *Stage) string
GongGetIdentifier(stage *Stage) string
GongCopy() GongstructIF
GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) string
GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) GongstructIF
GongGetUUID(stage *Stage) 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 GongstructMapString ¶
type GongstructSet ¶
type GongtructBasicField ¶
type ModelUnmarshaller ¶
type ModelUnmarshaller interface {
// Initialize creates the struct, stages it, and returns the pointer as 'any'
Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)
// UnmarshallField sets a field's value based on the AST expression
UnmarshallField(stage *Stage, instance GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error
}
ModelUnmarshaller abstracts the logic for setting fields on a staged instance
type NamedStruct ¶
type NamedStruct struct {
// contains filtered or unexported fields
}
func (*NamedStruct) GetName ¶
func (namedStruct *NamedStruct) GetName() string
type Node ¶
type Node struct {
Name string
IsWithPrefix bool
Prefix string
FontStyle FontStyleEnum
// Impl is the pointer to the implementation of the node in the models of interest
// Deprecated, Uses OnUpdate instead
Impl NodeImplInterface
// OnUpdate is a callback called each time a node is modified from the front
OnUpdate func(stage *Stage, stagedNode, frontNode *Node)
// BackgroundColor, if zero value will have the color to default, therwise, the node
// will have this color
BackgroundColor string
IsExpanded bool
// fields related to the selection of the node by a check box
HasCheckboxButton bool
IsChecked bool
IsCheckboxDisabled bool
CheckboxHasToolTip bool
CheckboxToolTipText string
CheckboxToolTipPosition ToolTipPositionEnum
// fields related to the selection of the node by a check box
HasSecondCheckboxButton bool
IsSecondCheckboxChecked bool
IsSecondCheckboxDisabled bool
SecondCheckboxHasToolTip bool
SecondCheckboxToolTipText string
SecondCheckboxToolTipPosition ToolTipPositionEnum
TextAfterSecondCheckbox string
HasToolTip bool
ToolTipText string
ToolTipPosition ToolTipPositionEnum
// in case the user wants to change the name of the node
IsInEditMode bool
// when the user hover on the node, it can click
IsNodeClickable bool
// IsWithPreceedingIcon indicates if the node have an icon preceeding the name
IsWithPreceedingIcon bool
// PreceedingIcon is the angular material name if [models.IsWithPreceedingIcon] is true
PreceedingIcon string
PreceedingSVGIcon *SVGIcon
Children []*Node
Buttons []*Button
}
Node is a node in the tree for selecting items to display Node implements the visual artifacts of a node (the name, the buttons, the checkbocks, ...) The font end read the fields of the node and display the node accordingly
when a user interacts with a node in front, it propagates the action to the back end and it is propagated to the [Impl] implementation. Conversly, the implementation can set the configuration of the node
func (*Node) CommitVoid ¶
func (*Node) CopyBasicFields ¶
func (*Node) GongCopy ¶
func (node *Node) GongCopy() GongstructIF
func (*Node) GongDiff ¶
GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings
func (*Node) GongGetFieldHeaders ¶
func (node *Node) GongGetFieldHeaders() (res []GongFieldHeader)
func (*Node) GongGetFieldValue ¶
func (node *Node) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
func (*Node) GongGetGongstructName ¶
func (*Node) GongGetIdentifier ¶
func (*Node) GongGetOrder ¶
func (*Node) GongGetReferenceIdentifier ¶
GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)
func (*Node) GongGetReverseFieldOwner ¶
func (inst *Node) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
func (*Node) GongGetReverseFieldOwnerName ¶
func (inst *Node) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
func (*Node) GongGetUUID ¶
func (*Node) GongMarshallAllFields ¶
func (*Node) GongMarshallField ¶
func (*Node) GongMarshallIdentifier ¶
func (*Node) GongMarshallUnstaging ¶
func (*Node) GongReconstructPointersFromInstances ¶
func (*Node) GongReconstructPointersFromReferences ¶
func (*Node) GongSetFieldValue ¶
func (node *Node) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
func (*Node) OnAfterUpdate ¶
OnAfterUpdate, notice that node == stagedNode
func (*Node) StagePreserveOrder ¶
StagePreserveOrder puts node to the model stage, and if the astrtuct was not staged before:
- force the order if the order is equal or greater than the stage.NodeOrder - update stage.NodeOrder accordingly
func (*Node) UnstageVoid ¶
UnstageVoid removes node off the model stage
type NodeImplInterface ¶
type NodeOnAfterUpdateFunc ¶
Define a function signature that matches the interface method logic
type NodeOrchestrator ¶
type NodeOrchestrator struct {
}
NodeOrchestrator
func (*NodeOrchestrator) OnAfterUpdate ¶
func (orchestrator *NodeOrchestrator) OnAfterUpdate( gongsvgStage *Stage, stagedNode, backRepoNode *Node)
type NodeUnmarshaller ¶
type NodeUnmarshaller struct{}
func (*NodeUnmarshaller) Initialize ¶
func (u *NodeUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)
func (*NodeUnmarshaller) UnmarshallField ¶
func (u *NodeUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error
type Node_WOP ¶
type Node_WOP struct {
Name string
IsWithPrefix bool
Prefix string
FontStyle FontStyleEnum
BackgroundColor string
IsExpanded bool
HasCheckboxButton bool
IsChecked bool
IsCheckboxDisabled bool
CheckboxHasToolTip bool
CheckboxToolTipText string
CheckboxToolTipPosition ToolTipPositionEnum
HasSecondCheckboxButton bool
IsSecondCheckboxChecked bool
IsSecondCheckboxDisabled bool
SecondCheckboxHasToolTip bool
SecondCheckboxToolTipText string
SecondCheckboxToolTipPosition ToolTipPositionEnum
TextAfterSecondCheckbox string
HasToolTip bool
ToolTipText string
ToolTipPosition ToolTipPositionEnum
IsInEditMode bool
IsNodeClickable bool
IsWithPreceedingIcon bool
PreceedingIcon string
}
type OnAfterCreateInterface ¶
type OnAfterCreateInterface[Type Gongstruct] interface { OnAfterCreate(stage *Stage, instance *Type) }
OnAfterCreateInterface callback when an instance is updated from the front
type OnAfterDeleteInterface ¶
type OnAfterDeleteInterface[Type Gongstruct] interface { OnAfterDelete(stage *Stage, staged, front *Type) }
OnAfterDeleteInterface callback when an instance is updated from the front
type OnAfterReadInterface ¶
type OnAfterReadInterface[Type Gongstruct] interface { OnAfterRead(stage *Stage, instance *Type) }
OnAfterReadInterface callback when an instance is updated from the front
type OnAfterUpdateInterface ¶
type OnAfterUpdateInterface[Type Gongstruct] interface { OnAfterUpdate(stage *Stage, old, new *Type) }
OnAfterUpdateInterface callback when an instance is updated from the front
type OnInitCommitInterface ¶
type OnInitCommitInterface interface {
BeforeCommit(stage *Stage)
}
type PointerToGongstruct ¶
type PointerToGongstruct interface {
GongstructIF
comparable
}
type ProbeIF ¶
type ProbeIF interface {
Refresh()
GetFormStage() *form.Stage
GetDataEditor() *split.AsSplit
GetDiagramEditor() *split.AsSplitArea
FillUpFormFromGongstruct(instance any, formName string)
AddNotification(date time.Time, message string)
CommitNotificationTable()
ResetNotifications()
SetMaxElementsNbPerGongStructNode(nb int)
GetMaxElementsNbPerGongStructNode() int
SetCommitMode(bool)
}
type ReverseField ¶
func GetReverseFields ¶
func GetReverseFields[Type GongstructIF]() (res []ReverseField)
type SVGIcon ¶
SVGIcon allows for the usage of custom icon in nodes / buttons
func CopyBranchSVGIcon ¶
func (*SVGIcon) CommitVoid ¶
func (*SVGIcon) CopyBasicFields ¶
func (*SVGIcon) GongCopy ¶
func (svgicon *SVGIcon) GongCopy() GongstructIF
func (*SVGIcon) GongDiff ¶
GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings
func (*SVGIcon) GongGetFieldHeaders ¶
func (svgicon *SVGIcon) GongGetFieldHeaders() (res []GongFieldHeader)
func (*SVGIcon) GongGetFieldValue ¶
func (svgicon *SVGIcon) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
func (*SVGIcon) GongGetGongstructName ¶
func (*SVGIcon) GongGetIdentifier ¶
func (*SVGIcon) GongGetOrder ¶
func (*SVGIcon) GongGetReferenceIdentifier ¶
GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)
func (*SVGIcon) GongGetReverseFieldOwner ¶
func (inst *SVGIcon) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
func (*SVGIcon) GongGetReverseFieldOwnerName ¶
func (inst *SVGIcon) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
func (*SVGIcon) GongGetUUID ¶
func (*SVGIcon) GongMarshallAllFields ¶
func (*SVGIcon) GongMarshallField ¶
func (*SVGIcon) GongMarshallIdentifier ¶
func (*SVGIcon) GongMarshallUnstaging ¶
func (*SVGIcon) GongReconstructPointersFromInstances ¶
func (*SVGIcon) GongReconstructPointersFromReferences ¶
func (*SVGIcon) GongSetFieldValue ¶
func (svgicon *SVGIcon) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
func (*SVGIcon) StagePreserveOrder ¶
StagePreserveOrder puts svgicon to the model stage, and if the astrtuct was not staged before:
- force the order if the order is equal or greater than the stage.SVGIconOrder - update stage.SVGIconOrder accordingly
func (*SVGIcon) UnstageVoid ¶
UnstageVoid removes svgicon off the model stage
type SVGIconUnmarshaller ¶
type SVGIconUnmarshaller struct{}
func (*SVGIconUnmarshaller) Initialize ¶
func (u *SVGIconUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)
func (*SVGIconUnmarshaller) UnmarshallField ¶
func (u *SVGIconUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error
type SVGIcon_WOP ¶
type Stage ¶
type Stage struct {
// insertion point for definition of arrays registering instances
Buttons map[*Button]struct{}
Buttons_instance map[*Button]*Button
Buttons_mapString map[string]*Button
ButtonOrder uint
Button_stagedOrder map[*Button]uint
Buttons_reference map[*Button]*Button
Buttons_referenceOrder map[*Button]uint
// insertion point for slice of pointers maps
OnAfterButtonCreateCallback OnAfterCreateInterface[Button]
OnAfterButtonUpdateCallback OnAfterUpdateInterface[Button]
OnAfterButtonDeleteCallback OnAfterDeleteInterface[Button]
OnAfterButtonReadCallback OnAfterReadInterface[Button]
Nodes map[*Node]struct{}
Nodes_instance map[*Node]*Node
Nodes_mapString map[string]*Node
NodeOrder uint
Node_stagedOrder map[*Node]uint
Nodes_reference map[*Node]*Node
Nodes_referenceOrder map[*Node]uint
// insertion point for slice of pointers maps
Node_Children_reverseMap map[*Node]*Node
Node_Buttons_reverseMap map[*Button]*Node
OnAfterNodeCreateCallback OnAfterCreateInterface[Node]
OnAfterNodeUpdateCallback OnAfterUpdateInterface[Node]
OnAfterNodeDeleteCallback OnAfterDeleteInterface[Node]
OnAfterNodeReadCallback OnAfterReadInterface[Node]
SVGIcons map[*SVGIcon]struct{}
SVGIcons_instance map[*SVGIcon]*SVGIcon
SVGIcons_mapString map[string]*SVGIcon
SVGIconOrder uint
SVGIcon_stagedOrder map[*SVGIcon]uint
SVGIcons_reference map[*SVGIcon]*SVGIcon
SVGIcons_referenceOrder map[*SVGIcon]uint
// insertion point for slice of pointers maps
OnAfterSVGIconCreateCallback OnAfterCreateInterface[SVGIcon]
OnAfterSVGIconUpdateCallback OnAfterUpdateInterface[SVGIcon]
OnAfterSVGIconDeleteCallback OnAfterDeleteInterface[SVGIcon]
OnAfterSVGIconReadCallback OnAfterReadInterface[SVGIcon]
Trees map[*Tree]struct{}
Trees_instance map[*Tree]*Tree
Trees_mapString map[string]*Tree
TreeOrder uint
Tree_stagedOrder map[*Tree]uint
Trees_reference map[*Tree]*Tree
Trees_referenceOrder map[*Tree]uint
// insertion point for slice of pointers maps
Tree_RootNodes_reverseMap map[*Node]*Tree
OnAfterTreeCreateCallback OnAfterCreateInterface[Tree]
OnAfterTreeUpdateCallback OnAfterUpdateInterface[Tree]
OnAfterTreeDeleteCallback OnAfterDeleteInterface[Tree]
OnAfterTreeReadCallback OnAfterReadInterface[Tree]
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
NamedStructs []*NamedStruct
// GongUnmarshallers is the registry of all model unmarshallers
GongUnmarshallers map[string]ModelUnmarshaller
// contains filtered or unexported fields
}
Stage enables storage of staged instances
func (*Stage) ApplyBackwardCommit ¶
ApplyBackwardCommit applies the commit before the current one
func (*Stage) ApplyForwardCommit ¶
func (*Stage) Clean ¶
Clean garbage collect unstaged instances that are referenced by staged elements
func (*Stage) CommitWithSuspendedCallbacks ¶
func (stage *Stage) CommitWithSuspendedCallbacks()
func (*Stage) ComputeForwardAndBackwardCommits ¶
func (stage *Stage) ComputeForwardAndBackwardCommits()
func (*Stage) ComputeInstancesNb ¶
func (stage *Stage) ComputeInstancesNb()
func (*Stage) ComputeReferenceAndOrders ¶
func (stage *Stage) ComputeReferenceAndOrders()
ComputeReferenceAndOrders will creates a deep copy of each of the staged elements
func (*Stage) ComputeReverseMaps ¶
func (stage *Stage) 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 (*Stage) GetBackwardCommits ¶
func (*Stage) GetCommitsBehind ¶
func (*Stage) GetDigramsEmbededDir ¶
func (*Stage) GetForwardCommits ¶
func (*Stage) GetGongMarshallingMode ¶
func (s *Stage) GetGongMarshallingMode() GongMarshallingMode
func (*Stage) GetInstances ¶
func (stage *Stage) GetInstances() (res []GongstructIF)
func (*Stage) GetIsWithGenesisCommit ¶
func (*Stage) GetMap_GongStructName_InstancesNb ¶
func (*Stage) GetModelsEmbededDir ¶
func (*Stage) GetNamedStructNamesByOrder ¶
func (*Stage) GetNamedStructsNames ¶
GetNamedStructs implements models.ProbebStage.
func (*Stage) GetProbeFormStageName ¶
func (*Stage) GetProbeIF ¶
func (*Stage) GetProbeNavigationTreeSidebarStageName ¶
func (*Stage) GetProbeNotificationTableStageName ¶
func (*Stage) GetProbeSplitStageName ¶
func (*Stage) GetProbeTableStageName ¶
func (*Stage) GetProbeTreeSidebarStageName ¶
func (*Stage) IsInDeltaMode ¶
func (*Stage) IsStagedButton ¶
insertion point for stage per struct
func (*Stage) IsStagedNode ¶
func (*Stage) IsStagedSVGIcon ¶
func (*Stage) IsStagedTree ¶
func (*Stage) Marshall ¶
Marshall marshall the stage content into the file as an instanciation into a stage
func (*Stage) MarshallFile ¶
MarshallFile marshall the stage content into a file as an instanciation into a stage according to the marshalling policy of the stage.
In GongMarshallingAppendCommit mode, it will append the last commit to the file. In other modes, it will rewrite the entire file.
func (*Stage) MarshallToString ¶
MarshallToString marshall the stage content into a string
func (*Stage) RegisterAfterCommit ¶
RegisterAfterCommit adds a hook that runs after the commit succeeds
func (*Stage) RegisterBeforeCommit ¶
RegisterBeforeCommit adds a hook that runs before the commit happens
func (*Stage) ResetHard ¶
func (stage *Stage) ResetHard()
ResetHard removes the more recent commitsBehind forward/backward Commits from the stage
func (*Stage) ResetMapStrings ¶
func (stage *Stage) ResetMapStrings()
func (*Stage) Restore ¶
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath
func (*Stage) RestoreXL ¶
Restore resets Stage & BackRepo and restores their content from the restore files in dirPath
func (*Stage) SetDeltaMode ¶
func (*Stage) SetGongMarshallingMode ¶
func (s *Stage) SetGongMarshallingMode(mode GongMarshallingMode)
func (*Stage) SetIsWithGenesisCommit ¶
func (*Stage) SetProbeIF ¶
func (*Stage) Squash ¶
func (stage *Stage) Squash()
Squash removes all commits and marshals the stage as a single commit
func (*Stage) StageBranchButton ¶
insertion point for stage branch per struct
func (*Stage) StageBranchNode ¶
func (*Stage) StageBranchSVGIcon ¶
func (*Stage) StageBranchTree ¶
func (*Stage) UnmarshallFile ¶
func (*Stage) UnstageBranchButton ¶
insertion point for unstage branch per struct
func (*Stage) UnstageBranchNode ¶
func (*Stage) UnstageBranchSVGIcon ¶
func (*Stage) UnstageBranchTree ¶
type Tabulator ¶
type Tabulator interface {
AddSheet(sheetName string)
AddRow(sheetName string) int
AddCell(sheetName string, rowId, columnIndex int, value string)
}
Tabulator is an interface for writing to a table strings
type ToolTipPositionEnum ¶
type ToolTipPositionEnum string
const ( Below ToolTipPositionEnum = "below" Above ToolTipPositionEnum = "above" Left ToolTipPositionEnum = "left" Right ToolTipPositionEnum = "right" )
func (ToolTipPositionEnum) CodeValues ¶
func (tooltippositionenum ToolTipPositionEnum) CodeValues() (res []string)
func (ToolTipPositionEnum) Codes ¶
func (tooltippositionenum ToolTipPositionEnum) Codes() (res []string)
func (*ToolTipPositionEnum) FromCodeString ¶
func (tooltippositionenum *ToolTipPositionEnum) FromCodeString(input string) (err error)
func (*ToolTipPositionEnum) FromString ¶
func (tooltippositionenum *ToolTipPositionEnum) FromString(input string) (err error)
func (*ToolTipPositionEnum) ToCodeString ¶
func (tooltippositionenum *ToolTipPositionEnum) ToCodeString() (res string)
func (ToolTipPositionEnum) ToString ¶
func (tooltippositionenum ToolTipPositionEnum) ToString() (res string)
Utility function for ToolTipPositionEnum 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 Tree ¶
Tree is a tree of nodes for selecting items to display
func (*Tree) CommitVoid ¶
func (*Tree) CopyBasicFields ¶
func (*Tree) GongCopy ¶
func (tree *Tree) GongCopy() GongstructIF
func (*Tree) GongDiff ¶
GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings
func (*Tree) GongGetFieldHeaders ¶
func (tree *Tree) GongGetFieldHeaders() (res []GongFieldHeader)
func (*Tree) GongGetFieldValue ¶
func (tree *Tree) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)
func (*Tree) GongGetGongstructName ¶
func (*Tree) GongGetIdentifier ¶
func (*Tree) GongGetOrder ¶
func (*Tree) GongGetReferenceIdentifier ¶
GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)
func (*Tree) GongGetReverseFieldOwner ¶
func (inst *Tree) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)
func (*Tree) GongGetReverseFieldOwnerName ¶
func (inst *Tree) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)
func (*Tree) GongGetUUID ¶
func (*Tree) GongMarshallAllFields ¶
func (*Tree) GongMarshallField ¶
func (*Tree) GongMarshallIdentifier ¶
func (*Tree) GongMarshallUnstaging ¶
func (*Tree) GongReconstructPointersFromInstances ¶
func (*Tree) GongReconstructPointersFromReferences ¶
func (*Tree) GongSetFieldValue ¶
func (tree *Tree) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error
func (*Tree) StagePreserveOrder ¶
StagePreserveOrder puts tree to the model stage, and if the astrtuct was not staged before:
- force the order if the order is equal or greater than the stage.TreeOrder - update stage.TreeOrder accordingly
func (*Tree) UnstageVoid ¶
UnstageVoid removes tree off the model stage
type TreeStackName ¶
type TreeStackName string
TreeStackName - Authorized name for form group
const (
TreeStackDefaultName TreeStackName = "Tree"
)
values for TableName
func (TreeStackName) CodeValues ¶
func (treestackname TreeStackName) CodeValues() (res []string)
func (TreeStackName) Codes ¶
func (treestackname TreeStackName) Codes() (res []string)
func (*TreeStackName) FromCodeString ¶
func (treestackname *TreeStackName) FromCodeString(input string) (err error)
func (*TreeStackName) FromString ¶
func (treestackname *TreeStackName) FromString(input string) (err error)
func (*TreeStackName) ToCodeString ¶
func (treestackname *TreeStackName) ToCodeString() (res string)
func (TreeStackName) ToString ¶
func (treestackname TreeStackName) ToString() (res string)
Utility function for TreeStackName 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 TreeUnmarshaller ¶
type TreeUnmarshaller struct{}
func (*TreeUnmarshaller) Initialize ¶
func (u *TreeUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)
func (*TreeUnmarshaller) UnmarshallField ¶
func (u *TreeUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error
Source Files
¶
- button.go
- button_proxy.go
- docs.go
- font_styme_enum.go
- functional_proxies.go
- node.go
- node_impl_interface.go
- stager.go
- svg_icon.go
- tree.go
- tree_stack_name.go
- zzz_gong.go
- zzz_gong_ast2.go
- zzz_gong_callbacks.go
- zzz_gong_clean.go
- zzz_gong_diff.go
- zzz_gong_enum.go
- zzz_gong_graph.go
- zzz_gong_marshall.go
- zzz_gong_orchestrator.go
- zzz_gong_probe.go
- zzz_gong_reverse.go
- zzz_gong_serialize.go
- zzz_gong_slices.go
- zzz_gong_wop.go