models

package
v0.0.0-...-a367fd2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Default generated models package docs (at least one file is necessary in a models package)

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

generated code - do not edit

Index

Constants

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

func EvictInOtherSlices[OwningType PointerToGongstruct, FieldType PointerToGongstruct](
	stage *StageStruct,
	owningInstance OwningType,
	sliceField []FieldType,
	fieldName string)

EvictInOtherSlices allows for adherance between the gong association model and go.

Says you have a Astruct struct with a slice field "anarrayofb []*Bstruct"

go allows many Astruct instance to have the anarrayofb field that have the same pointers. go slices are MANY-MANY association.

With gong it is only ZERO-ONE-MANY associations, a Bstruct can be pointed only once by an Astruct instance through a given field. This follows the requirement that gong is suited for full stack programming and therefore the association is encoded as a reverse pointer (not as a joint table). In gong, a named struct is translated in a table and each table is a named struct.

EvictInOtherSlices removes the fields instances from other fields of other instance

Note : algo is in O(N)log(N) of nb of Astruct and Bstruct instances

func GetAssociationName

func GetAssociationName[Type Gongstruct]() *Type

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

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

func GetFieldStringValue

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

func GetFieldStringValueFromPointer

func GetFieldStringValueFromPointer[Type PointerToGongstruct](instance Type, fieldName string) (res string)

func GetFields

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

GetFields return the array of the fields

func GetFieldsFromPointer

func GetFieldsFromPointer[Type PointerToGongstruct]() (res []string)

GetFieldsFromPointer return the array of the fields

func GetGongstrucsSorted

func GetGongstrucsSorted[T PointerToGongstruct](stage *StageStruct) (sortedSlice []T)

func GetGongstructInstancesMap

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

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

func GetGongstructInstancesSet

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

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

func GetGongstructInstancesSetFromPointerType

func GetGongstructInstancesSetFromPointerType[Type PointerToGongstruct](stage *StageStruct) *map[Type]any

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

func GetGongstructName

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

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

func GetPointerReverseMap

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

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

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

func GetPointerToGongstructName

func GetPointerToGongstructName[Type PointerToGongstruct]() (res string)

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

func GetSliceOfPointersReverseMap

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

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

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

func GongGetMap

func GongGetMap[Type GongstructMapString](stage *StageStruct) *Type

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

func GongGetSet

func GongGetSet[Type GongstructSet](stage *StageStruct) *Type

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

func IntToLetters

func IntToLetters(number int32) (letters string)

func IsStaged

func IsStaged[Type Gongstruct](stage *StageStruct, instance *Type) (ok bool)

func ParseAstFile

func ParseAstFile(stage *StageStruct, pathToFile string) error

ParseAstFile Parse pathToFile and stages all instances declared in the file

func ParseAstFileFromAst

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

ParseAstFile Parse pathToFile and stages all instances declared in the file

func ReplaceOldDeclarationsInFile

func ReplaceOldDeclarationsInFile(pathToFile string) error

ReplaceOldDeclarationsInFile replaces specific text in a file at the given path.

func Serialize

func Serialize[Type Gongstruct](stage *StageStruct, tab Tabulator)

func SerializeExcelize

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

func SerializeStage

func SerializeStage(stage *StageStruct, filename string)

func SetCallbackAfterCreateFromFront

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

func SetCallbackAfterDeleteFromFront

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

func SetCallbackAfterReadFromFront

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

func SetCallbackAfterUpdateFromFront

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

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

func SetOrchestratorOnAfterUpdate

func SetOrchestratorOnAfterUpdate[Type Gongstruct](stage *StageStruct)

func SortGongstructSetByName

func SortGongstructSetByName[T PointerToGongstruct](set map[T]any) (sortedSlice []T)

func StageBranch

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

StageBranch stages instance and apply StageBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the instance

the algorithm stops along the course of graph if a vertex is already staged

func UnmarshallGongstructStaging

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

UnmarshallGoStaging unmarshall a go assign statement

