Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFuncMete ¶
func NewFuncMete(importCode string)
func NewImportMete ¶
func NewImportMete(importCode string)
func NewStructMete ¶
func NewStructMete(findStructName, importCode string)
Types ¶
type AstInjectionMeta ¶
type AstInjectionMeta struct { FilePath string ImportMetas []*ImportMeta StructMetas []*StructMeta FuncMetas []*FuncMeta }
func (*AstInjectionMeta) Inject ¶
func (vi *AstInjectionMeta) Inject() error
func (*AstInjectionMeta) RollBack ¶
func (vi *AstInjectionMeta) RollBack() error
func (*AstInjectionMeta) Walk ¶
func (vi *AstInjectionMeta) Walk() error
type FuncMeta ¶
type FuncMeta struct { InjectCode string //注入的代码 FuncName string //插入的方法 FuncPos int //插入的位置 Variables []string Symbol string IdentNames []string Parameters []interface{} // contains filtered or unexported fields }
Variables := IdentName.SelName(Parameters...) IdentName.SelName(Parameters...)
func (FuncMeta) GetParameters ¶
func (FuncMeta) GetSelector ¶
type ImportMeta ¶
type ImportMeta struct { InjectCode string ImportAlias string //导入别名 ImportPackage string //导入包路径 HasDone bool // contains filtered or unexported fields }
插入 import ImportAlias ImportPackage
func (*ImportMeta) RollBackImportSpec ¶
func (vi *ImportMeta) RollBackImportSpec(file *ast.File) ast.Visitor
type StructMeta ¶
type StructMeta struct { InjectCode string FindStructName string //在 struct FindStructName{ //插入 FieldName IdentName.SelName } FieldName string //元素别名 FieldIdent string //属性类型引用的包名 FieldType string //属性类型 FieldComment string //属性注释 // contains filtered or unexported fields }
插入 FieldName FieldType.SelName
func (*StructMeta) ToInjectCode ¶
func (vi *StructMeta) ToInjectCode() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.