models

package
v0.0.0-...-cdad75a Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 25 Imported by: 2

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

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

View Source
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"
)
View Source
const (
	GongNavigationModeNormal gongStageNavigationMode = "Normal"
	// when the mode is navigating, each commit backward and forward
	// it is possible to go apply the nbCommitsBackward forward commits
	GongNavigationModeNavigating gongStageNavigationMode = "Navigating"
)
View Source
const GongIdentifiersDecls = `
	{{Identifier}} := (&models.{{GeneratedStructName}}{Name: {{GeneratedFieldNameValue}}}).Stage(stage)`
View Source
const GongUnstageStmt = `
	{{Identifier}}.Unstage(stage)`
View Source
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

View Source
const MetaFieldStructInitStatement = `
	{{Identifier}}.{{GeneratedFieldName}} = ` + `{{GeneratedFieldNameValue}}`
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

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

func ExtractMiddleUint(input string) (uint, error)

ExtractMiddleUint takes a formatted string and returns the extracted 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)

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 GongExtractBool(expr ast.Expr) bool

func GongExtractExpr

func GongExtractExpr(expr ast.Expr) any

func GongExtractFloat

func GongExtractFloat(expr ast.Expr) float64

func GongExtractInt

func GongExtractInt(expr ast.Expr) int

func GongExtractString

func GongExtractString(expr ast.Expr) string

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

func GongParseAstString(stage *Stage, blob string, preserveOrder bool) error

GongParseAstString parses the Go source code from a string

func GongUnmarshallEnum

func GongUnmarshallEnum[T interface{ FromCodeString(string) error }](
	ptr T,
	valueExpr ast.Expr)

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

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

func ParseAstEmbeddedFile(stage *Stage, directory embed.FS, pathToFile string) error

ParseAstEmbeddedFile parses the Go source code from an embedded file

func ParseAstFile

func ParseAstFile(stage *Stage, pathToFile string, preserveOrder bool) error

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 SerializeStage(stage *Stage, filename string)

func SerializeStage2

func SerializeStage2(stage *Stage, filename string, addIDs bool)

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

func ToRawStringLiteral(s string) string

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)
	CreateORMButtonToggle(ButtonToggle *ButtonToggle)
	CreateORMGroup(Group *Group)
	CreateORMGroupToogle(GroupToogle *GroupToogle)
	CreateORMLayout(Layout *Layout)
}

swagger:ignore

type AllModelsStructDeleteInterface

type AllModelsStructDeleteInterface interface {
	DeleteORMButton(Button *Button)
	DeleteORMButtonToggle(ButtonToggle *ButtonToggle)
	DeleteORMGroup(Group *Group)
	DeleteORMGroupToogle(GroupToogle *GroupToogle)
	DeleteORMLayout(Layout *Layout)
}

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)
	CommitButtonToggle(buttontoggle *ButtonToggle)
	CheckoutButtonToggle(buttontoggle *ButtonToggle)
	CommitGroup(group *Group)
	CheckoutGroup(group *Group)
	CommitGroupToogle(grouptoogle *GroupToogle)
	CheckoutGroupToogle(grouptoogle *GroupToogle)
	CommitLayout(layout *Layout)
	CheckoutLayout(layout *Layout)
	GetLastCommitFromBackNb() uint
	GetLastPushFromFrontNb() uint
}

type Button

type Button struct {
	Name string

	Label string

	Icon string

	IsDisabled bool

	Color MatButtonPaletteType

	MatButtonType MatButtonType

	MatButtonAppearance MatButtonAppearance

	Proxy ButtonProxyInterface
}

func CopyBranchButton

func CopyBranchButton(mapOrigCopy map[any]any, buttonFrom *Button) (buttonTo *Button)

insertion point for stage branch per struct

func NewButton

func NewButton(
	target Target,
	name string,
	icon string,
	label string,
) *Button

Generic button creation function

func (*Button) Checkout

func (button *Button) Checkout(stage *Stage) *Button

Checkout button to the back repo (if it is already staged)

func (*Button) Commit

func (button *Button) Commit(stage *Stage) *Button

commit button to the back repo (if it is already staged)

func (*Button) CommitVoid

func (button *Button) CommitVoid(stage *Stage)

func (*Button) CopyBasicFields

func (from *Button) CopyBasicFields(to *Button)

func (*Button) GetName

func (button *Button) GetName() (res string)

for satisfaction of GongStruct interface

func (*Button) GongClean

func (button *Button) GongClean(stage *Stage) (modified bool)

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

func (button *Button) GongDiff(stage *Stage, buttonOther *Button) (diffs []string)

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

func (button *Button) GongGetGongstructName() string

insertion point for generic get gongstruct name

func (*Button) GongGetIdentifier

func (button *Button) GongGetIdentifier(stage *Stage) string

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

func (button *Button) GongGetOrder(stage *Stage) uint

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

func (button *Button) GongGetReferenceIdentifier(stage *Stage) string

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

func (button *Button) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)

insertion point for marshall all fields methods

func (*Button) GongMarshallField

func (button *Button) GongMarshallField(stage *Stage, fieldName string) (res string)

insertion point for marshall field methods

func (*Button) GongMarshallIdentifier

func (button *Button) GongMarshallIdentifier(stage *Stage) (decl string)

MarshallIdentifier returns the code to instantiate the instance in a marshalling file insertion point per named struct

