models

package
v0.0.0-...-fb6039f Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

generated by ModelGongFileTemplate

Index

Constants

View Source
const IdentifiersDecls = `
	{{Identifier}} := (&models.{{GeneratedStructName}}{Name: ` + "`" + `{{GeneratedFieldNameValue}}` + "`" + `}).Stage()`
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 *StageStruct, instance *Type)

AfterCreateFromFront is called after a create from front

func AfterDeleteFromFront

func AfterDeleteFromFront[Type Gongstruct](stage *StageStruct, staged, front *Type)

AfterDeleteFromFront is called after a delete from front

func AfterReadFromFront

func AfterReadFromFront[Type Gongstruct](stage *StageStruct, instance *Type)

AfterReadFromFront is called after a Read from front

func AfterUpdateFromFront

func AfterUpdateFromFront[Type Gongstruct](stage *StageStruct, old, new *Type)

AfterUpdateFromFront is called after a update from front

func CreateORMAnotherDummyData

func CreateORMAnotherDummyData(anotherdummydata *AnotherDummyData)

CreateORMAnotherDummyData enables dynamic staging of a AnotherDummyData instance

func CreateORMCell

func CreateORMCell(cell *Cell)

CreateORMCell enables dynamic staging of a Cell instance

func CreateORMDummyData

func CreateORMDummyData(dummydata *DummyData)

CreateORMDummyData enables dynamic staging of a DummyData instance

func CreateORMElement

func CreateORMElement(element *Element)

CreateORMElement enables dynamic staging of a Element instance

func CreateORMMarkdownContent

func CreateORMMarkdownContent(markdowncontent *MarkdownContent)

CreateORMMarkdownContent enables dynamic staging of a MarkdownContent instance

func CreateORMRow

func CreateORMRow(row *Row)

CreateORMRow enables dynamic staging of a Row instance

func DeleteORMAnotherDummyData

func DeleteORMAnotherDummyData(anotherdummydata *AnotherDummyData)

DeleteORMAnotherDummyData enables dynamic staging of a AnotherDummyData instance

func DeleteORMCell

func DeleteORMCell(cell *Cell)

DeleteORMCell enables dynamic staging of a Cell instance

func DeleteORMDummyData

func DeleteORMDummyData(dummydata *DummyData)

DeleteORMDummyData enables dynamic staging of a DummyData instance

func DeleteORMElement

func DeleteORMElement(element *Element)

DeleteORMElement enables dynamic staging of a Element instance

func DeleteORMMarkdownContent

func DeleteORMMarkdownContent(markdowncontent *MarkdownContent)

DeleteORMMarkdownContent enables dynamic staging of a MarkdownContent instance

func DeleteORMRow

func DeleteORMRow(row *Row)

DeleteORMRow enables dynamic staging of a Row instance

func GetAssociationName

func GetAssociationName[Type Gongstruct]() *Type

GetAssociationName is a generic function that returns an instance of Type where each association is filled with an instance whose name is the name of the association

This function can be handy for generating navigation function that are refactorable

func GetFieldStringValue

func GetFieldStringValue[Type Gongstruct](instance Type, fieldName string) (res string)

func GetFields

func GetFields[Type Gongstruct]() (res []string)

GetFields return the array of the fields

func GetGongstructInstancesMap

func GetGongstructInstancesMap[Type Gongstruct]() *map[string]*Type

GetGongstructInstancesMap returns the map of staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier

func GetGongstructInstancesSet

func GetGongstructInstancesSet[Type Gongstruct]() *map[*Type]any

GetGongstructInstancesSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gongstruct identifier

func GetGongstructName

func GetGongstructName[Type Gongstruct]() (res string)

GetGongstructName returns the name of the Gongstruct this can be usefull if one want program robust to refactoring

func GetPointerReverseMap

func GetPointerReverseMap[Start, End Gongstruct](fieldname string) map[*End][]*Start

GetPointerReverseMap allows backtrack navigation of any Start.Fieldname associations (0..1) that is a pointer from one staged Gongstruct (type Start) instances to another (type End)