func UnstageBranch

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

UnstageBranch stages instance and apply UnstageBranch on all gongstruct instances that are referenced by pointers or slices of pointers of the insance

the algorithm stops along the course of graph if a vertex is already staged

Types

type A_books

type A_books struct {
	Name string `xml:"-"`

	// generated from element "book" of type bookType order 10 depth 2
	Book []*BookType `xml:"book,omitempty"`
}

A_books Named source within outer element "books"

type AllModelsStructCreateInterface

type AllModelsStructCreateInterface interface {
	CreateORMBookType(BookType *BookType)
	CreateORMBooks(Books *Books)
	CreateORMCredit(Credit *Credit)
	CreateORMLink(Link *Link)
}

swagger:ignore

type AllModelsStructDeleteInterface

type AllModelsStructDeleteInterface interface {
	DeleteORMBookType(BookType *BookType)
	DeleteORMBooks(Books *Books)
	DeleteORMCredit(Credit *Credit)
	DeleteORMLink(Link *Link)
}

type AttributeGroup_commonAttributes

type AttributeGroup_commonAttributes struct {

	// generated from attribute "isbn
	Isbn string `xml:"isbn,attr,omitempty"`

	// generated from attribute "bestseller
	Bestseller bool `xml:"bestseller,attr,omitempty"`
}

AttributeGroup_commonAttributes UnNamed source named attribute group "commonAttributes"

type AttributeGroup_extendedAttributes

type AttributeGroup_extendedAttributes struct {

	// generated from attribute "edition
	Edition string `xml:"edition,attr,omitempty"`

	// generated from attribute group "commonAttributes
	AttributeGroup_commonAttributes
}

AttributeGroup_extendedAttributes UnNamed source named attribute group "extendedAttributes"

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
	CommitBookType(booktype *BookType)
	CheckoutBookType(booktype *BookType)
	CommitBooks(books *Books)
	CheckoutBooks(books *Books)
	CommitCredit(credit *Credit)
	CheckoutCredit(credit *Credit)
	CommitLink(link *Link)
	CheckoutLink(link *Link)
	GetLastCommitFromBackNb() uint
	GetLastPushFromFrontNb() uint
}

type BookType

type BookType struct {
	Name string `xml:"-"`

	// generated from attribute group "extendedAttributes
	AttributeGroup_extendedAttributes

	// generated from group with order 1 depth 1
	Group_bookDetailsGroup

	// generated from element "credit" of type credit order 2 depth 1
	Credit []*Credit `xml:"credit,omitempty"`
}

BookType Named source named complex type "bookType"

This complex type defines the structure of a book, including title,

author, year, and format.

func CopyBranchBookType

func CopyBranchBookType(mapOrigCopy map[any]any, booktypeFrom *BookType) (booktypeTo *BookType)

insertion point for stage branch per struct

func (*BookType) Checkout

func (booktype *BookType) Checkout(stage *StageStruct) *BookType

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

func (*BookType) Commit

func (booktype *BookType) Commit(stage *StageStruct) *BookType

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

func (*BookType) CommitVoid

func (booktype *BookType) CommitVoid(stage *StageStruct)

func (*BookType) CopyBasicFields

func (from *BookType) CopyBasicFields(to *BookType)

func (*BookType) GetName

func (booktype *BookType) GetName() (res string)

for satisfaction of GongStruct interface

func (*BookType) Stage

func (booktype *BookType) Stage(stage *StageStruct) *BookType

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

func (*BookType) Unstage

func (booktype *BookType) Unstage(stage *StageStruct) *BookType

Unstage removes booktype off the model stage

func (*BookType) UnstageVoid

func (booktype *BookType) UnstageVoid(stage *StageStruct)

UnstageVoid removes booktype off the model stage

type BookType_WOP

type BookType_WOP struct {
	// insertion point
	Name       string
	Edition    string
	Isbn       string
	Bestseller bool
	Title      string
	Author     string
	Year       int
	Format     string
}