func (*Button) GongMarshallUnstaging

func (button *Button) GongMarshallUnstaging(stage *Stage) (decl string)

insertion point for unstaging

func (*Button) GongReconstructPointersFromInstances

func (reference *Button) GongReconstructPointersFromInstances(stage *Stage)

insertion point for pointer reconstruction from instances

func (*Button) GongReconstructPointersFromReferences

func (reference *Button) GongReconstructPointersFromReferences(stage *Stage, instance *Button)

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 *Button) OnAfterUpdate(
	stage *Stage,
	stageButton, frontButton *Button)

func (*Button) SetName

func (button *Button) SetName(name string)

for satisfaction of GongStruct interface

func (*Button) Stage

func (button *Button) Stage(stage *Stage) *Button

insertion point for cumulative sub template with model space calls Stage puts button to the model stage

func (*Button) StagePreserveOrder

func (button *Button) StagePreserveOrder(stage *Stage, order uint)

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

func (button *Button) StageVoid(stage *Stage)

func (*Button) Unstage

func (button *Button) Unstage(stage *Stage) *Button

Unstage removes button off the model stage

func (*Button) UnstageVoid

func (button *Button) UnstageVoid(stage *Stage)

UnstageVoid removes button off the model stage

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

func (proxy *ButtonProxy) Updated()

Updated handles updating values when the button changes

type ButtonProxyInterface

type ButtonProxyInterface interface {
	Updated()
}

type ButtonToggle

type ButtonToggle struct {
	Name string

	Label string

	Icon string

	IsDisabled bool

	IsChecked bool

	Proxy ButtonProxyInterface
}

func CopyBranchButtonToggle

func CopyBranchButtonToggle(mapOrigCopy map[any]any, buttontoggleFrom *ButtonToggle) (buttontoggleTo *ButtonToggle)

func (*ButtonToggle) Checkout

func (buttontoggle *ButtonToggle) Checkout(stage *Stage) *ButtonToggle

Checkout buttontoggle to the back repo (if it is already staged)

func (*ButtonToggle) Commit

func (buttontoggle *ButtonToggle) Commit(stage *Stage) *ButtonToggle

commit buttontoggle to the back repo (if it is already staged)

func (*ButtonToggle) CommitVoid

func (buttontoggle *ButtonToggle) CommitVoid(stage *Stage)

func (*ButtonToggle) CopyBasicFields

func (from *ButtonToggle) CopyBasicFields(to *ButtonToggle)

func (*ButtonToggle) GetName

func (buttontoggle *ButtonToggle) GetName() (res string)

for satisfaction of GongStruct interface

func (*ButtonToggle) GongClean

func (buttontoggle *ButtonToggle) GongClean(stage *Stage) (modified bool)

Clean garbage collect unstaged instances that are referenced by ButtonToggle

func (*ButtonToggle) GongCopy

func (buttontoggle *ButtonToggle) GongCopy() GongstructIF

func (*ButtonToggle) GongDiff

func (buttontoggle *ButtonToggle) GongDiff(stage *Stage, buttontoggleOther *ButtonToggle) (diffs []string)

GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings

func (*ButtonToggle) GongGetFieldHeaders

func (buttontoggle *ButtonToggle) GongGetFieldHeaders() (res []GongFieldHeader)

func (*ButtonToggle) GongGetFieldValue

func (buttontoggle *ButtonToggle) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)

func (*ButtonToggle) GongGetGongstructName

func (buttontoggle *ButtonToggle) GongGetGongstructName() string

func (*ButtonToggle) GongGetIdentifier

func (buttontoggle *ButtonToggle) GongGetIdentifier(stage *Stage) string

func (*ButtonToggle) GongGetOrder

func (buttontoggle *ButtonToggle) GongGetOrder(stage *Stage) uint

func (*ButtonToggle) GongGetReferenceIdentifier

func (buttontoggle *ButtonToggle) GongGetReferenceIdentifier(stage *Stage) string

GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)

func (*ButtonToggle) GongGetReverseFieldOwner

func (inst *ButtonToggle) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)

func (*ButtonToggle) GongGetReverseFieldOwnerName

func (inst *ButtonToggle) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)

func (*ButtonToggle) GongMarshallAllFields

func (buttontoggle *ButtonToggle) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)

func (*ButtonToggle) GongMarshallField

func (buttontoggle *ButtonToggle) GongMarshallField(stage *Stage, fieldName string) (res string)

func (*ButtonToggle) GongMarshallIdentifier

func (buttontoggle *ButtonToggle) GongMarshallIdentifier(stage *Stage) (decl string)

func (*ButtonToggle) GongMarshallUnstaging

func (buttontoggle *ButtonToggle) GongMarshallUnstaging(stage *Stage) (decl string)

func (*ButtonToggle) GongReconstructPointersFromInstances

func (reference *ButtonToggle) GongReconstructPointersFromInstances(stage *Stage)

func (*ButtonToggle) GongReconstructPointersFromReferences

func (reference *ButtonToggle) GongReconstructPointersFromReferences(stage *Stage, instance *ButtonToggle)

func (*ButtonToggle) GongSetFieldValue

func (buttontoggle *ButtonToggle) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error

func (*ButtonToggle) OnAfterUpdate

func (buttonToggle *ButtonToggle) OnAfterUpdate(
	stage *Stage,
	stageButton, frontButton *ButtonToggle)