The function provides a map with keys as instances of End and values to arrays of *Start the map is construed by iterating over all Start instances and populationg keys with End instances and values with slice of Start instances

func GetSliceOfPointersReverseMap

func GetSliceOfPointersReverseMap[Start, End Gongstruct](fieldname string) map[*End]*Start

GetSliceOfPointersReverseMap allows backtrack navigation of any Start.Fieldname associations (0..N) between one staged Gongstruct instances and many others

The function provides a map with keys as instances of End and values to *Start instances the map is construed by iterating over all Start instances and populating keys with End instances and values with the Start instances

func GongGetMap

func GongGetMap[Type GongstructMapString]() *Type

GongGetMap returns the map of staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier

func GongGetSet

func GongGetSet[Type GongstructSet]() *Type

GongGetSet returns the set staged GongstructType instances it is usefull because it allows refactoring of gong struct identifier

func IntToLetters

func IntToLetters(number int32) (letters string)

func ParseAstFile

func ParseAstFile(pathToFile string) error

ParseAstFile Parse pathToFile and stages all instances declared in the file

func Serialize

func Serialize[Type Gongstruct](tab Tabulator)

func SerializeExcelize

func SerializeExcelize[Type Gongstruct](f *excelize.File)

func SerializeStage

func SerializeStage(filename string)

func SetCallbackAfterCreateFromFront

func SetCallbackAfterCreateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterCreateInterface[Type])

func SetCallbackAfterDeleteFromFront

func SetCallbackAfterDeleteFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterDeleteInterface[Type])

func SetCallbackAfterReadFromFront

func SetCallbackAfterReadFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterReadInterface[Type])

func SetCallbackAfterUpdateFromFront

func SetCallbackAfterUpdateFromFront[Type Gongstruct](stage *StageStruct, callback OnAfterUpdateInterface[Type])

SetCallbackAfterUpdateFromFront is a function to set up callback that is robust to refactoring

func UnmarshallGongstructStaging

func UnmarshallGongstructStaging(assignStmt *ast.AssignStmt, astCoordinate_ string) (
	instance any,
	identifier string,
	gongstructName string,
	fieldName string)

UnmarshallGoStaging unmarshall a go assign statement

Types

type AllModelsStructCreateInterface

type AllModelsStructCreateInterface interface {
	CreateORMAnotherDummyData(AnotherDummyData *AnotherDummyData)
	CreateORMCell(Cell *Cell)
	CreateORMDummyData(DummyData *DummyData)
	CreateORMElement(Element *Element)
	CreateORMMarkdownContent(MarkdownContent *MarkdownContent)
	CreateORMRow(Row *Row)
}

swagger:ignore

type AllModelsStructDeleteInterface

type AllModelsStructDeleteInterface interface {
	DeleteORMAnotherDummyData(AnotherDummyData *AnotherDummyData)
	DeleteORMCell(Cell *Cell)
	DeleteORMDummyData(DummyData *DummyData)
	DeleteORMElement(Element *Element)
	DeleteORMMarkdownContent(MarkdownContent *MarkdownContent)
	DeleteORMRow(Row *Row)
}

type AnotherDummyData

type AnotherDummyData struct {
	Name string
}

func (*AnotherDummyData) Checkout

func (anotherdummydata *AnotherDummyData) Checkout() *AnotherDummyData

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

func (*AnotherDummyData) Commit

func (anotherdummydata *AnotherDummyData) Commit() *AnotherDummyData

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

func (*AnotherDummyData) DeleteStageAndCommit

func (anotherdummydata *AnotherDummyData) DeleteStageAndCommit() *AnotherDummyData

DeleteStageAndCommit appends anotherdummydata to the model stage and commit to the orm repo

func (*AnotherDummyData) GetName

func (anotherdummydata *AnotherDummyData) GetName() (res string)

for satisfaction of GongStruct interface

func (*AnotherDummyData) Stage

func (anotherdummydata *AnotherDummyData) Stage() *AnotherDummyData

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

func (*AnotherDummyData) StageAndCommit

func (anotherdummydata *AnotherDummyData) StageAndCommit() *AnotherDummyData

StageAndCommit appends anotherdummydata to the model stage and commit to the orm repo

