models

package
v0.0.0-...-f6ed87e Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 33 Imported by: 33

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

View Source
const IdentifiersDecls = `
	{{Identifier}} := (&models.{{GeneratedStructName}}{}).Stage(stage)`
View Source
const N = 1000
View Source
const NumberInitStatement = `
	{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
View Source
const PointerFieldInitStatement = `
	{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
View Source
const SliceOfPointersFieldInitStatement = `
	{{Identifier}}.{{GeneratedFieldName}} = append({{Identifier}}.{{GeneratedFieldName}}, {{GeneratedFieldNameValue}})`
View Source
const StringEnumInitStatement = `
	{{Identifier}}.{{GeneratedFieldName}} = {{GeneratedFieldNameValue}}`
View Source
const StringInitStatement = `
	{{Identifier}}.{{GeneratedFieldName}} = ` + "`" + `{{GeneratedFieldNameValue}}` + "`"
View Source
const TimeInitStatement = `` /* 129-byte string literal not displayed */

Variables

View Source
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",
}
View Source
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

func ComputePkgNameFromPkgPath(pkgPathArg string) (pkgName string)

ComputePkgNameFromPkgPath computes the name of the package from the current working directory

func ComputePkgPathFromGoModFile

func ComputePkgPathFromGoModFile(pkgPathArg string) (pkgName, fullPkgPath string)

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 File2lines(filePath string) ([]string, error)

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

func InsertStringToFile(path, str string, preceedingLineContent string) error

*

  • 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 IntToLetters(number int32) (letters string)

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 LinesFromReader

func LinesFromReader(r io.Reader) ([]string, error)

func MultiCodeGenerator

func MultiCodeGenerator(
	mdlPkg *ModelPkg,
	pkgName string,
	pkgGoPath string,

	path string,
	templateCode string,
	subTemplateCode map[string]string,
	subSubTemplateCode map[string]string,

	subSubToSubMap map[string]string,
)

func ParseAstFile

func ParseAstFile(stage *StageStruct, pathToFile string) error

ParseAstFile Parse pathToFile and stages all instances declared in the file

func ParseAstFileFromAst

func ParseAstFileFromAst(stage *StageStruct, inFile *ast.File, fset *token.FileSet) error

ParseAstFile Parse pathToFile and stages all instances declared in the file

func ParseEmbedModel

func ParseEmbedModel(embeddedDir embed.FS, source string) map[string]*ast.Package

func RemoveContents

func RemoveContents(dir string) error

func Replace1

func Replace1(template, match1, replace1 string) string

func Replace10

func Replace10(template, match1, replace1, match2, replace2, match3, replace3,
	match4, replace4, match5, replace5, match6, replace6, match7, replace7, match8, replace8, match9, replace9,
	match10, replace10 string) string

func Replace2

func Replace2(template, match1, replace1, match2, replace2 string) string

func Replace3

func Replace3(template, match1, replace1, match2, replace2, match3, replace3 string) string

func Replace4

func Replace4(template, match1, replace1, match2, replace2, match3, replace3, match4, replace4 string) string

func Replace5

func Replace5(template, match1, replace1, match2, replace2, match3, replace3,
	match4, replace4, match5, replace5 string) string

func Replace6

func Replace6(template, match1, replace1, match2, replace2, match3, replace3,
	match4, replace4, match5, replace5, match6, replace6 string) string

func Replace7

func Replace7(template, match1, replace1, match2, replace2, match3, replace3,
	match4, replace4, match5, replace5, match6, replace6, match7, replace7 string) string

func Replace8

func Replace8(template, match1, replace1, match2, replace2, match3, replace3,
	match4, replace4, match5, replace5, match6, replace6, match7, replace7, match8, replace8 string) string

func Replace9

func Replace9(template, match1, replace1, match2, replace2, match3, replace3,
	match4, replace4, match5, replace5, match6, replace6, match7, replace7, match8, replace8, match9, replace9 string) string

func ReplaceOldDeclarationsInFile

func ReplaceOldDeclarationsInFile(pathToFile string) error

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

func VerySimpleCodeGenerator(
	modelPkg *ModelPkg,
	generatedFilePath string,
	templateCode string)

VerySimpleCodeGenerator generates from elements of mdlPkg the file generatedFilePath with templateCode

func VerySimpleCodeGeneratorForGongStructWithNameField