func (*ButtonToggle) SetName

func (buttontoggle *ButtonToggle) SetName(name string)

for satisfaction of GongStruct interface

func (*ButtonToggle) Stage

func (buttontoggle *ButtonToggle) Stage(stage *Stage) *ButtonToggle

Stage puts buttontoggle to the model stage

func (*ButtonToggle) StagePreserveOrder

func (buttontoggle *ButtonToggle) StagePreserveOrder(stage *Stage, order uint)

StagePreserveOrder puts buttontoggle 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.ButtonToggleOrder - update stage.ButtonToggleOrder accordingly

func (*ButtonToggle) StageVoid

func (buttontoggle *ButtonToggle) StageVoid(stage *Stage)

func (*ButtonToggle) Unstage

func (buttontoggle *ButtonToggle) Unstage(stage *Stage) *ButtonToggle

Unstage removes buttontoggle off the model stage

func (*ButtonToggle) UnstageVoid

func (buttontoggle *ButtonToggle) UnstageVoid(stage *Stage)

UnstageVoid removes buttontoggle off the model stage

type ButtonToggleOrchestrator

type ButtonToggleOrchestrator struct {
}

ButtonToggleOrchestrator

func (*ButtonToggleOrchestrator) OnAfterUpdate

func (orchestrator *ButtonToggleOrchestrator) OnAfterUpdate(
	gongsvgStage *Stage,
	stagedButtonToggle, backRepoButtonToggle *ButtonToggle)

type ButtonToggleUnmarshaller

type ButtonToggleUnmarshaller struct{}

func (*ButtonToggleUnmarshaller) Initialize

func (u *ButtonToggleUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)

func (*ButtonToggleUnmarshaller) UnmarshallField

func (u *ButtonToggleUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error

type ButtonToggle_WOP

type ButtonToggle_WOP struct {
	Name string

	Label string

	Icon string

	IsDisabled bool

	IsChecked bool
}

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 Button_WOP

type Button_WOP struct {
	Name string

	Label string

	Icon string

	IsDisabled bool

	Color MatButtonPaletteType

	MatButtonType MatButtonType

	MatButtonAppearance MatButtonAppearance
}

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 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"
	GongFieldValueTypeBasicKind       GongFieldValueType = "GongFieldValueTypeBasicKind"
	GongFieldValueTypePointer         GongFieldValueType = "GongFieldValueTypePointer"
	GongFieldValueTypeSliceOfPointers GongFieldValueType = "GongFieldValueTypeSliceOfPointers"
)

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 GongstructEnumIntField interface {
	int
	Codes() []string
	CodeValues() []int
}

type GongstructEnumStringField

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

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
}

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 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 Group

type Group struct {
	Name       string
	Percentage float64
	Buttons    []*Button
	NbColumns  int
}

func CopyBranchGroup

func CopyBranchGroup(mapOrigCopy map[any]any, groupFrom *Group) (groupTo *Group)

func (*Group) Checkout

func (group *Group) Checkout(stage *Stage) *Group

Checkout group to the back repo (if it is already staged)

func (*Group) Commit

func (group *Group) Commit(stage *Stage) *Group

commit group to the back repo (if it is already staged)

func (*Group) CommitVoid

func (group *Group) CommitVoid(stage *Stage)

func (*Group) CopyBasicFields

func (from *Group) CopyBasicFields(to *Group)

func (*Group) GetName

func (group *Group) GetName() (res string)

for satisfaction of GongStruct interface

func (*Group) GongClean

func (group *Group) GongClean(stage *Stage) (modified bool)

Clean garbage collect unstaged instances that are referenced by Group

func (*Group) GongCopy

func (group *Group) GongCopy() GongstructIF

func (*Group) GongDiff

func (group *Group) GongDiff(stage *Stage, groupOther *Group) (diffs []string)

GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings

func (*Group) GongGetFieldHeaders

func (group *Group) GongGetFieldHeaders() (res []GongFieldHeader)

func (*Group) GongGetFieldValue

func (group *Group) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)

func (*Group) GongGetGongstructName

func (group *Group) GongGetGongstructName() string

func (*Group) GongGetIdentifier

func (group *Group) GongGetIdentifier(stage *Stage) string

func (*Group) GongGetOrder

func (group *Group) GongGetOrder(stage *Stage) uint

func (*Group) GongGetReferenceIdentifier

func (group *Group) GongGetReferenceIdentifier(stage *Stage) string

GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)

func (*Group) GongGetReverseFieldOwner

func (inst *Group) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)

func (*Group) GongGetReverseFieldOwnerName

func (inst *Group) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)

func (*Group) GongMarshallAllFields

func (group *Group) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)

func (*Group) GongMarshallField

func (group *Group) GongMarshallField(stage *Stage, fieldName string) (res string)

func (*Group) GongMarshallIdentifier

func (group *Group) GongMarshallIdentifier(stage *Stage) (decl string)

func (*Group) GongMarshallUnstaging

func (group *Group) GongMarshallUnstaging(stage *Stage) (decl string)

func (*Group) GongReconstructPointersFromInstances

func (reference *Group) GongReconstructPointersFromInstances(stage *Stage)

func (*Group) GongReconstructPointersFromReferences

func (reference *Group) GongReconstructPointersFromReferences(stage *Stage, instance *Group)

func (*Group) GongSetFieldValue