func (*AnotherDummyData) StageCopy

func (anotherdummydata *AnotherDummyData) StageCopy() *AnotherDummyData

StageCopy appends a copy of anotherdummydata to the model stage

func (*AnotherDummyData) StageCopyAndCommit

func (anotherdummydata *AnotherDummyData) StageCopyAndCommit() *AnotherDummyData

StageCopyAndCommit appends a copy of anotherdummydata to the model stage and commit to the orm repo

func (*AnotherDummyData) Unstage

func (anotherdummydata *AnotherDummyData) Unstage() *AnotherDummyData

Unstage removes anotherdummydata off the model stage

type BackRepoInterface

type BackRepoInterface interface {
	Commit(stage *StageStruct)
	Checkout(stage *StageStruct)
	Backup(stage *StageStruct, dirPath string)
	Restore(stage *StageStruct, dirPath string)
	BackupXL(stage *StageStruct, dirPath string)
	RestoreXL(stage *StageStruct, dirPath string)
	// insertion point for Commit and Checkout signatures
	CommitAnotherDummyData(anotherdummydata *AnotherDummyData)
	CheckoutAnotherDummyData(anotherdummydata *AnotherDummyData)
	CommitCell(cell *Cell)
	CheckoutCell(cell *Cell)
	CommitDummyData(dummydata *DummyData)
	CheckoutDummyData(dummydata *DummyData)
	CommitElement(element *Element)
	CheckoutElement(element *Element)
	CommitMarkdownContent(markdowncontent *MarkdownContent)
	CheckoutMarkdownContent(markdowncontent *MarkdownContent)
	CommitRow(row *Row)
	CheckoutRow(row *Row)
	GetLastCommitFromBackNb() uint
	GetLastPushFromFrontNb() uint
}

type Cell

type Cell struct {
	Name string
}

func (*Cell) Checkout

func (cell *Cell) Checkout() *Cell

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

func (*Cell) Commit

func (cell *Cell) Commit() *Cell

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

func (*Cell) DeleteStageAndCommit

func (cell *Cell) DeleteStageAndCommit() *Cell

DeleteStageAndCommit appends cell to the model stage and commit to the orm repo

func (*Cell) GetName

func (cell *Cell) GetName() (res string)

for satisfaction of GongStruct interface

func (*Cell) Stage

func (cell *Cell) Stage() *Cell

Stage puts cell to the model stage

func (*Cell) StageAndCommit

func (cell *Cell) StageAndCommit() *Cell

StageAndCommit appends cell to the model stage and commit to the orm repo

func (*Cell) StageCopy

func (cell *Cell) StageCopy() *Cell

StageCopy appends a copy of cell to the model stage

func (*Cell) StageCopyAndCommit

func (cell *Cell) StageCopyAndCommit() *Cell

StageCopyAndCommit appends a copy of cell to the model stage and commit to the orm repo

func (*Cell) Unstage

func (cell *Cell) Unstage() *Cell

Unstage removes cell off the model stage

type DummnyTypeInt

type DummnyTypeInt int
const (
	ONE DummnyTypeInt = 1
	TWO DummnyTypeInt = 2
)

values for EnumType

func (*DummnyTypeInt) FromCodeString

func (dummnytypeint *DummnyTypeInt) FromCodeString(input string) (err error)

func (*DummnyTypeInt) FromInt

func (dummnytypeint *DummnyTypeInt) FromInt(input int) (err error)

func (*DummnyTypeInt) ToCodeString

func (dummnytypeint *DummnyTypeInt) ToCodeString() (res string)

func (DummnyTypeInt) ToInt

func (dummnytypeint DummnyTypeInt) ToInt() (res int)

insertion point of enum utility functions Utility function for DummnyTypeInt if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value

type DummyData

type DummyData struct {
	Name        string
	DummyString string
	DummyInt    int
	DummyFloat  float64
	DummyBool   bool

	DummyEnumString ElementType

	DummyEnumInt DummnyTypeInt

	DummyTime                time.Time
	DummyDuration            time.Duration
	DummyPointerToGongStruct *AnotherDummyData
}

