Documentation ¶
Index ¶
- func CopyExamplesToHome() error
- func CopyTemplatesToHome() error
- func InstallNugetPackage(project_folder string, package_name string) error
- type CodeGen
- func (m *CodeGen) AddRequiredResource(requires Template)
- func (m *CodeGen) AddRequiredResources(requires []Template)
- func (m *CodeGen) Build(template_path string, schema_path string, ns string) error
- func (m *CodeGen) BuildTemplateDocs(template_path string, template_doc string, template_doc_menu string, ...) error
- func (m *CodeGen) BuildTemplatePath(file string) string
- func (m *CodeGen) GetTemplate(name string) []Template
- func (m *CodeGen) GetTemplates(template_names []string) []Template
- func (m *CodeGen) LoadFieldTemplate(template string, data Field) string
- func (m *CodeGen) LoadTemplate(template string) string
- func (m *CodeGen) LoadTemplates(template_path string) error
- type Data
- type Field
- func (m *Field) DisplayName() string
- func (m *Field) FlagExists(flag string) bool
- func (m *Field) FormatValue(prefix string, quote_value bool) string
- func (m *Field) FuncName() string
- func (m *Field) GetFlagParam(flag string, param_index int) string
- func (m *Field) GetOpt(flag string) interface{}
- func (m *Field) NoFlag(flag string) bool
- func (m *Field) OptExists(flag string) bool
- func (m *Field) PrivVarName() string
- func (m *Field) PubVarName() string
- func (m *Field) SafeName() string
- type Flag
- type FlagParamEnumsSchema
- type FlagParamSchema
- type FlagSchema
- type RootSchema
- type Schema
- func (m *Schema) DisplayName() string
- func (m *Schema) FlagExists(flag string) bool
- func (m *Schema) FuncName() string
- func (m *Schema) GetConstructors() []Field
- func (m *Schema) GetFieldsByFlag(flag string) []Field
- func (m *Schema) GetFlagParam(flag string, param_index int) string
- func (m *Schema) GetOpt(flag string) interface{}
- func (m *Schema) GetPrimaryKeys() []Field
- func (m *Schema) NoFlag(flag string) bool
- func (m *Schema) OptExists(flag string) bool
- func (m *Schema) PrivVarName() string
- func (m *Schema) PubVarName() string
- func (m *Schema) SafeName() string
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyExamplesToHome ¶
func CopyExamplesToHome() error
func CopyTemplatesToHome ¶
func CopyTemplatesToHome() error
func InstallNugetPackage ¶
Types ¶
type CodeGen ¶
type CodeGen struct { Output_folder string Templates []Template // contains filtered or unexported fields }
func (*CodeGen) AddRequiredResource ¶
func (*CodeGen) AddRequiredResources ¶
func (*CodeGen) BuildTemplateDocs ¶
func (m *CodeGen) BuildTemplateDocs(template_path string, template_doc string, template_doc_menu string, output_dir string) error
***************************************** Function to build documents for templates *****************************************
func (*CodeGen) BuildTemplatePath ¶
func (*CodeGen) GetTemplate ¶
func (*CodeGen) GetTemplates ¶
func (*CodeGen) LoadFieldTemplate ¶
func (*CodeGen) LoadTemplate ¶
func (*CodeGen) LoadTemplates ¶
*************************** Load the template resources ***************************
type Data ¶
type Data struct { RootNS string Templates *[]Template Template *Template RootSchema *RootSchema Schema *Schema NameSpaces map[string]string RegisterSingleton map[string]string RegisterRoute map[string]string Data Field }
func (*Data) AddNamespace ¶
func (*Data) AddSingleton ¶
func (*Data) GetTemplates ¶
type Field ¶
type Field struct { PrimaryKey bool `json:"primary_key" yaml:"primary_key"` Constructor bool `json:"constructor" yaml:"constructor"` Name string `json:"name" yaml:"name"` Type string `json:"type" yaml:"type"` Flags []Flag `json:"flags" yaml:"flags"` NotifyProperty []string `json:"notify_property" yaml:"notify_property"` InitValue interface{} `json:"init_value" yaml:"init_value"` InitValueRaw bool `json:"init_value_raw" yaml:"init_value_raw"` }
func (*Field) DisplayName ¶
func (*Field) FlagExists ¶
func (*Field) PrivVarName ¶
func (*Field) PubVarName ¶
type Flag ¶
type Flag struct { Name string `json:"name" yaml:"name"` Options interface{} `json:"options" yaml:"options"` }
type FlagParamEnumsSchema ¶
type FlagParamSchema ¶
type FlagParamSchema struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` DataType string `json:"data_type" yaml:"data_type"` ParamsEnums []FlagParamEnumsSchema `json:"param_enums" yaml:"param_enums"` Options string `json:"options" yaml:"options"` }
type FlagSchema ¶
type FlagSchema struct { FieldFlag bool `json:"field_flag" yaml:"field_flag"` Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` Params []FlagParamSchema `json:"params" yaml:"params"` Example string `json:"example" yaml:"example"` OptionsRequired bool `json:"options_required" yaml:"options_required"` }
type RootSchema ¶
type RootSchema struct { ProjectNameSpace string `json:"name_space" yaml:"name_space"` Resources []string `json:"resources" yaml:"resources"` Schemas []Schema `json:"schemas" yaml:"schemas"` }
func LoadScheme ¶
func LoadScheme(scheme_path string) (*RootSchema, error)
type Schema ¶
type Schema struct { Name string `json:"name" yaml:"name"` Templates []string `json:"templates" yaml:"templates"` Flags []Flag `json:"flags" yaml:"flags"` Fields []Field `json:"fields" yaml:"fields"` ReadOnly []Field `json:"read_only" yaml:"read_only"` }
func (*Schema) DisplayName ¶
func (*Schema) FlagExists ¶
func (*Schema) GetConstructors ¶
func (*Schema) GetFieldsByFlag ¶
func (*Schema) GetPrimaryKeys ¶
func (*Schema) PrivVarName ¶
func (*Schema) PubVarName ¶
type Template ¶
type Template struct { Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` TemplateFile string `json:"template_file" yaml:"template_file"` Output string `json:"output" yaml:"output"` NameSpace string `json:"name_space" yaml:"name_space"` ProcessTemplate bool `json:"process_template" yaml:"process_template"` SchemaTemplate bool `json:"schema_template" yaml:"schema_template"` DependsOn []string `json:"depends_on" yaml:"depends_on"` InjectTag string `json:"inject_tag" yaml:"inject_tag"` Backup bool `json:"backup" yaml:"backup"` RegisterSingleton string `json:"register_singleton" yaml:"register_singleton"` RegisterRoute string `json:"register_route" yaml:"register_route"` Flags []FlagSchema `json:"flags" yaml:"flags"` }
Click to show internal directories.
Click to hide internal directories.