insertion point

type Books

type Books struct {
	Name string `xml:"-"`

	// necessary since it is a root element
	XMLName xml.Name `xml:"books"`

	// generated from inline complex type
	A_books
}

Books Named source element books within root schema

func CopyBranchBooks

func CopyBranchBooks(mapOrigCopy map[any]any, booksFrom *Books) (booksTo *Books)

func (*Books) Checkout

func (books *Books) Checkout(stage *StageStruct) *Books

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

func (*Books) Commit

func (books *Books) Commit(stage *StageStruct) *Books

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

func (*Books) CommitVoid

func (books *Books) CommitVoid(stage *StageStruct)

func (*Books) CopyBasicFields

func (from *Books) CopyBasicFields(to *Books)

func (*Books) GetName

func (books *Books) GetName() (res string)

for satisfaction of GongStruct interface

func (*Books) Stage

func (books *Books) Stage(stage *StageStruct) *Books

Stage puts books to the model stage

func (*Books) Unstage

func (books *Books) Unstage(stage *StageStruct) *Books

Unstage removes books off the model stage

func (*Books) UnstageVoid

func (books *Books) UnstageVoid(stage *StageStruct)

UnstageVoid removes books off the model stage

type Books_WOP

type Books_WOP struct {
	// insertion point
	Name string
}

type Credit

type Credit struct {
	Name string `xml:"-"`

	// generated from attribute "page
	Page int `xml:"page,attr,omitempty"`

	// generated from element "credit-type" of type string order 12 depth 1
	Credit_type string `xml:"credit-type,omitempty"`

	// generated from element "link" of type link order 16 depth 1
	Link []*Link `xml:"link,omitempty"`

	// generated from element "credit-words" of type string order 17 depth 1
	Credit_words string `xml:"credit-words,omitempty"`

	// generated from element "credit-symbol" of type string order 18 depth 1
	Credit_symbol string `xml:"credit-symbol,omitempty"`
}

Credit Named source named complex type "credit" The credit type ..

func CopyBranchCredit

func CopyBranchCredit(mapOrigCopy map[any]any, creditFrom *Credit) (creditTo *Credit)

func (*Credit) Checkout

func (credit *Credit) Checkout(stage *StageStruct) *Credit

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

func (*Credit) Commit

func (credit *Credit) Commit(stage *StageStruct) *Credit

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

func (*Credit) CommitVoid

func (credit *Credit) CommitVoid(stage *StageStruct)

func (*Credit) CopyBasicFields

func (from *Credit) CopyBasicFields(to *Credit)

func (*Credit) GetName

func (credit *Credit) GetName() (res string)

for satisfaction of GongStruct interface

func (*Credit) Stage

func (credit *Credit) Stage(stage *StageStruct) *Credit

Stage puts credit to the model stage

func (*Credit) Unstage

func (credit *Credit) Unstage(stage *StageStruct) *Credit

Unstage removes credit off the model stage

func (*Credit) UnstageVoid

func (credit *Credit) UnstageVoid(stage *StageStruct)

UnstageVoid removes credit off the model stage

type Credit_WOP

type Credit_WOP struct {
	// insertion point
	Name          string
	Page          int
	Credit_type   string
	Credit_words  string
	Credit_symbol string
}

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 GongStructInterface

type GongStructInterface interface {
	GetName() (res string)
}

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

type Gongstruct

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

type Group_bookDetailsGroup struct {

	// generated from element "title" of type titleType order 4 depth 1
	Title string `xml:"title,omitempty"`

	// generated from element "author" of type string order 5 depth 1
	Author string `xml:"author,omitempty"`

	// generated from element "year" of type yearType order 6 depth 1
	Year int `xml:"year,omitempty"`

	// generated from element "format" of type bookFormatEnum order 7 depth 1
	Format string `xml:"format,omitempty"`
}

Group_bookDetailsGroup UnNamed source named group "bookDetailsGroup"