func (*DummyData) Checkout

func (dummydata *DummyData) Checkout() *DummyData

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

func (*DummyData) Commit

func (dummydata *DummyData) Commit() *DummyData

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

func (*DummyData) DeleteStageAndCommit

func (dummydata *DummyData) DeleteStageAndCommit() *DummyData

DeleteStageAndCommit appends dummydata to the model stage and commit to the orm repo

func (*DummyData) GetName

func (dummydata *DummyData) GetName() (res string)

for satisfaction of GongStruct interface

func (*DummyData) Stage

func (dummydata *DummyData) Stage() *DummyData

Stage puts dummydata to the model stage

func (*DummyData) StageAndCommit

func (dummydata *DummyData) StageAndCommit() *DummyData

StageAndCommit appends dummydata to the model stage and commit to the orm repo

func (*DummyData) StageCopy

func (dummydata *DummyData) StageCopy() *DummyData

StageCopy appends a copy of dummydata to the model stage

func (*DummyData) StageCopyAndCommit

func (dummydata *DummyData) StageCopyAndCommit() *DummyData

StageCopyAndCommit appends a copy of dummydata to the model stage and commit to the orm repo

func (*DummyData) Unstage

func (dummydata *DummyData) Unstage() *DummyData

Unstage removes dummydata off the model stage

type Element

type Element struct {
	Name    string
	Content string

	// kinda polymorphism
	Type ElementType

	SubElements []*Element

	// Rows is set up when element is a Table
	Rows []*Row
}

func GenerateTableOfDummnies

func GenerateTableOfDummnies() (element *Element)

func (*Element) AppendContent

func (element *Element) AppendContent(content string)

func (*Element) Checkout

func (element *Element) Checkout() *Element

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

func (*Element) Commit

func (element *Element) Commit() *Element

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

func (*Element) DeleteStageAndCommit

func (element *Element) DeleteStageAndCommit() *Element

DeleteStageAndCommit appends element to the model stage and commit to the orm repo

func (*Element) GetContent

func (element *Element) GetContent() string

func (*Element) GetName

func (element *Element) GetName() (res string)

for satisfaction of GongStruct interface

func (*Element) GetSubElements

func (element *Element) GetSubElements() []*Element

func (*Element) GetType

func (element *Element) GetType() ElementType

func (*Element) SetContent

func (element *Element) SetContent(content string)

func (*Element) Stage

func (element *Element) Stage() *Element

Stage puts element to the model stage

func (*Element) StageAndCommit

func (element *Element) StageAndCommit() *Element

StageAndCommit appends element to the model stage and commit to the orm repo

func (*Element) StageCopy

func (element *Element) StageCopy() *Element

StageCopy appends a copy of element to the model stage

func (*Element) StageCopyAndCommit

func (element *Element) StageCopyAndCommit() *Element

StageCopyAndCommit appends a copy of element to the model stage and commit to the orm repo

func (*Element) Unstage

func (element *Element) Unstage() *Element

Unstage removes element off the model stage

type ElementInterface

type ElementInterface interface {
	GetType() ElementType
	GetContent() string
	SetContent(content string)
	AppendContent(content string)
	GetSubElements() []ElementInterface
}

type ElementType

type ElementType string
const (
	PARAGRAPH ElementType = "Paragraph"
	TITLE     ElementType = "Title"
	TABLE     ElementType = "Table"
)

values for EnumType

func (*ElementType) FromCodeString

func (elementtype *ElementType) FromCodeString(input string) (err error)

func (*ElementType) FromString

func (elementtype *ElementType) FromString(input string) (err error)

func (*ElementType) ToCodeString

func (elementtype *ElementType) ToCodeString() (res string)

func (ElementType) ToString

func (elementtype ElementType) ToString() (res string)

Utility function for ElementType if enum values are string, it is stored with the value if enum values are int, they are stored with the code of the value

type ExcelizeTabulator

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

func (*ExcelizeTabulator) AddCell

func (tab *ExcelizeTabulator) AddCell(sheetName string, rowId, columnIndex int, value string)

func (*ExcelizeTabulator) AddRow

