Documentation ¶
Overview ¶
Package mdg is the Model Drivern Generator Toolbox.
Index ¶
- Constants
- Variables
- func Compare(l, r mdd.Name) int
- func PtrID(p any) string
- func TemplateFuncs() map[string]any
- type AfterClass
- type AfterModel
- type AfterPackage
- type AssociationVisitor
- type AttributeVisitor
- type BeforeClass
- type BeforeModel
- type BeforePackage
- type ClassVisitor
- type DepthFirst
- type GenDir
- type MergeConfig
- type MergedFile
- type ModelVisitor
- type NumIDTag
- func (t *NumIDTag) BeginPackage(p *mdd.Package) error
- func (*NumIDTag) EndPackage(*mdd.Package) error
- func (t *NumIDTag) OnAssociation(a *mdd.Association) error
- func (t *NumIDTag) OnAttribute(a *mdd.Attribute) error
- func (t *NumIDTag) OnType(u mdd.Type) error
- func (t NumIDTag) Tag(m *mdd.Model) error
- type OnAssociation
- type OnAttribute
- type OnType
- type PackageVisitor
- type PkgsByDeps
- type TourGuide
- type TypeVisitor
Constants ¶
View Source
const ( Snake = "_" Kebab = "-" )
For use with mdd.Name.Join
Variables ¶
View Source
var GenIDTag genIDTag
GenIDTag is MMD's standard tag for attaching a unique ID to any mdd/mmb.Taggable model element.
Functions ¶
func TemplateFuncs ¶
Types ¶
type AfterClass ¶ added in v0.5.0
func (AfterClass) BeginClass ¶ added in v0.5.0
func (v AfterClass) BeginClass(m *mdd.Class) error
type AfterModel ¶ added in v0.5.0
func (AfterModel) BeginModel ¶ added in v0.5.0
func (v AfterModel) BeginModel(m *mdd.Model) error
type AfterPackage ¶ added in v0.5.0
func (AfterPackage) BeginPackage ¶ added in v0.5.0
func (v AfterPackage) BeginPackage(m *mdd.Package) error
func (AfterPackage) EndPackage ¶ added in v0.5.0
func (v AfterPackage) EndPackage(*mdd.Package) error
type AssociationVisitor ¶ added in v0.5.0
type AssociationVisitor interface {
OnAssociation(*mdd.Association) error
}
type AttributeVisitor ¶ added in v0.5.0
type BeforeClass ¶ added in v0.5.0
func (BeforeClass) BeginClass ¶ added in v0.5.0
func (v BeforeClass) BeginClass(m *mdd.Class) error
type BeforeModel ¶ added in v0.5.0
func (BeforeModel) BeginModel ¶ added in v0.5.0
func (v BeforeModel) BeginModel(m *mdd.Model) error
type BeforePackage ¶ added in v0.5.0
func (BeforePackage) BeginPackage ¶ added in v0.5.0
func (v BeforePackage) BeginPackage(m *mdd.Package) error
func (BeforePackage) EndPackage ¶ added in v0.5.0
func (v BeforePackage) EndPackage(*mdd.Package) error
type ClassVisitor ¶ added in v0.5.0
type DepthFirst ¶ added in v0.5.0
type DepthFirst TourGuide
type MergeConfig ¶
type MergeConfig struct { // TempFile returns a temporary file name for a given file. If nil, a '~' // will be appended to create temporary file names. TempFile func(string) string // GenFile returns the name for the last generated version of a file. If // nil, "-gen" will be appended to the filename. GenFile func(string) string // If not nill PostProc will be called on the generated output right after // that file has bee closed. E.g. use this to call gofmt on generated // output. PostProc func(file string) error // If MkDirs is 0 MergeFile will not create any directories. Otherwise it // will use MkDirs as the file mode to create the directories. MkDirs fs.FileMode }
type MergedFile ¶
type MergedFile struct {
// contains filtered or unexported fields
}
MergedFile implements a writer that used the diff3 tool to merge generated output with a manually modified version. To make this work, MergedFile also has to keep the last generated version of a file around. Alternatively you could use a separate "generator branch" in your VCS.
func NewMergedFile ¶
func NewMergedFile(name string, cfg *MergeConfig) (*MergedFile, error)
func (*MergedFile) Close ¶
func (f *MergedFile) Close() error
type ModelVisitor ¶ added in v0.5.0
type NumIDTag ¶ added in v0.5.0
type NumIDTag int
NumIDTag generates unique IDs by incrementally counting tags. It implements the respective visitor interfaces so that you can attach IDs to any model with the TourGuide of your choice.
func (*NumIDTag) BeginPackage ¶ added in v0.5.0
func (*NumIDTag) OnAssociation ¶ added in v0.5.0
func (t *NumIDTag) OnAssociation(a *mdd.Association) error
func (*NumIDTag) OnAttribute ¶ added in v0.5.0
type OnAssociation ¶ added in v0.5.0
type OnAssociation func(*mdd.Association) error
func (OnAssociation) OnAssociation ¶ added in v0.5.0
func (v OnAssociation) OnAssociation(a *mdd.Association) error
type OnAttribute ¶ added in v0.5.0
func (OnAttribute) OnAttribute ¶ added in v0.5.0
func (v OnAttribute) OnAttribute(m *mdd.Attribute) error
type PackageVisitor ¶ added in v0.5.0
type PkgsByDeps ¶ added in v0.5.0
func NewPkgsByDeps ¶ added in v0.5.0
func NewPkgsByDeps(m *mdd.Model) PkgsByDeps
type TypeVisitor ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.