Documentation
¶
Index ¶
- type Author
- type BasicModel
- type Code
- type CodeGenerateResult
- type CodeGeneratorOptions
- type CodeImportModel
- type CodeInjectImportModel
- type CodeTemplate
- type CodeTemplateListOptions
- type CodeTypeImportModel
- type Column
- type ColumnList
- type Commit
- type CommitHistory
- type CommitHistoryOptions
- type CommitModel
- type CommonProjectFeature
- type Config
- type Connection
- type ConnectionGroup
- type ConnectionList
- type CreatorImportModel
- type CustomModel
- type DatabaseInformation
- type Datatype
- type DbFeatureOptions
- type Developer
- type DeveloperSection
- type Entity
- type EntityColumnImportModel
- type EntityColumnModel
- type EntityColumnProps
- type EntityImportModel
- type EntityList
- type EntityListModel
- type EntityModel
- type EntityRelation
- type EntityRelationModel
- type EntityStat
- type FeatureModel
- type FeatureOptions
- type FeatureSet
- type FileConnection
- type GenericConnection
- type GenericConnectionType
- type GitTag
- type Global
- type Index
- type IndexColumn
- type IndexList
- type Inject
- type InjectSection
- type Key
- type LanguageDefinition
- type MsSqlConnection
- type NameModel
- type OpenAPIConnection
- type PostgresConnection
- type ProjectConfig
- type ProjectSection
- type ProjectTemplate
- type ProjectTemplateCommand
- type ProjectTemplateCreateOptions
- type ProjectTemplateInput
- type ProjectTemplateListOptions
- type ProjectTemplateModel
- type Reference
- type Relation
- type RelationList
- type SecretEntry
- type SourceFile
- type SourceListOptions
- type Synonym
- type TableRelation
- type TemplateGeneratorFileResult
- type TemplateGeneratorResult
- type TemplateGeneratorSnippetResult
- type TemplateGeneratorStatistics
- type TextTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicModel ¶
type BasicModel struct {
RootNamespace string
Namespace string
Postfix string
Prefix string
ModuleLevelVariablePrefix string
Inject []InjectSection
Imports []string
Project ProjectSection
Developer DeveloperSection
Options map[string]string
PageHeader string
Feature FeatureModel
Name string
}
BasicModel represents the basic model for the code generation. It is used to generate the basic files for the project when the templates model is not set or set to basic
type Code ¶
type Code struct {
RootNamespace string `yaml:"rootNamespace,omitempty"`
OmitSourcePrefix bool `yaml:"omitSourcePrefix,omitempty"`
Global Global `yaml:"global"`
Groups []string `yaml:"groups"`
Options map[string]string `yaml:"options"`
Keys map[string]Key `yaml:"keys,omitempty"`
Inject map[string]Inject `yaml:"inject,omitempty"`
Locations map[string]string `yaml:"locations"`
FileHeader string `yaml:"header"`
DisableNullableTypes bool `json:"diableNullableTypes" yaml:"diableNullableTypes"`
UseNullableAlternative bool `json:"useNullableAlternative" yaml:"useNullableAlternative"`
}
type CodeGenerateResult ¶
type CodeGenerateResult struct {
Files []TemplateGeneratorFileResult
Snippets []TemplateGeneratorFileResult
Statistics *TemplateGeneratorStatistics
}
type CodeGeneratorOptions ¶
type CodeGeneratorOptions struct {
Name string
Custom interface{}
Templates []string
FeatureTemplates []string
TemplatePath string
CanUseTemplates bool
SourceItemGroups []string
SourceItems []string
ExportToScreen bool
ExportByLocationKey bool
ExportPath string
ConnectionName string
ExportToClipboard bool
Overwrite bool
Relations string
CodeOnly bool
UseDemo bool
ConfigFilePath string
ProjectFilePath string
RunInteractively bool
BasePath string // BasePath is the base path for the project
Verbose bool // If Verbose is true, then the generator will print more information
ModelPath string // ModelPath is the path to the model file
}
type CodeImportModel ¶
type CodeImportModel struct {
Creator CreatorImportModel
OmitSourcePrefix bool
CurrentDate time.Time
GlobalVariablePrefix string
GlobalVariablePostfix string
CanInject bool
Inject map[string]CodeInjectImportModel
Types map[string]CodeTypeImportModel
Imports []string
Language string
}
type CodeInjectImportModel ¶
type CodeTemplate ¶
type CodeTemplate struct {
Name string //derived
Version string `yaml:"version"` //Version denotes the version used for the template
Language string `yaml:"language"`
Identifier string `yaml:"identifier"`
Key string `yaml:"key"`
Type string `yaml:"type"`
Description string `yaml:"description"`
Short string `yaml:"short"`
Tags []string `yaml:"tags"`
Features []string `yaml:"features"`
FileName string `yaml:"fileName"`
Model string `yaml:"model"`
Body string `yaml:"body"`
BodyFile string `yaml:"bodyFile"`
TemplateFilePath string
}
CodeTemplate represent the full structure of a code template
type CodeTemplateListOptions ¶
type CodeTypeImportModel ¶
type Column ¶
type Column struct {
ID int
ColumnIndex int
Name string
PropertyName string
DbType string
DataType string
Collation string
IsPrimaryKey bool
IsForeignKey bool
IsNullable bool
IsIdentity bool
IsIgnored bool
IsCreatedByUser bool
IsCreatedDate bool
IsModifiedByUser bool
IsModifiedDate bool
IsDeletedMarker bool
Precision int
Scale int
Length int
UsePrecision bool
UseLength bool
UseInViewModel bool
IsReserved bool
ReferencesTable string
ReferencesColumn string
Description string
ContextualName string
ForCreate string
}
Column represents the column of an entity, either a table or a view
type ColumnList ¶
type ColumnList []Column
type CommitHistory ¶
type CommitHistoryOptions ¶
type CommitModel ¶
type CommitModel struct {
Name string
RootNamespace string
Namespace string
Postfix string
Prefix string
ModuleLevelVariablePrefix string
Inject []InjectSection
Imports []string
Project ProjectSection
Feature FeatureModel
Developer DeveloperSection
Options map[string]string
PageHeader string
IsConventialCommits bool
Features []Commit
Refactors []Commit
HasFeatures bool
HasRefactors bool
HasFixes bool
HasAuthors bool
HasBreakingChanges bool
Fixes []Commit
Docs []Commit
Performance []Commit
Tests []Commit
Builds []Commit
Ci []Commit
Chores []Commit
Reverts []Commit
BreakingChanges []Commit
AllConventionalCommits map[string][]Commit
Authors map[string]Author
}
type CommonProjectFeature ¶
type CommonProjectFeature struct {
Namespace string `yaml:"namespace"`
Use bool `yaml:"use"`
Options map[string]string `yaml:"options,omitempty"`
Imports []string `yaml:"imports,omitempty"`
PropertyName *string `yaml:"propertyName,omitempty"`
Type *string `yaml:"type,omitempty"`
Inject *bool `yaml:"inject,omitempty"`
Library *string `yaml:"library,omitempty"`
}
type Config ¶
type Config struct {
// ConfigVersion gets the version that this configuration file is using.
ConfigVersion string `json:"configVersion" yaml:"configVersion"`
AppVersion string `json:"appVersion" yaml:"appVersion"`
// Connections map[string]Connection `json:"connections" yaml:"connections"`
DefaultConnection string `json:"defaultConnection" yaml:"defaultConnection"`
DefaultEditor string `json:"editor" yaml:"editor"`
Developer Developer `json:"developer" yaml:"developer"`
Port int `json:"port" yaml:"port"`
Code Code `json:"code" yaml:"code"`
Templates struct {
Database []string `json:"database" yaml:"database"`
Code []string `json:"code" yaml:"code"`
Project []string `json:"project" yaml:"project"`
} `json:"templates" yaml:"templates"`
Languages struct {
Definitions string `json:"definitions" yaml:"definitions"`
} `json:"languages" yaml:"languages"`
Logging struct {
Enabled bool `json:"enabled" yaml:"enabled"`
} `json:"logging" yaml:"logging"`
//DirectoryName is pointing to where the config file lives on the system.
//This is set at runtime
DirectoryName string
}
type Connection ¶
type Connection struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description,omitempty"`
ConnectionString string `json:"connectionString" yaml:"connectionString"`
Schema string `json:"schema" yaml:"schema"`
Database string `json:"database,omitempty" yaml:"database,omitempty"`
Server string `json:"server,omitempty" yaml:"server,omitempty"`
Type string `json:"type" yaml:"type"`
Port int `json:"port,omitempty" yaml:"port,omitempty"`
Entities []string `json:"entities,omitempty" yaml:"entities,omitempty"`
Groups map[string]ConnectionGroup `json:"groups,omitempty" yaml:"groups,omitempty"`
Options map[string]interface{} `json:"options,omitempty" yaml:"options,omitempty"`
Synonyms map[string]string `json:"synonyms,omitempty" yaml:"synonyms,omitempty"`
}
type ConnectionGroup ¶
type ConnectionGroup struct {
Items []string `json:"items" yaml:"items"`
Options map[string]interface{} `json:"options" yaml:"options"`
}
should be renamed should this be in the input source package, since it's shared among project, config and other input sources
type ConnectionList ¶
type ConnectionList struct {
Name string `json:"name" yaml:"name"`
Type string `json:"type" yaml:"type"`
Description string `json:"description" yaml:"description,omitempty"`
ConnectionString string `json:"connectionString" yaml:"connectionString"`
Groups map[string]ConnectionGroup `json:"groups,omitempty" yaml:"groups,omitempty"`
Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"`
Synonyms map[string]string `json:"synonyms,omitempty" yaml:"synonyms,omitempty"`
Path string
IsDefault bool
}
type CreatorImportModel ¶
type CustomModel ¶
type CustomModel struct {
Custom interface{}
RootNamespace string
Namespace string
Postfix string
Prefix string
ModuleLevelVariablePrefix string
Inject []InjectSection
Imports []string
Project ProjectSection
Developer DeveloperSection
Options map[string]string
PageHeader string
Feature FeatureModel
}
CustomModel represents the model for the custom template
type DatabaseInformation ¶
type Datatype ¶
type Datatype struct {
Key string `json:"key" yaml:"key"`
NotNull string `json:"notNull" yaml:"notNull"`
Nullable string `json:"nullable" yaml:"nullable"`
NullableAlternative string `json:"nullableAlternative" yaml:"nullableAlternative"`
DefaultValue interface{} `json:"defaultValue" yaml:"defaultValue"`
}
type DbFeatureOptions ¶
type DeveloperSection ¶
type Entity ¶
type Entity struct {
Name string `json:"name" yaml:"name"`
ModelName string `json:"modelName" yaml:"modelName"`
ContextualName string `json:"contextualName" yaml:"contextualName"`
Type string `json:"type" yaml:"type"`
Schema string `json:"schema" yaml:"schema"`
Alias string `json:"alias" yaml:"alias"`
Synonym string
HasSynonym bool
RowCount int
UsesIdentityColumn bool
UsesDeletedColumn bool
DeletedColumnName string
Columns ColumnList
ParentRelations []Relation
ChildRelations []Relation
Indexes []Index
Description string
ParentRelationCount int
ChildRelationCount int
ColumnCount int
IdentityColumnCount int
NullableColumnCount int
IsVersioned bool
IsHistory bool
HistoryTable string
}
Entity represents an object in the relational database. Either a Table or a view
type EntityColumnImportModel ¶
type EntityColumnImportModel struct {
Description string
IsForeignKey bool
IsPrimaryKey bool
IsIdentity bool
IsNullable bool
IsIgnored bool
IsDeletedMarker bool
IsCreatedDate bool
IsCreatedByUser bool
IsModifiedDate bool
IsModifiedByUser bool
HasPrefix bool
HasDescription bool
Name string
// PropertyName string
// ContextualName string
NameWithoutPrefix string
Collation string
ReferencesColumn string
ReferencesTable string
DataType string
DbType string
Length int
Precision int
Scale int
UseLength bool
UsePrecision bool
UseInViewModel bool
ForCreate string
}
type EntityColumnModel ¶
type EntityColumnModel struct {
Description string
IsForeignKey bool
IsPrimaryKey bool
IsIdentity bool
IsNullable bool
IsIgnored bool
IsDeletedMarker bool
IsCreatedDate bool
IsCreatedByUser bool
IsModifiedDate bool
IsModifiedByUser bool
HasPrefix bool
HasDescription bool
Name string
NameWithoutPrefix string
Collation string
ReferencesColumn string
ReferencesTable string
DataType string
Length int
Precision int
Scale int
UseLength bool
UsePrecision bool
ForCreate string
IsLast bool
IsFirst bool
}
type EntityColumnProps ¶
type EntityImportModel ¶
type EntityImportModel struct {
Code CodeImportModel
Options map[string]string
Name string
Schema string
Type string
RowCount int
Created string
Alias string
Description string
HasDescription bool
HasPrefix bool
NameWithoutPrefix string
Columns []EntityColumnImportModel
NonPrimaryColumns []EntityColumnImportModel
Parents []EntityRelation
Children []EntityRelation
// ModelName string
// ContextualName string
NonIgnoredColumns []EntityColumnImportModel
IgnoredColumns []EntityColumnImportModel
PrimaryKeys []EntityColumnImportModel
ForeignKeys []EntityColumnImportModel
UsedAsColumns []EntityColumnImportModel
UsesIdentityColumn bool
}
type EntityList ¶
type EntityList []Entity
func (*EntityList) Header ¶
func (d *EntityList) Header() []string
func (*EntityList) Rows ¶
func (d *EntityList) Rows() [][]string
type EntityListModel ¶
type EntityListModel struct {
RootNamespace string
Namespace string
Postfix string
Prefix string
ModuleLevelVariablePrefix string
Inject []InjectSection
Imports []string
Project ProjectSection
Feature FeatureModel
Developer DeveloperSection
Options map[string]string
PageHeader string
// special for entitylist
Entities []EntityModel
}
type EntityModel ¶
type EntityModel struct {
ConnectionType string
RootNamespace string
Namespace string
Postfix string
Prefix string
ModuleLevelVariablePrefix string
Inject []InjectSection
Imports []string
Project ProjectSection
Developer DeveloperSection
Options map[string]string
Feature FeatureModel
PageHeader string
Name string
Schema string
Type string
Alias string
Synonym string
HasSynonym bool
ModelName string
Description string
HasDescription bool
HasPrefix bool
NameWithoutPrefix string
Columns []EntityColumnModel
Parents []EntityRelationModel
HasParents bool
Children []EntityRelationModel
HasChildren bool
NonPrimaryColumns []EntityColumnModel
PrimaryKeys []EntityColumnModel
ForeignKeys []EntityColumnModel
UsedAsColumns []EntityColumnModel
UsesIdentityColumn bool
}
type EntityRelation ¶
type EntityRelation struct {
IsSelfJoin bool
ReleatedColumn EntityColumnProps
IncomingRelation EntityColumnProps
OwnerColumn EntityColumnProps
ForeignColumn EntityColumnProps
// GroupIndex int
Name string
Schema string
Type string
Alias string
Description string
HasDescription bool
HasPrefix bool
NameWithoutPrefix string
// Columns []EntityColumnImportModel
// NonIgnoredColumns []EntityColumnImportModel
// IgnoredColumns []EntityColumnImportModel
// PrimaryKeys []EntityColumnImportModel
// ForeignKeys []EntityColumnImportModel
// UsedAsColumns []EntityColumnImportModel
UsesIdentityColumn bool
}
type EntityRelationModel ¶
type EntityRelationModel struct {
IsSelfJoin bool
RelatedColumn EntityColumnProps // this is either the child or parent in the relation
OwnerColumn EntityColumnProps // this is always the current entity
OwnerShcema string
OwnerName string
Name string
Schema string
Type string
Alias string
Synonym string
HasSynonym bool
ModelName string
Description string
HasDescription bool
HasPrefix bool
NameWithoutPrefix string
Columns []EntityColumnModel
NonPrimaryColumns []EntityColumnModel
PrimaryKeys []EntityColumnModel
ForeignKeys []EntityColumnModel
UsedAsColumns []EntityColumnModel
// NonIgnoredColumns []EntityColumnImportModel
// IgnoredColumns []EntityColumnImportModel
// PrimaryKeys []EntityColumnImportModel
// ForeignKeys []EntityColumnImportModel
// UsedAsColumns []EntityColumnImportModel
UsesIdentityColumn bool
}
type EntityStat ¶
type FeatureModel ¶
type FeatureModel struct {
UseLogger bool
UseTracing bool
UseMetrics bool
UseHealth bool
UseApi bool
UseDb bool
UseAuth bool
UseSwagger bool
Logger FeatureOptions
Tracing FeatureOptions
Metrics FeatureOptions
Health FeatureOptions
Api FeatureOptions
Db DbFeatureOptions
Auth FeatureOptions
Swagger FeatureOptions
}
FeatureModel represents the features that can be used in the project If a feature is configured in the project config file, it will be set to true and the code generation will use the features to generate the code
type FeatureOptions ¶
type FeatureSet ¶
type FeatureSet struct {
Auth *CommonProjectFeature `yaml:"auth,omitempty"`
Logger *CommonProjectFeature `yaml:"logger,omitempty"`
Tracing *CommonProjectFeature `yaml:"tracing,omitempty"`
Swagger *CommonProjectFeature `yaml:"swagger,omitempty"`
Metrics *CommonProjectFeature `yaml:"metrics,omitempty"`
Health *CommonProjectFeature `yaml:"health,omitempty"`
Api *CommonProjectFeature `yaml:"api,omitempty"`
Db *CommonProjectFeature `yaml:"db,omitempty"`
}
type FileConnection ¶
type FileConnection struct {
Location string `json:"location" yaml:"location"`
}
type GenericConnection ¶
type GenericConnection[T GenericConnectionType] struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description,omitempty"` Type string `json:"type" yaml:"type"` Connection T `json:"connection" yaml:"connection"` Groups map[string]ConnectionGroup `json:"groups,omitempty" yaml:"groups,omitempty"` Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"` Synonyms map[string]string `json:"synonyms,omitempty" yaml:"synonyms,omitempty"` Path string IsDefault bool }
type GenericConnectionType ¶
type GenericConnectionType interface {
MsSqlConnection | FileConnection | PostgresConnection
}
type Index ¶
type Index struct {
ID string
Name string
Size float32
AvgFragmentationPercent float32
IsClustered bool
IsPrimaryKey bool
IsUnique bool
AvgPageSpacePercent float32
AvgRecordSize float32
Rows float32
Columns []IndexColumn
}
Index represents the index of a table
type IndexColumn ¶
type InjectSection ¶
type LanguageDefinition ¶
type LanguageDefinition struct {
Version string `json:"version" yaml:"version"`
Language string `json:"language" yaml:"language"`
DataTypes map[string]Datatype `json:"datatypes" yaml:"datatypes"`
DefaultImports []string `json:"defaultImports" yaml:"defaultImports"`
Keys map[string]Key `json:"keys" yaml:"keys"`
Inject map[string]Inject `json:"inject" yaml:"inject"`
Global Global `json:"global" yaml:"global"`
Short string `json:"short" yaml:"short"`
Description string `json:"description" yaml:"description"`
Path string
}
type MsSqlConnection ¶
type MsSqlConnection struct {
ConnectionString string `json:"connectionString" yaml:"connectionString"`
Schema string `json:"schema" yaml:"schema"`
Database string `json:"database,omitempty" yaml:"database,omitempty"`
Server string `json:"server,omitempty" yaml:"server,omitempty"`
Port int `json:"port,omitempty" yaml:"port,omitempty"`
Entities []string `json:"entities,omitempty" yaml:"entities,omitempty"`
}
type NameModel ¶
type NameModel struct {
Name string
RootNamespace string
Namespace string
Postfix string
Prefix string
ModuleLevelVariablePrefix string
Inject []InjectSection
Imports []string
Project ProjectSection
Developer DeveloperSection
Options map[string]string
PageHeader string
Feature FeatureModel
}
NameModel represents the model for the name template If the templates model is set to name, the code generation will use this model
type OpenAPIConnection ¶
type OpenAPIConnection struct {
URL string `json:"url" yaml:"url"`
}
type PostgresConnection ¶
type PostgresConnection struct {
ConnectionString string `json:"connectionString" yaml:"connectionString"`
Schema string `json:"schema" yaml:"schema"`
Database string `json:"database,omitempty" yaml:"database,omitempty"`
Server string `json:"server,omitempty" yaml:"server,omitempty"`
Port int `json:"port,omitempty" yaml:"port,omitempty"`
Entities []string `json:"entities,omitempty" yaml:"entities,omitempty"`
}
type ProjectConfig ¶
type ProjectConfig struct {
Version string `yaml:"version"`
Name string `yaml:"name"`
Language string `yaml:"language"`
Description string `yaml:"description"`
OwnerName string `yaml:"ownerName,omitempty"`
DefaultKey string `yaml:"defaultKey,omitempty"`
DefaultSource string `yaml:"defaultSource,omitempty"`
RootNamespace string `yaml:"rootNamespace,omitempty"`
Features *FeatureSet `yaml:"features,omitempty"`
CustomFeatures map[string]CommonProjectFeature `yaml:"customFeatures,omitempty"`
Setup map[string]Key `yaml:"setup,omitempty"`
Inject map[string]Inject `yaml:"inject,omitempty"`
Options map[string]string `yaml:"options,omitempty"`
Custom interface{} `yaml:"custom,omitempty"`
UseHeader bool `yaml:"useFileHeader"`
Header string `yaml:"header,omitempty"`
Locations map[string]string `yaml:"locations"`
Directory string
}
type ProjectSection ¶
type ProjectTemplate ¶
type ProjectTemplate struct {
TemplateVersion string `json:"templateVersion" yaml:"templateVersion"`
Version string `yaml:"version"`
Name string `yaml:"name"`
Language string `yaml:"language"`
Description string `yaml:"description,omitempty"`
RootDirectory string `json:"rootDirectory" yaml:"rootDirectory"`
Sources []string `json:"sources,omitempty" yaml:"sources"`
// {
// Input string `json:"input" yaml:"input"`
// Destination string `json:"destination" yaml:"destination"`
// }
// Options map[string]string `yaml:"options,omitempty"`
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
Commands []ProjectTemplateCommand `json:"commands,omitempty" yaml:"commands,omitempty"`
Wizard []ProjectTemplateInput `json:"wizard,omitempty" yaml:"wizard,omitempty"`
TemplateFilePath string `json:"templateFilePath,omitempty" yaml:"templateFilePath,omitempty"`
TemplateFileName string `json:"templateFileName,omitempty" yaml:"templateFileName,omitempty"`
}
type ProjectTemplateCommand ¶
type ProjectTemplateInput ¶
type ProjectTemplateInput struct {
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Type string `json:"type" yaml:"type"`
Returns string `json:"returns" yaml:"returns"`
Commands []ProjectTemplateCommand `json:"commands" yaml:"commands"`
}
type ProjectTemplateModel ¶
type Relation ¶
type Relation struct {
GroupIndex int
Name string
Schema string
Type string
SortIndex int
Depth int
Family string
OwnerColumnName string
OwnerColumnType string
OwnerColumnNullable bool
ColumnName string
ColumnType string
ColumnNullable bool
ContraintName string
IsSelfJoin bool
HasSynonym bool
Synonym string
Columns []Column
}
type RelationList ¶
type RelationList []Relation
type SecretEntry ¶
type SourceFile ¶
type SourceListOptions ¶
type TableRelation ¶
type TemplateGeneratorResult ¶
type TemplateGeneratorResult struct {
Statistics TemplateGeneratorStatistics
Body []byte
}
type TemplateGeneratorSnippetResult ¶
type TemplateGeneratorSnippetResult struct {
Identifer string
Result *TemplateGeneratorResult
}
type TextTemplate ¶
type TextTemplate struct {
Template string
}