func (tab *ExcelizeTabulator) AddRow(sheetName string) (rowId int)

func (*ExcelizeTabulator) AddSheet

func (tab *ExcelizeTabulator) AddSheet(sheetName string)

func (*ExcelizeTabulator) SetExcelizeFile

func (tab *ExcelizeTabulator) SetExcelizeFile(f *excelize.File)

type GongStructInterface

type GongStructInterface interface {
	GetName() (res string)
	GetFields() (res []string)
	GetFieldStringValue(fieldName string) (res string)
}

GongStructInterface is the interface met by GongStructs It allows runtime reflexion of instances (without the hassle of the "reflect" package)

type Gongstruct

type Gongstruct interface {
	// insertion point for generic types
	AnotherDummyData | Cell | DummyData | Element | MarkdownContent | Row
}

Gongstruct is the type parameter for generated generic function that allows - access to staged instances - navigation between staged instances by going backward association links between gongstruct - full refactoring of Gongstruct identifiers / fields

type GongstructMapString

type GongstructMapString interface {
	map[any]any |

		map[string]*AnotherDummyData |
		map[string]*Cell |
		map[string]*DummyData |
		map[string]*Element |
		map[string]*MarkdownContent |
		map[string]*Row |
		map[*any]any // because go does not support an extra "|" at the end of type specifications
}

type GongstructSet

type GongstructSet interface {
	map[any]any |

		map[*AnotherDummyData]any |
		map[*Cell]any |
		map[*DummyData]any |
		map[*Element]any |
		map[*MarkdownContent]any |
		map[*Row]any |
		map[*any]any // because go does not support an extra "|" at the end of type specifications
}

type MarkdownContent

type MarkdownContent struct {
	Name    string
	Content string

	Root *Element
}

func (*MarkdownContent) Checkout

func (markdowncontent *MarkdownContent) Checkout() *MarkdownContent

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

func (*MarkdownContent) Commit

func (markdowncontent *MarkdownContent) Commit() *MarkdownContent

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

func (*MarkdownContent) DeleteStageAndCommit

func (markdowncontent *MarkdownContent) DeleteStageAndCommit() *MarkdownContent

DeleteStageAndCommit appends markdowncontent to the model stage and commit to the orm repo

func (*MarkdownContent) GetName

func (markdowncontent *MarkdownContent) GetName() (res string)

for satisfaction of GongStruct interface

func (*MarkdownContent) RecursiveUpdateContent

func (markdownContent *MarkdownContent) RecursiveUpdateContent(element *Element, depth int)

func (*MarkdownContent) Stage

func (markdowncontent *MarkdownContent) Stage() *MarkdownContent

Stage puts markdowncontent to the model stage

func (*MarkdownContent) StageAndCommit

func (markdowncontent *MarkdownContent) StageAndCommit() *MarkdownContent

StageAndCommit appends markdowncontent to the model stage and commit to the orm repo

func (*MarkdownContent) StageCopy

func (markdowncontent *MarkdownContent) StageCopy() *MarkdownContent

StageCopy appends a copy of markdowncontent to the model stage

func (*MarkdownContent) StageCopyAndCommit

func (markdowncontent *MarkdownContent) StageCopyAndCommit() *MarkdownContent

StageCopyAndCommit appends a copy of markdowncontent to the model stage and commit to the orm repo

func (*MarkdownContent) Unstage

func (markdowncontent *MarkdownContent) Unstage() *MarkdownContent

Unstage removes markdowncontent off the model stage

func (*MarkdownContent) UpdateContent

func (markdownContent *MarkdownContent) UpdateContent()

UpdateContent updates Content from the root

type OnAfterCreateInterface

type OnAfterCreateInterface[Type Gongstruct] interface {
	OnAfterCreate(stage *StageStruct,
		instance *Type)
}

OnAfterCreateInterface callback when an instance is updated from the front

type OnAfterDeleteInterface

type OnAfterDeleteInterface[Type Gongstruct] interface {
	OnAfterDelete(stage *StageStruct,
		staged, front *Type)
}

OnAfterDeleteInterface callback when an instance is updated from the front

type OnAfterReadInterface