func (group *Group) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error

func (*Group) SetName

func (group *Group) SetName(name string)

for satisfaction of GongStruct interface

func (*Group) Stage

func (group *Group) Stage(stage *Stage) *Group

Stage puts group to the model stage

func (*Group) StagePreserveOrder

func (group *Group) StagePreserveOrder(stage *Stage, order uint)

StagePreserveOrder puts group 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.GroupOrder - update stage.GroupOrder accordingly

func (*Group) StageVoid

func (group *Group) StageVoid(stage *Stage)

func (*Group) Unstage

func (group *Group) Unstage(stage *Stage) *Group

Unstage removes group off the model stage

func (*Group) UnstageVoid

func (group *Group) UnstageVoid(stage *Stage)

UnstageVoid removes group off the model stage

type GroupToogle

type GroupToogle struct {
	Name          string
	Percentage    float64
	ButtonToggles []*ButtonToggle

	IsSingleSelector bool
}

func CopyBranchGroupToogle

func CopyBranchGroupToogle(mapOrigCopy map[any]any, grouptoogleFrom *GroupToogle) (grouptoogleTo *GroupToogle)

func (*GroupToogle) Checkout

func (grouptoogle *GroupToogle) Checkout(stage *Stage) *GroupToogle

Checkout grouptoogle to the back repo (if it is already staged)

func (*GroupToogle) Commit

func (grouptoogle *GroupToogle) Commit(stage *Stage) *GroupToogle

commit grouptoogle to the back repo (if it is already staged)

func (*GroupToogle) CommitVoid

func (grouptoogle *GroupToogle) CommitVoid(stage *Stage)

func (*GroupToogle) CopyBasicFields

func (from *GroupToogle) CopyBasicFields(to *GroupToogle)

func (*GroupToogle) GetName

func (grouptoogle *GroupToogle) GetName() (res string)

for satisfaction of GongStruct interface

func (*GroupToogle) GongClean

func (grouptoogle *GroupToogle) GongClean(stage *Stage) (modified bool)

Clean garbage collect unstaged instances that are referenced by GroupToogle

func (*GroupToogle) GongCopy

func (grouptoogle *GroupToogle) GongCopy() GongstructIF

func (*GroupToogle) GongDiff

func (grouptoogle *GroupToogle) GongDiff(stage *Stage, grouptoogleOther *GroupToogle) (diffs []string)

GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings

func (*GroupToogle) GongGetFieldHeaders

func (grouptoogle *GroupToogle) GongGetFieldHeaders() (res []GongFieldHeader)

func (*GroupToogle) GongGetFieldValue

func (grouptoogle *GroupToogle) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)

func (*GroupToogle) GongGetGongstructName

func (grouptoogle *GroupToogle) GongGetGongstructName() string

func (*GroupToogle) GongGetIdentifier

func (grouptoogle *GroupToogle) GongGetIdentifier(stage *Stage) string

func (*GroupToogle) GongGetOrder

func (grouptoogle *GroupToogle) GongGetOrder(stage *Stage) uint

func (*GroupToogle) GongGetReferenceIdentifier

func (grouptoogle *GroupToogle) GongGetReferenceIdentifier(stage *Stage) string

GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)

func (*GroupToogle) GongGetReverseFieldOwner

func (inst *GroupToogle) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)

func (*GroupToogle) GongGetReverseFieldOwnerName

func (inst *GroupToogle) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)

func (*GroupToogle) GongMarshallAllFields

func (grouptoogle *GroupToogle) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)

func (*GroupToogle) GongMarshallField

func (grouptoogle *GroupToogle) GongMarshallField(stage *Stage, fieldName string) (res string)

func (*GroupToogle) GongMarshallIdentifier

func (grouptoogle *GroupToogle) GongMarshallIdentifier(stage *Stage) (decl string)

func (*GroupToogle) GongMarshallUnstaging

func (grouptoogle *GroupToogle) GongMarshallUnstaging(stage *Stage) (decl string)

func (*GroupToogle) GongReconstructPointersFromInstances

func (reference *GroupToogle) GongReconstructPointersFromInstances(stage *Stage)

func (*GroupToogle) GongReconstructPointersFromReferences

func (reference *GroupToogle) GongReconstructPointersFromReferences(stage *Stage, instance *GroupToogle)

func (*GroupToogle) GongSetFieldValue

func (grouptoogle *GroupToogle) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error

func (*GroupToogle) SetName

func (grouptoogle *GroupToogle) SetName(name string)

for satisfaction of GongStruct interface

func (*GroupToogle) Stage

func (grouptoogle *GroupToogle) Stage(stage *Stage) *GroupToogle

Stage puts grouptoogle to the model stage

func (*GroupToogle) StagePreserveOrder

func (grouptoogle *GroupToogle) StagePreserveOrder(stage *Stage, order uint)

StagePreserveOrder puts grouptoogle 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.GroupToogleOrder - update stage.GroupToogleOrder accordingly

func (*GroupToogle) StageVoid

func (grouptoogle *GroupToogle) StageVoid(stage *Stage)

func (*GroupToogle) Unstage

func (grouptoogle *GroupToogle) Unstage(stage *Stage) *GroupToogle

Unstage removes grouptoogle off the model stage

func (*GroupToogle) UnstageVoid

func (grouptoogle *GroupToogle) UnstageVoid(stage *Stage)

