models

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Commits int
	First   time.Time
	Last    time.Time
	Name    string
}

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 CodeInjectImportModel struct {
	Key          string
	Name         string
	TemplateKeys []string
	Group        string
	PropertyName string
	Interface    string
}

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 CodeTemplateListOptions struct {
	DatabaseType    string
	GroupBy         string
	FilterTypes     []string
	FilterLanguages []string
	FilterModels    []string
	FilterKeys      []string
	FilterGroups    []string
	HideColumns     map[string]bool
}

type CodeTypeImportModel

type CodeTypeImportModel struct {
	Key         string
	NamePostfix string
	NamePrefix  string
	NameSpace   string
	Imports     []string
}

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 Commit

type Commit struct {
	Message            string
	Type               string
	Scope              string
	Title              string
	When               time.Time
	Author             string
	Hash               string
	Body               string
	IsBreakingChange   bool
	BreakingChangeBody string
	References         []Reference
}

type CommitHistory

type CommitHistory struct {
	Name     string
	Messages map[string][]Commit
	Authors  map[string]Author
	Tags     []string
	From     time.Time
	To       time.Time
	Repo     string
}

type CommitHistoryOptions

type CommitHistoryOptions struct {
	StartFrom *string // date | tag | latest tag
	FromTag   *GitTag
	From      *time.Time
	Until     *time.Time
}

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 CreatorImportModel struct {
	CompanyName   string
	DeveloperName string
}

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 DatabaseInformation struct {
	Version    string
	ServerName string
}

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"`
	Imports             []string    `json:"imports" yaml:"imports"`                 // what the notNull type needs to be imported
	NullableImports     []string    `json:"nullableImports" yaml:"nullableImports"` // what the nullable type needs to be imported
}

type DbFeatureOptions

type DbFeatureOptions struct {
	PropertyName     string
	Prefix           string
	Postfix          string
	Namespace        string
	Type             string
	ConnectionMethod string
}

type Developer

type Developer struct {
	Name          string `json:"name" yaml:"name"`
	Email         string `json:"email" yaml:"email"`
	GitHubAccount string `json:"github" yaml:"github"`
}

type DeveloperSection

type DeveloperSection struct {
	Name  string
	Email string
}

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 EntityColumnProps struct {
	Name       string
	DataType   string
	IsNullable bool
}

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 EntityStat struct {
	Schema        string
	Name          string
	Description   string
	PkCount       int
	FkCount       int
	RowCount      int
	ColumnCount   int
	ChildrenCount int
	ParentCount   int
	IndexCount    int
	Size          int
}

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 FeatureOptions struct {
	PropertyName string
	Prefix       string
	Postfix      string
	Namespace    string
	Type         string
}

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 GitTag

type GitTag struct {
	Name    string
	Message string
	When    time.Time
	Hash    string
}

type Global

type Global struct {
	VariablePrefix  string `yaml:"variablePrefix"`
	VariablePostfix string `yaml:"variablePostfix"`
}

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 IndexColumn struct {
	Name              string
	IsDescending      bool
	IsNullable        bool
	IsIdentity        bool
	PartitionOriginal int
}

type IndexList

type IndexList []Index

type Inject

type Inject struct {
	Service      string   `json:"service" yaml:"service"`
	Name         string   `json:"name" yaml:"name"`
	PropertyName string   `json:"propertyName" yaml:"propertyName"`
	Method       string   `json:"method" yaml:"method"`
	Imports      []string `json:"imports" yaml:"imports"`
}

type InjectSection

type InjectSection struct {
	Name         string
	PropertyName string
}

type Key

type Key struct {
	Postfix   string   `json:"postfix" yaml:"postfix"`
	Prefix    string   `json:"prefix" yaml:"prefix"`
	Imports   []string `json:"imports" yaml:"imports"`
	Inject    []string `json:"inject" yaml:"inject"`
	Namespace string   `json:"namespace" yaml:"namespace"`
}

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"`
	ReservedWords  []string            `json:"reservedWords" yaml:"reservedWords"` // words that can not be used as a name, see the safe template function
	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 ProjectSection struct {
	Name    string
	Owner   string
	Version string
	Exists  bool
}

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 ProjectTemplateCommand struct {
	Name    string `json:"name" yaml:"name"`
	Command string `json:"command" yaml:"command"`
}

type ProjectTemplateCreateOptions

type ProjectTemplateCreateOptions struct {
	Name       string // admin API
	Template   string // admin API
	Prefix     string // stages
	RootName   string // stages
	Version    string // the application version
	SourcePath string // src/{ Name | kebab}
	RootPath   string
}

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 ProjectTemplateListOptions

type ProjectTemplateListOptions struct {
	GroupBy         string
	FilterLanguages []string
	FilterGroups    []string
}

type ProjectTemplateModel

type ProjectTemplateModel struct {
	Name       string // admin API
	Prefix     string // stages
	RootName   string // stages
	Version    string // the application version
	SourcePath string // src/{ Name | kebab}
	RootPath   string
}

type Reference

type Reference struct {
	Name string
	Id   string
}

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 SecretEntry struct {
	Key   string
	Value string
}

type SourceFile

type SourceFile struct {
	DirectoryName string
	RelativePath  string
	FileName      string
	IsDir         bool // a directory entry (FileName is empty), keeps empty folders from the template
	Snippets      []string
	Content       []byte
}

type SourceListOptions

type SourceListOptions struct {
	ConnectionName  string
	GroupBy         string
	FilterTypes     []string
	FilterLanguages []string
	FilterModels    []string
	FilterKeys      []string
	FilterGroups    []string
	IsDemo          bool
}

type Synonym

type Synonym struct {
	Name string
}

type TableRelation

type TableRelation struct {
	GroupIndex           int
	ConstraintName       string
	ParentColumnName     string
	ChildColumnName      string
	ParentColumnType     string
	ChildColumnType      string
	ParentColumnNullable bool
	ChildColumnNullable  bool
	IsSelfJoin           bool
}

type TemplateGeneratorFileResult

type TemplateGeneratorFileResult struct {
	Filename          string
	FilePath          string
	Result            *TemplateGeneratorResult
	Destination       string
	IsSnippet         bool
	SnippetIdentifier string
	Exists            bool
	Overwrite         bool
	ExistingBody      []byte
}

type TemplateGeneratorResult

type TemplateGeneratorResult struct {
	Statistics TemplateGeneratorStatistics
	Body       []byte
}

type TemplateGeneratorSnippetResult

type TemplateGeneratorSnippetResult struct {
	Identifer string
	Result    *TemplateGeneratorResult
}

type TemplateGeneratorStatistics

type TemplateGeneratorStatistics struct {
	FilesExported    int
	TemplatesUsed    int
	EntitiesUsed     int
	SnippetsInserted int
	FilesCreated     int
	SnippetsCreated  int
	Chars            int
	Lines            int
	Words            int
	Duration         time.Duration
	TimeSaved        int
}

type TextTemplate

type TextTemplate struct {
	Template string
}

Jump to

Keyboard shortcuts

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