type Link struct {
	Name string `xml:"-"`

	// generated from attribute "name
	NameXSD string `xml:"name,attr,omitempty"`

	// in case the extension has base type xs:string, one has to had the chardata stuff
	EnclosedText string `xml:",chardata"`
}

Link Named source named complex type "link" The link type serves as an outgoing simple XLink. If a relative link is used within a document that is part of a compressed MusicXML file, the link is relative to the root folder of the zip file.

func CopyBranchLink(mapOrigCopy map[any]any, linkFrom *Link) (linkTo *Link)

func (*Link) Checkout

func (link *Link) Checkout(stage *StageStruct) *Link

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

func (*Link) Commit

func (link *Link) Commit(stage *StageStruct) *Link

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

func (*Link) CommitVoid

func (link *Link) CommitVoid(stage *StageStruct)

func (*Link) CopyBasicFields

func (from *Link) CopyBasicFields(to *Link)

func (*Link) GetName

func (link *Link) GetName() (res string)

for satisfaction of GongStruct interface

func (*Link) Stage

func (link *Link) Stage(stage *StageStruct) *Link

Stage puts link to the model stage

func (*Link) Unstage

func (link *Link) Unstage(stage *StageStruct) *Link

Unstage removes link off the model stage

func (*Link) UnstageVoid

func (link *Link) UnstageVoid(stage *StageStruct)

UnstageVoid removes link off the model stage

type Link_WOP struct {
	// insertion point
	Name         string
	NameXSD      string
	EnclosedText string
}

type OnAfterCreateInterface

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

OnAfterCreateInterface callback when an instance is updated from the front

type OnAfterDeleteInterface

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

OnAfterDeleteInterface callback when an instance is updated from the front

type OnAfterReadInterface

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

OnAfterReadInterface callback when an instance is updated from the front

type OnAfterUpdateInterface

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

OnAfterUpdateInterface callback when an instance is updated from the front

type OnInitCommitInterface

type OnInitCommitInterface interface {
	BeforeCommit(stage *StageStruct)
}

type PointerToGongstruct

type PointerToGongstruct interface {
	GetName() string
	CommitVoid(*StageStruct)
	UnstageVoid(stage *StageStruct)
	comparable
}

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

type PointerToGongstructEnumIntField

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

type PointerToGongstructEnumStringField

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

type ReverseField

type ReverseField struct {
	GongstructName string
	Fieldname      string
}

func GetReverseFields

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

type StageStruct

type StageStruct struct {

	// insertion point for definition of arrays registering instances
	BookTypes           map[*BookType]any
	BookTypes_mapString map[string]*BookType

	// insertion point for slice of pointers maps
	BookType_Credit_reverseMap map[*Credit]*BookType

	OnAfterBookTypeCreateCallback OnAfterCreateInterface[BookType]
	OnAfterBookTypeUpdateCallback OnAfterUpdateInterface[BookType]
	OnAfterBookTypeDeleteCallback OnAfterDeleteInterface[BookType]
	OnAfterBookTypeReadCallback   OnAfterReadInterface[BookType]

	Bookss           map[*Books]any
	Bookss_mapString map[string]*Books

	// insertion point for slice of pointers maps
	Books_Book_reverseMap map[*BookType]*Books

	OnAfterBooksCreateCallback OnAfterCreateInterface[Books]
	OnAfterBooksUpdateCallback OnAfterUpdateInterface[Books]
	OnAfterBooksDeleteCallback OnAfterDeleteInterface[Books]
	OnAfterBooksReadCallback   OnAfterReadInterface[Books]

	Credits           map[*Credit]any
	Credits_mapString map[string]*Credit

	// insertion point for slice of pointers maps
	Credit_Link_reverseMap map[*Link]*Credit

	OnAfterCreditCreateCallback OnAfterCreateInterface[Credit]
	OnAfterCreditUpdateCallback OnAfterUpdateInterface[Credit]
	OnAfterCreditDeleteCallback OnAfterDeleteInterface[Credit]
	OnAfterCreditReadCallback   OnAfterReadInterface[Credit]

	Links           map[*Link]any
	Links_mapString map[string]*Link

	// insertion point for slice of pointers maps
	OnAfterLinkCreateCallback OnAfterCreateInterface[Link]
	OnAfterLinkUpdateCallback OnAfterUpdateInterface[Link]
	OnAfterLinkDeleteCallback OnAfterDeleteInterface[Link]
	OnAfterLinkReadCallback   OnAfterReadInterface[Link]

	AllModelsStructCreateCallback AllModelsStructCreateInterface

	AllModelsStructDeleteCallback AllModelsStructDeleteInterface

	BackRepo BackRepoInterface

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

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

	// store meta package import
	MetaPackageImportPath  string
	MetaPackageImportAlias string

	// to be removed after fix of [issue](https://github.com/golang/go/issues/57559)
	// map to enable docLink renaming when an identifier is renamed
	Map_DocLink_Renaming map[string]GONG__Identifier
	// contains filtered or unexported fields
}