UnstageVoid removes grouptoogle off the model stage

type GroupToogleUnmarshaller

type GroupToogleUnmarshaller struct{}

func (*GroupToogleUnmarshaller) Initialize

func (u *GroupToogleUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)

func (*GroupToogleUnmarshaller) UnmarshallField

func (u *GroupToogleUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error

type GroupToogle_WOP

type GroupToogle_WOP struct {
	Name string

	Percentage float64

	IsSingleSelector bool
}

type GroupUnmarshaller

type GroupUnmarshaller struct{}

func (*GroupUnmarshaller) Initialize

func (u *GroupUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)

func (*GroupUnmarshaller) UnmarshallField

func (u *GroupUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error

type Group_WOP

type Group_WOP struct {
	Name string

	Percentage float64

	NbColumns int
}

type Layout

type Layout struct {
	Name string

	Groups       []*Group
	GroupToogles []*GroupToogle
}

func CopyBranchLayout

func CopyBranchLayout(mapOrigCopy map[any]any, layoutFrom *Layout) (layoutTo *Layout)

func (*Layout) Checkout

func (layout *Layout) Checkout(stage *Stage) *Layout

Checkout layout to the back repo (if it is already staged)

func (*Layout) Commit

func (layout *Layout) Commit(stage *Stage) *Layout

commit layout to the back repo (if it is already staged)

func (*Layout) CommitVoid

func (layout *Layout) CommitVoid(stage *Stage)

func (*Layout) CopyBasicFields

func (from *Layout) CopyBasicFields(to *Layout)

func (*Layout) GetName

func (layout *Layout) GetName() (res string)

for satisfaction of GongStruct interface

func (*Layout) GongClean

func (layout *Layout) GongClean(stage *Stage) (modified bool)

Clean garbage collect unstaged instances that are referenced by Layout

func (*Layout) GongCopy

func (layout *Layout) GongCopy() GongstructIF

func (*Layout) GongDiff

func (layout *Layout) GongDiff(stage *Stage, layoutOther *Layout) (diffs []string)

GongDiff computes the diff between the instance and another instance of same gong struct type and returns the list of differences as strings

func (*Layout) GongGetFieldHeaders

func (layout *Layout) GongGetFieldHeaders() (res []GongFieldHeader)

func (*Layout) GongGetFieldValue

func (layout *Layout) GongGetFieldValue(fieldName string, stage *Stage) (res GongFieldValue)

func (*Layout) GongGetGongstructName

func (layout *Layout) GongGetGongstructName() string

func (*Layout) GongGetIdentifier

func (layout *Layout) GongGetIdentifier(stage *Stage) string

func (*Layout) GongGetOrder

func (layout *Layout) GongGetOrder(stage *Stage) uint

func (*Layout) GongGetReferenceIdentifier

func (layout *Layout) GongGetReferenceIdentifier(stage *Stage) string

GongGetReferenceIdentifier returns an identifier when it was staged (it may have been unstaged since)

func (*Layout) GongGetReverseFieldOwner

func (inst *Layout) GongGetReverseFieldOwner(stage *Stage, reverseField *ReverseField) (res GongstructIF)

func (*Layout) GongGetReverseFieldOwnerName

func (inst *Layout) GongGetReverseFieldOwnerName(stage *Stage, reverseField *ReverseField) (res string)

func (*Layout) GongMarshallAllFields

func (layout *Layout) GongMarshallAllFields(stage *Stage) (initRes string, ptrRes string)

func (*Layout) GongMarshallField

func (layout *Layout) GongMarshallField(stage *Stage, fieldName string) (res string)

func (*Layout) GongMarshallIdentifier

func (layout *Layout) GongMarshallIdentifier(stage *Stage) (decl string)

func (*Layout) GongMarshallUnstaging

func (layout *Layout) GongMarshallUnstaging(stage *Stage) (decl string)

func (*Layout) GongReconstructPointersFromInstances

func (reference *Layout) GongReconstructPointersFromInstances(stage *Stage)

func (*Layout) GongReconstructPointersFromReferences

func (reference *Layout) GongReconstructPointersFromReferences(stage *Stage, instance *Layout)

func (*Layout) GongSetFieldValue

func (layout *Layout) GongSetFieldValue(fieldName string, value GongFieldValue, stage *Stage) error

func (*Layout) SetName

func (layout *Layout) SetName(name string)

for satisfaction of GongStruct interface

func (*Layout) Stage

func (layout *Layout) Stage(stage *Stage) *Layout

Stage puts layout to the model stage

func (*Layout) StagePreserveOrder

func (layout *Layout) StagePreserveOrder(stage *Stage, order uint)

StagePreserveOrder puts layout 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.LayoutOrder - update stage.LayoutOrder accordingly

func (*Layout) StageVoid

func (layout *Layout) StageVoid(stage *Stage)

func (*Layout) Unstage

func (layout *Layout) Unstage(stage *Stage) *Layout

Unstage removes layout off the model stage

func (*Layout) UnstageVoid

func (layout *Layout) UnstageVoid(stage *Stage)

UnstageVoid removes layout off the model stage

type LayoutUnmarshaller

type LayoutUnmarshaller struct{}

func (*LayoutUnmarshaller) Initialize

func (u *LayoutUnmarshaller) Initialize(stage *Stage, identifier string, instanceName string, preserveOrder bool) (GongstructIF, error)

func (*LayoutUnmarshaller) UnmarshallField

func (u *LayoutUnmarshaller) UnmarshallField(stage *Stage, i GongstructIF, fieldName string, valueExpr ast.Expr, identifierMap map[string]GongstructIF) error

type Layout_WOP

type Layout_WOP struct {
	Name string
}

type MatButtonAppearance

type MatButtonAppearance string

text Default appearance. Text buttons are used for the lowest priority actions, especially when presenting multiple options. filled High-emphasis buttons used for final or unblocking actions in a flow, such as saving or confirming. tonal Medium-emphasis buttons often used for final or unblocking actions in a flow, but with less visual emphasis than a filled button. outlined Medium-emphasis buttons often used for actions that need attention but aren't the primary action. elevated Medium-emphasis buttons often used when a button requires visual separation from a patterned background.

const (
	MatButtonAppearanceText     MatButtonAppearance = "text"
	MatButtonAppearanceFilled   MatButtonAppearance = "filled"
	MatButtonAppearanceElevated MatButtonAppearance = "elevated"
	MatButtonAppearanceOutlined MatButtonAppearance = "outlined"
	MatButtonAppearanceTonal    MatButtonAppearance = "tonal"
)

func (MatButtonAppearance) CodeValues

func (matbuttonappearance MatButtonAppearance) CodeValues() (res []string)

func (MatButtonAppearance) Codes

func (matbuttonappearance MatButtonAppearance) Codes() (res []string)

func (*MatButtonAppearance) FromCodeString

func (matbuttonappearance *MatButtonAppearance) FromCodeString(input string) (err error)

func (*MatButtonAppearance) FromString

func (matbuttonappearance *MatButtonAppearance) FromString(input string) (err error)

func (*MatButtonAppearance) ToCodeString

func (matbuttonappearance *MatButtonAppearance) ToCodeString() (res string)

func (MatButtonAppearance) ToString

func (matbuttonappearance MatButtonAppearance) ToString() (res string)

insertion point of enum utility functions Utility function for MatButtonAppearance 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 MatButtonPaletteType

type MatButtonPaletteType string
const (
	MatButtonPaletteTypePrimary MatButtonPaletteType = "primary"
	MatButtonPaletteTypeWarn    MatButtonPaletteType = "warn"
	MatButtonPaletteTypeAccent  MatButtonPaletteType = "accent"
)

func (MatButtonPaletteType) CodeValues

func (matbuttonpalettetype MatButtonPaletteType) CodeValues() (res []string)

func (MatButtonPaletteType) Codes

func (matbuttonpalettetype MatButtonPaletteType) Codes() (res []string)

func (*MatButtonPaletteType) FromCodeString

func (matbuttonpalettetype *MatButtonPaletteType) FromCodeString(input string) (err error)

func (*MatButtonPaletteType) FromString

func (matbuttonpalettetype *MatButtonPaletteType) FromString(input string) (err error)

func (*MatButtonPaletteType) ToCodeString

func (matbuttonpalettetype *MatButtonPaletteType) ToCodeString() (res string)

func (MatButtonPaletteType) ToString

func (matbuttonpalettetype MatButtonPaletteType) ToString() (res string)

Utility function for MatButtonPaletteType 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 MatButtonType

type MatButtonType string

matButton Rectangular button that can contain text and icons matIconButton Smaller, circular button, meant to contain an icon and no text matFab Rectangular button w/ elevation and rounded corners, meant to contain an icon. Can be extended to a rectangle to also fit a label matMiniFab Smaller variant of matFab

const (
	MatButtonTypeBasic       MatButtonType = "matButton"
	MatButtonTypeIcon        MatButtonType = "matIconButton"
	MatButtonTypeFab         MatButtonType = "matFab"
	MatButtonTypeMiniFab     MatButtonType = "matMiniFab"
	MatButtonTypeExtendedFab MatButtonType = "matFab extended"
)

func (MatButtonType) CodeValues

func (matbuttontype MatButtonType) CodeValues() (res []string)

func (MatButtonType) Codes

func (matbuttontype MatButtonType) Codes() (res []string)

func (*MatButtonType) FromCodeString

func (matbuttontype *MatButtonType) FromCodeString(input string) (err error)

func (*MatButtonType) FromString

func (matbuttontype *MatButtonType) FromString(input string) (err error)

func (*MatButtonType) ToCodeString

func (matbuttontype *MatButtonType) ToCodeString() (res string)

func (MatButtonType) ToString

func (matbuttontype MatButtonType) ToString() (res string)

Utility function for MatButtonType 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 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 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 PointerToGongstructEnumIntField

type PointerToGongstructEnumIntField interface {
	//insertion point for pointers to enum int types
	FromCodeString(input string) (err error)
}

type PointerToGongstructEnumStringField

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

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
	AddCommitNavigationNode(appendChildrenNodeFunc func(GongNodeIF))
	SetCommitMode(bool)
}

type ReverseField

type ReverseField struct {
	GongstructName string
	Fieldname      string
}

func GetReverseFields

func GetReverseFields[Type GongstructIF]() (res []ReverseField)

type StacksNames

type StacksNames string
const (
	ButtonStackName StacksNames = "button"
)

func (StacksNames) CodeValues

func (stacksnames StacksNames) CodeValues() (res []string)

func (StacksNames) Codes

func (stacksnames StacksNames) Codes() (res []string)

func (*StacksNames) FromCodeString

func (stacksnames *StacksNames) FromCodeString(input string) (err error)

func (*StacksNames) FromString

func (stacksnames *StacksNames) FromString(input string) (err error)

func (*StacksNames) ToCodeString

func (stacksnames *StacksNames) ToCodeString() (res string)

func (StacksNames) ToString

func (stacksnames StacksNames) ToString() (res string)

Utility function for StacksNames 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 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]

	ButtonToggles                map[*ButtonToggle]struct{}
	ButtonToggles_instance       map[*ButtonToggle]*ButtonToggle
	ButtonToggles_mapString      map[string]*ButtonToggle
	ButtonToggleOrder            uint
	ButtonToggle_stagedOrder     map[*ButtonToggle]uint
	ButtonToggles_reference      map[*ButtonToggle]*ButtonToggle
	ButtonToggles_referenceOrder map[*ButtonToggle]uint

	// insertion point for slice of pointers maps
	OnAfterButtonToggleCreateCallback OnAfterCreateInterface[ButtonToggle]
	OnAfterButtonToggleUpdateCallback OnAfterUpdateInterface[ButtonToggle]
	OnAfterButtonToggleDeleteCallback OnAfterDeleteInterface[ButtonToggle]
	OnAfterButtonToggleReadCallback   OnAfterReadInterface[ButtonToggle]

	Groups                map[*Group]struct{}
	Groups_instance       map[*Group]*Group
	Groups_mapString      map[string]*Group
	GroupOrder            uint
	Group_stagedOrder     map[*Group]uint
	Groups_reference      map[*Group]*Group
	Groups_referenceOrder map[*Group]uint

	// insertion point for slice of pointers maps
	Group_Buttons_reverseMap map[*Button]*Group

	OnAfterGroupCreateCallback OnAfterCreateInterface[Group]
	OnAfterGroupUpdateCallback OnAfterUpdateInterface[Group]
	OnAfterGroupDeleteCallback OnAfterDeleteInterface[Group]
	OnAfterGroupReadCallback   OnAfterReadInterface[Group]

	GroupToogles                map[*GroupToogle]struct{}
	GroupToogles_instance       map[*GroupToogle]*GroupToogle
	GroupToogles_mapString      map[string]*GroupToogle
	GroupToogleOrder            uint
	GroupToogle_stagedOrder     map[*GroupToogle]uint
	GroupToogles_reference      map[*GroupToogle]*GroupToogle
	GroupToogles_referenceOrder map[*GroupToogle]uint

	// insertion point for slice of pointers maps
	GroupToogle_ButtonToggles_reverseMap map[*ButtonToggle]*GroupToogle

	OnAfterGroupToogleCreateCallback OnAfterCreateInterface[GroupToogle]
	OnAfterGroupToogleUpdateCallback OnAfterUpdateInterface[GroupToogle]
	OnAfterGroupToogleDeleteCallback OnAfterDeleteInterface[GroupToogle]
	OnAfterGroupToogleReadCallback   OnAfterReadInterface[GroupToogle]

	Layouts                map[*Layout]struct{}
	Layouts_instance       map[*Layout]*Layout
	Layouts_mapString      map[string]*Layout
	LayoutOrder            uint
	Layout_stagedOrder     map[*Layout]uint
	Layouts_reference      map[*Layout]*Layout
	Layouts_referenceOrder map[*Layout]uint

	// insertion point for slice of pointers maps
	Layout_Groups_reverseMap map[*Group]*Layout

	Layout_GroupToogles_reverseMap map[*GroupToogle]*Layout

	OnAfterLayoutCreateCallback OnAfterCreateInterface[Layout]
	OnAfterLayoutUpdateCallback OnAfterUpdateInterface[Layout]
	OnAfterLayoutDeleteCallback OnAfterDeleteInterface[Layout]
	OnAfterLayoutReadCallback   OnAfterReadInterface[Layout]

	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 NewStage