type OnAfterReadInterface[Type Gongstruct] interface {
	OnAfterRead(stage *StageStruct,
		instance *Type)
}

OnAfterReadInterface callback when an instance is updated from the front

type OnAfterUpdateInterface

type OnAfterUpdateInterface[Type Gongstruct] interface {
	OnAfterUpdate(stage *StageStruct, old, new *Type)
}

OnAfterUpdateInterface callback when an instance is updated from the front

type OnInitCommitInterface

type OnInitCommitInterface interface {
	BeforeCommit(stage *StageStruct)
}

type PointerToGongstruct

type PointerToGongstruct interface {
	*AnotherDummyData | *Cell | *DummyData | *Element | *MarkdownContent | *Row
	GetName() string
}

Gongstruct is the type parameter for generated generic function that allows - access to staged instances - navigation between staged instances by going backward association links between gongstruct - full refactoring of Gongstruct identifiers / fields

type Row

type Row struct {
	Name  string
	Cells []*Cell
}

func (*Row) Checkout

func (row *Row) Checkout() *Row

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

func (*Row) Commit

func (row *Row) Commit() *Row

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

func (*Row) DeleteStageAndCommit

func (row *Row) DeleteStageAndCommit() *Row

DeleteStageAndCommit appends row to the model stage and commit to the orm repo

func (*Row) GetName

func (row *Row) GetName() (res string)

for satisfaction of GongStruct interface

func (*Row) Stage

func (row *Row) Stage() *Row

Stage puts row to the model stage

func (*Row) StageAndCommit

func (row *Row) StageAndCommit() *Row

StageAndCommit appends row to the model stage and commit to the orm repo

func (*Row) StageCopy

func (row *Row) StageCopy() *Row

StageCopy appends a copy of row to the model stage

func (*Row) StageCopyAndCommit

func (row *Row) StageCopyAndCommit() *Row

StageCopyAndCommit appends a copy of row to the model stage and commit to the orm repo

func (*Row) Unstage

func (row *Row) Unstage() *Row

Unstage removes row off the model stage

type StageStruct

type StageStruct struct {
	AnotherDummyDatas           map[*AnotherDummyData]any
	AnotherDummyDatas_mapString map[string]*AnotherDummyData

	OnAfterAnotherDummyDataCreateCallback OnAfterCreateInterface[AnotherDummyData]
	OnAfterAnotherDummyDataUpdateCallback OnAfterUpdateInterface[AnotherDummyData]
	OnAfterAnotherDummyDataDeleteCallback OnAfterDeleteInterface[AnotherDummyData]
	OnAfterAnotherDummyDataReadCallback   OnAfterReadInterface[AnotherDummyData]

	Cells           map[*Cell]any
	Cells_mapString map[string]*Cell

	OnAfterCellCreateCallback OnAfterCreateInterface[Cell]
	OnAfterCellUpdateCallback OnAfterUpdateInterface[Cell]
	OnAfterCellDeleteCallback OnAfterDeleteInterface[Cell]
	OnAfterCellReadCallback   OnAfterReadInterface[Cell]

	DummyDatas           map[*DummyData]any
	DummyDatas_mapString map[string]*DummyData

	OnAfterDummyDataCreateCallback OnAfterCreateInterface[DummyData]
	OnAfterDummyDataUpdateCallback OnAfterUpdateInterface[DummyData]
	OnAfterDummyDataDeleteCallback OnAfterDeleteInterface[DummyData]
	OnAfterDummyDataReadCallback   OnAfterReadInterface[DummyData]

	Elements           map[*Element]any
	Elements_mapString map[string]*Element

	OnAfterElementCreateCallback OnAfterCreateInterface[Element]
	OnAfterElementUpdateCallback OnAfterUpdateInterface[Element]
	OnAfterElementDeleteCallback OnAfterDeleteInterface[Element]
	OnAfterElementReadCallback   OnAfterReadInterface[Element]

	MarkdownContents           map[*MarkdownContent]any
	MarkdownContents_mapString map[string]*MarkdownContent

	OnAfterMarkdownContentCreateCallback OnAfterCreateInterface[MarkdownContent]
	OnAfterMarkdownContentUpdateCallback OnAfterUpdateInterface[MarkdownContent]
	OnAfterMarkdownContentDeleteCallback OnAfterDeleteInterface[MarkdownContent]
	OnAfterMarkdownContentReadCallback   OnAfterReadInterface[MarkdownContent]

	Rows           map[*Row]any
	Rows_mapString map[string]*Row

	OnAfterRowCreateCallback OnAfterCreateInterface[Row]
	OnAfterRowUpdateCallback OnAfterUpdateInterface[Row]
	OnAfterRowDeleteCallback OnAfterDeleteInterface[Row]
	OnAfterRowReadCallback   OnAfterReadInterface[Row]

	AllModelsStructCreateCallback AllModelsStructCreateInterface

	AllModelsStructDeleteCallback AllModelsStructDeleteInterface

	BackRepo BackRepoInterface

	// if set will be called before each commit to the back repo
	OnInitCommitCallback          OnInitCommitInterface
	OnInitCommitFromFrontCallback OnInitCommitInterface
	OnInitCommitFromBackCallback  OnInitCommitInterface

	// store the number of instance per gongstruct
	Map_GongStructName_InstancesNb map[string]int
}

StageStruct enables storage of staged instances swagger:ignore

var Stage StageStruct = StageStruct{
	AnotherDummyDatas:           make(map[*AnotherDummyData]any),
	AnotherDummyDatas_mapString: make(map[string]*AnotherDummyData),

	Cells:           make(map[*Cell]any),
	Cells_mapString: make(map[string]*Cell),

	DummyDatas:           make(map[*DummyData]any),
	DummyDatas_mapString: make(map[string]*DummyData),

	Elements:           make(map[*Element]any),
	Elements_mapString: make(map[string]*Element),

	MarkdownContents:           make(map[*MarkdownContent]any),
	MarkdownContents_mapString: make(map[string]*MarkdownContent),

	Rows:           make(map[*Row]any),
	Rows_mapString: make(map[string]*Row),

	Map_GongStructName_InstancesNb: make(map[string]int),
}

swagger:ignore instructs the gong compiler (gongc) to avoid this particular struct

func (*StageStruct) Backup

func (stage *StageStruct) Backup(dirPath string)

backup generates backup files in the dirPath

func (*StageStruct) BackupXL

func (stage *StageStruct) BackupXL(dirPath string)

backup generates backup files in the dirPath

func (*StageStruct) Checkout

func (stage *StageStruct) Checkout()

func (*StageStruct) Commit

func (stage *StageStruct) Commit()

func (*StageStruct) CreateReverseMap_DummyData_DummyPointerToGongStruct

func (stageStruct *StageStruct) CreateReverseMap_DummyData_DummyPointerToGongStruct() (res map[*AnotherDummyData][]*DummyData)

generate function for reverse association maps of DummyData

func (*StageStruct) CreateReverseMap_Element_Rows

func (stageStruct *StageStruct) CreateReverseMap_Element_Rows() (res map[*Row]*Element)

func (*StageStruct) CreateReverseMap_Element_SubElements

func (stageStruct *StageStruct) CreateReverseMap_Element_SubElements() (res map[*Element]*Element)

generate function for reverse association maps of Element

func (*StageStruct) CreateReverseMap_MarkdownContent_Root

func (stageStruct *StageStruct) CreateReverseMap_MarkdownContent_Root() (res map[*Element][]*MarkdownContent)

generate function for reverse association maps of MarkdownContent

func (*StageStruct) CreateReverseMap_Row_Cells

func (stageStruct *StageStruct) CreateReverseMap_Row_Cells() (res map[*Cell]*Row)

generate function for reverse association maps of Row

func (*StageStruct) Marshall

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

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

func (*StageStruct) Nil

func (stage *StageStruct) Nil()

func (*StageStruct) Reset

func (stage *StageStruct) Reset()

func (*StageStruct) Restore

func (stage *StageStruct) Restore(dirPath string)

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

func (*StageStruct) RestoreXL

func (stage *StageStruct) RestoreXL(dirPath string)

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

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