StageStruct enables storage of staged instances swagger:ignore

func NewStage

func NewStage(path string) (stage *StageStruct)

func (*StageStruct) Backup

func (stage *StageStruct) Backup(dirPath string)

backup generates backup files in the dirPath

func (*StageStruct) BackupXL

func (stage *StageStruct) BackupXL(dirPath string)

backup generates backup files in the dirPath

func (*StageStruct) Checkout

func (stage *StageStruct) Checkout()

func (*StageStruct) Commit

func (stage *StageStruct) Commit()

func (*StageStruct) CommitWithSuspendedCallbacks

func (stage *StageStruct) CommitWithSuspendedCallbacks()

func (*StageStruct) ComputeReverseMaps

func (stage *StageStruct) ComputeReverseMaps()

ComputeReverseMaps computes the reverse map, for all intances, for all slice to pointers field Its complexity is in O(n)O(p) where p is the number of pointers

func (*StageStruct) GetPath

func (stage *StageStruct) GetPath() string

func (*StageStruct) GetType

func (stage *StageStruct) GetType() string

func (*StageStruct) IsStagedBookType

func (stage *StageStruct) IsStagedBookType(booktype *BookType) (ok bool)

insertion point for stage per struct

func (*StageStruct) IsStagedBooks

func (stage *StageStruct) IsStagedBooks(books *Books) (ok bool)

func (*StageStruct) IsStagedCredit

func (stage *StageStruct) IsStagedCredit(credit *Credit) (ok bool)
func (stage *StageStruct) IsStagedLink(link *Link) (ok bool)

func (*StageStruct) Marshall

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

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

func (*StageStruct) Nil

func (stage *StageStruct) Nil()

func (*StageStruct) Reset

func (stage *StageStruct) Reset()

func (*StageStruct) Restore

func (stage *StageStruct) Restore(dirPath string)

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

func (*StageStruct) RestoreXL

func (stage *StageStruct) RestoreXL(dirPath string)

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

func (*StageStruct) StageBranchBookType

func (stage *StageStruct) StageBranchBookType(booktype *BookType)

insertion point for stage branch per struct

func (*StageStruct) StageBranchBooks

func (stage *StageStruct) StageBranchBooks(books *Books)

func (*StageStruct) StageBranchCredit

func (stage *StageStruct) StageBranchCredit(credit *Credit)
func (stage *StageStruct) StageBranchLink(link *Link)

func (*StageStruct) Unstage

func (stage *StageStruct) Unstage()

func (*StageStruct) UnstageBranchBookType

func (stage *StageStruct) UnstageBranchBookType(booktype *BookType)

insertion point for unstage branch per struct

func (*StageStruct) UnstageBranchBooks

func (stage *StageStruct) UnstageBranchBooks(books *Books)

func (*StageStruct) UnstageBranchCredit

func (stage *StageStruct) UnstageBranchCredit(credit *Credit)
func (stage *StageStruct) UnstageBranchLink(link *Link)

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