func NewStage(name string) (stage *Stage)

func (*Stage) ApplyBackwardCommit

func (stage *Stage) ApplyBackwardCommit() error

ApplyBackwardCommit applies the commit before the current one

func (*Stage) ApplyForwardCommit

func (stage *Stage) ApplyForwardCommit() error

func (*Stage) Backup

func (stage *Stage) Backup(dirPath string)

backup generates backup files in the dirPath

func (*Stage) BackupXL

func (stage *Stage) BackupXL(dirPath string)

backup generates backup files in the dirPath

func (*Stage) Checkout

func (stage *Stage) Checkout()

func (*Stage) Clean

func (stage *Stage) Clean() (modified bool)

Clean garbage collect unstaged instances that are referenced by staged elements

func (*Stage) Commit

func (stage *Stage) Commit()

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 *Stage) GetBackwardCommits() []string

func (*Stage) GetCommitsBehind

func (stage *Stage) GetCommitsBehind() int

func (*Stage) GetDigramsEmbededDir

func (stage *Stage) GetDigramsEmbededDir() embed.FS

func (*Stage) GetForwardCommits

func (stage *Stage) GetForwardCommits() []string

func (*Stage) GetInstances

func (stage *Stage) GetInstances() (res []GongstructIF)

func (*Stage) GetMap_GongStructName_InstancesNb