func VerySimpleCodeGeneratorForGongStructWithNameField(
	mdlPkg *ModelPkg,
	pkgName string,
	pkgGoPath string,
	generatedFilePath string,
	templateCode string)

func Walk

func Walk(relativePathToModel string, modelPkg *ModelPkg)

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

func WalkParser(parserPkgs map[string]*ast.Package, modelPkg *ModelPkg, goGitignoreEntries *[]ignore.GitignoreEntry)

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 CopyBranchGongEnum(mapOrigCopy map[any]any, gongenumFrom *GongEnum) (gongenumTo *GongEnum)

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 (from *GongEnum) CopyBasicFields(to *GongEnum)

func (*GongEnum) GetName

func (gongenum *GongEnum) GetName() (res string)

for satisfaction of GongStruct interface

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

type GongEnumValue struct {
	Name  string
	Value string
}

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 GongEnumValue_WOP struct {
	// insertion point
	Name  string
	Value string
}

type GongEnum_WOP

type GongEnum_WOP struct {
	// insertion point
	Name string
	Type GongEnumType
}
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(mapOrigCopy map[any]any, gonglinkFrom *GongLink) (gonglinkTo *GongLink)

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 (from *GongLink) CopyBasicFields(to *GongLink)

func (*GongLink) GetName

func (gonglink *GongLink) GetName() (res string)

for satisfaction of GongStruct interface

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 struct {
	// insertion point
	Name       string
	Recv       string
	ImportPath string
}

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 CopyBranchGongNote(mapOrigCopy map[any]any, gongnoteFrom *GongNote) (gongnoteTo *GongNote)

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 (from *GongNote) CopyBasicFields(to *GongNote)

func (*GongNote) GetName

func (gongnote *GongNote) GetName() (res string)

for satisfaction of GongStruct interface

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 GongNote_WOP struct {
	// insertion point
	Name     string
	Body     string
	BodyHTML string
}

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 GongStruct_WOP struct {
	// insertion point
	Name                      string
	HasOnAfterUpdateSignature bool
	IsIgnoredForFront         bool
}

type GongTimeField

type GongTimeField struct {
	Name string

	Index int

	CompositeStructName string
}

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 GongTimeField_WOP struct {
	// insertion point
	Name                string
	Index               int
	CompositeStructName string
}

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 GongstructEnumStringField

type GongstructEnumStringField interface {
	Codes() []string
	CodeValues() []string
	ToString() string
}

type GongstructMapString

type GongstructMapString interface {
	map[any]any
}

type GongstructSet

type GongstructSet interface {
	map[any]any
}

type GongtructBasicField

type GongtructBasicField interface {
	int | float64 | bool | string | time.Time | time.Duration
}

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 CopyBranchMeta

func CopyBranchMeta(mapOrigCopy map[any]any, metaFrom *Meta) (metaTo *Meta)

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 (from *Meta) CopyBasicFields(to *Meta)

func (*Meta) GetName

func (meta *Meta) GetName() (res string)

for satisfaction of GongStruct interface

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 Meta_WOP

type Meta_WOP struct {
	// insertion point
	Name string
	Text 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 CopyBranchModelPkg(mapOrigCopy map[any]any, modelpkgFrom *ModelPkg) (modelpkgTo *ModelPkg)

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 (from *ModelPkg) CopyBasicFields(to *ModelPkg)

func (*ModelPkg) GenerateDocs

func (modelPkg *ModelPkg) GenerateDocs(docPackage *doc.Package)

GenerateDocs populates modelPkg with Gongnote presnt in the docPackage

func (*ModelPkg) GetName

func (modelpkg *ModelPkg) GetName() (res string)

for satisfaction of GongStruct interface

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 PointerToGongStructField_WOP

type PointerToGongStructField_WOP struct {
	// insertion point
	Name                string
	Index               int
	CompositeStructName string
	IsType              bool
}

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 PointerToGongstructEnumStringField

type PointerToGongstructEnumStringField interface {
	FromCodeString(input string) (err error)
}

type ReverseField

type ReverseField struct {
	GongstructName string
	Fieldname      string
}

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 (*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 SliceOfPointerToGongStructField_WOP

type SliceOfPointerToGongStructField_WOP struct {
	// insertion point
	Name                string
	Index               int
	CompositeStructName string
}

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 (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 (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 (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)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL