Documentation
¶
Index ¶
- func Run(ac application.Context, args []string) error
- type BuildingContext
- type CodeBuilder
- type CodeTemplate
- type CodeTemplateFactory
- type Com1
- type ComExample
- type ComplexTypeBuilder
- type ComponentInfo
- type ComponentInfoTable
- type Context
- type DirectoryScanner
- type Dom1builder
- type Dom1doc
- type Dom1field
- type Dom1import
- type Dom1root
- type Dom1struct
- type Dom2Builder
- type Dom2component
- type Dom2injection
- type Dom2root
- type FieldTagReader
- type ImportManager
- type Runner
- type SourceCodeBuilder
- type SourceFileScanner
- type TemplateCodeBuilderBase
- func (inst *TemplateCodeBuilderBase) AddChild(name string, child CodeTemplate)
- func (inst *TemplateCodeBuilderBase) AddComputed(name string, fn func(ctx *BuildingContext) (string, error))
- func (inst *TemplateCodeBuilderBase) BuildFromTemplate(ctx *BuildingContext) (string, error)
- func (inst *TemplateCodeBuilderBase) Init(ctx application.Context) error
- func (inst *TemplateCodeBuilderBase) LoadTemplate(ctx application.Context, path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildingContext ¶
type BuildingContext struct {
DOM *Dom2root
Component *Dom2component
Injection *Dom2injection
}
func (*BuildingContext) NewChild ¶
func (inst *BuildingContext) NewChild() *BuildingContext
type CodeBuilder ¶
type CodeTemplate ¶
type CodeTemplate interface {
Build(ctx *BuildingContext) (string, error)
}
type CodeTemplateFactory ¶
type CodeTemplateFactory interface {
Create(ctx application.Context) (CodeTemplate, error)
}
type Com1 ¶
type Com1 struct {
markup.Component `id:"foo" class:"bar"`
// 约定:大写开头的字段为直接(自动)注入字段
Pool lang.Disposable `inject:"#pool"`
Name string `inject:"${abc}"`
// contains filtered or unexported fields
}
func (*Com1) Com1injector ¶
func (inst *Com1) Com1injector(ctx application.Context) error
type ComExample ¶
type ComExample struct {
Name string
Pool lang.Disposable ` a:"x" b:"y" `
Context application.Context
}
type ComplexTypeBuilder ¶
type ComplexTypeBuilder struct {
// contains filtered or unexported fields
}
func (*ComplexTypeBuilder) FindPackageAliases ¶
func (inst *ComplexTypeBuilder) FindPackageAliases() []int
func (*ComplexTypeBuilder) GetPart ¶
func (inst *ComplexTypeBuilder) GetPart(index int) string
func (*ComplexTypeBuilder) Init ¶
func (inst *ComplexTypeBuilder) Init(typeStr string)
func (*ComplexTypeBuilder) SetPart ¶
func (inst *ComplexTypeBuilder) SetPart(index int, value string)
func (*ComplexTypeBuilder) String ¶
func (inst *ComplexTypeBuilder) String() string
type ComponentInfo ¶
type ComponentInfoTable ¶
type ComponentInfoTable interface {
Add(com *ComponentInfo)
All() []*ComponentInfo
}
type Context ¶
type Context struct {
PWD fs.Path
InputFile fs.Path // the 'configen.properties'
OutputFile fs.Path // the 'auto_generated_by_starter_configen.go'
ConfigenVersion string // 'configen.version'='v2'
DryRun bool
AppContext application.Context
Dom2Builder Dom2Builder
CodeBuilder CodeBuilder
DirectoryScanner DirectoryScanner
SourceFileScanner SourceFileScanner
ComTable ComponentInfoTable
Imports ImportManager
DOM1 Dom1root
DOM2 Dom2root
OutputSourceCode string
}
type DirectoryScanner ¶
type Dom1builder ¶
type Dom1builder interface {
SetPackageName(string)
AddImport(*Dom1import)
AddStruct(*Dom1struct)
}
type Dom1doc ¶
type Dom1doc struct {
PackageName string
ImportList []*Dom1import
ComList []*Dom1struct
}
type Dom1import ¶
type Dom1struct ¶
type Dom2Builder ¶
type Dom2component ¶
type Dom2component struct {
StructName string
Attributes map[string]string
InjectionMap map[string]*Dom2injection
ID string
Class string
Scope string
Aliases string
ComType string
// do://inject@injection
InjectionMainMethod string
// do://inject@instance (optional)
InjectMethod string
InitMethod string
DestroyMethod string
}
type Dom2injection ¶
type Dom2root ¶
type Dom2root struct {
PackageName string
Imports map[string]string // map[ path ] alias
Components map[string]*Dom2component // map[com_name] com
}
type FieldTagReader ¶
type FieldTagReader struct {
// contains filtered or unexported fields
}
type ImportManager ¶
type SourceCodeBuilder ¶
type TemplateCodeBuilderBase ¶
type TemplateCodeBuilderBase struct {
Context application.Context
// contains filtered or unexported fields
}
func (*TemplateCodeBuilderBase) AddChild ¶
func (inst *TemplateCodeBuilderBase) AddChild(name string, child CodeTemplate)
func (*TemplateCodeBuilderBase) AddComputed ¶
func (inst *TemplateCodeBuilderBase) AddComputed(name string, fn func(ctx *BuildingContext) (string, error))
func (*TemplateCodeBuilderBase) BuildFromTemplate ¶
func (inst *TemplateCodeBuilderBase) BuildFromTemplate(ctx *BuildingContext) (string, error)
func (*TemplateCodeBuilderBase) Init ¶
func (inst *TemplateCodeBuilderBase) Init(ctx application.Context) error
func (*TemplateCodeBuilderBase) LoadTemplate ¶
func (inst *TemplateCodeBuilderBase) LoadTemplate(ctx application.Context, path string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.