func (stage *Stage) GetMap_GongStructName_InstancesNb() map[string]int

func (*Stage) GetModelsEmbededDir

func (stage *Stage) GetModelsEmbededDir() embed.FS

func (*Stage) GetName

func (stage *Stage) GetName() string

func (*Stage) GetNamedStructNamesByOrder

func (stage *Stage) GetNamedStructNamesByOrder(namedStructName string) (res []string)

func (*Stage) GetNamedStructsNames

func (stage *Stage) GetNamedStructsNames() (res []string)

GetNamedStructs implements models.ProbebStage.

func (*Stage) GetProbeFormStageName

func (stage *Stage) GetProbeFormStageName() string

func (*Stage) GetProbeIF

func (stage *Stage) GetProbeIF() ProbeIF

func (*Stage) GetProbeNotificationTableStageName

func (stage *Stage) GetProbeNotificationTableStageName() string

func (*Stage) GetProbeSplitStageName

func (stage *Stage) GetProbeSplitStageName() string

func (*Stage) GetProbeTableStageName

func (stage *Stage) GetProbeTableStageName() string

func (*Stage) GetProbeTreeSidebarStageName

func (stage *Stage) GetProbeTreeSidebarStageName() string

func (*Stage) GetType

func (stage *Stage) GetType() string

func (*Stage) IsInDeltaMode

func (stage *Stage) IsInDeltaMode() bool

func (*Stage) IsStagedButton

func (stage *Stage) IsStagedButton(button *Button) (ok bool)

insertion point for stage per struct

func (*Stage) IsStagedButtonToggle

func (stage *Stage) IsStagedButtonToggle(buttontoggle *ButtonToggle) (ok bool)

func (*Stage) IsStagedGroup

func (stage *Stage) IsStagedGroup(group *Group) (ok bool)

func (*Stage) IsStagedGroupToogle

func (stage *Stage) IsStagedGroupToogle(grouptoogle *GroupToogle) (ok bool)

func (*Stage) IsStagedLayout

func (stage *Stage) IsStagedLayout(layout *Layout) (ok bool)

func (*Stage) Lock

func (stage *Stage) Lock()

func (*Stage) Marshall

func (stage *Stage) Marshall(file *os.File, modelsPackageName, packageName string)

Marshall marshall the stage content into the file as an instanciation into a stage

func (*Stage) MarshallToString

func (stage *Stage) MarshallToString(modelsPackageName, packageName string) (res string, err error)

MarshallToString marshall the stage content into a string

func (*Stage) Nil

func (stage *Stage) Nil()

func (*Stage) Orphans

func (stage *Stage) Orphans()

Orphans removes all commits

func (*Stage) RLock

func (stage *Stage) RLock()

func (*Stage) RUnlock

func (stage *Stage) RUnlock()

func (*Stage) RegisterAfterCommit

func (s *Stage) RegisterAfterCommit(hook func(stage *Stage))

RegisterAfterCommit adds a hook that runs after the commit succeeds

func (*Stage) RegisterBeforeCommit

func (s *Stage) RegisterBeforeCommit(hook func(stage *Stage))

RegisterBeforeCommit adds a hook that runs before the commit happens

func (*Stage) Reset

func (stage *Stage) Reset()

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

func (stage *Stage) Restore(dirPath string)

Restore resets Stage & BackRepo and restores their content from the restore files in dirPath

func (*Stage) RestoreXL

func (stage *Stage) RestoreXL(dirPath string)

Restore resets Stage & BackRepo and restores their content from the restore files in dirPath

func (*Stage) SetDeltaMode

func (stage *Stage) SetDeltaMode(inDeltaMode bool)

func (*Stage) SetProbeIF

func (stage *Stage) SetProbeIF(probeIF ProbeIF)

func (*Stage) StageBranchButton

func (stage *Stage) StageBranchButton(button *Button)

insertion point for stage branch per struct

func (*Stage) StageBranchButtonToggle

func (stage *Stage) StageBranchButtonToggle(buttontoggle *ButtonToggle)

func (*Stage) StageBranchGroup

func (stage *Stage) StageBranchGroup(group *Group)

func (*Stage) StageBranchGroupToogle

func (stage *Stage) StageBranchGroupToogle(grouptoogle *GroupToogle)

func (*Stage) StageBranchLayout

func (stage *Stage) StageBranchLayout(layout *Layout)

func (*Stage) Unlock

func (stage *Stage) Unlock()

func (*Stage) Unstage

func (stage *Stage) Unstage()

func (*Stage) UnstageBranchButton

func (stage *Stage) UnstageBranchButton(button *Button)

insertion point for unstage branch per struct

func (*Stage) UnstageBranchButtonToggle

func (stage *Stage) UnstageBranchButtonToggle(buttontoggle *ButtonToggle)

func (*Stage) UnstageBranchGroup

func (stage *Stage) UnstageBranchGroup(group *Group)

func (*Stage) UnstageBranchGroupToogle

func (stage *Stage) UnstageBranchGroupToogle(grouptoogle *GroupToogle)

func (*Stage) UnstageBranchLayout

func (stage *Stage) UnstageBranchLayout(layout *Layout)

type Stager

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

func NewStager

func NewStager(r *gin.Engine, stage *Stage) (stager *Stager)

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 Target

type Target interface {
	OnAfterUpdateButton()
	GetButtonsStage() *Stage
}

Jump to

Keyboard shortcuts

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