Documentation ¶
Index ¶
- func InjectDiDto(s *DiDto)
- func InjectDiInject(s *DiInject)
- func InjectFileInfoDto(s *FileInfoDto)
- func InjectStructInfo(s *StructInfo)
- func LoadDiDto() baseiface.ISingleton
- func LoadDiInject() baseiface.ISingleton
- func LoadFileInfoDto() baseiface.ISingleton
- func LoadStructInfo() baseiface.ISingleton
- type DiDto
- type DiInject
- func (this *DiInject) FilterInject() bool
- func (this *DiInject) IsRootBaseEntity() bool
- func (this *DiInject) IsStruct() bool
- func (di *DiInject) ParseTag(field *ast.Field)
- func (this *DiInject) SetInjectMod(isBaseEntity bool)
- func (this *DiInject) Tag2InjectMod()
- func (this *DiInject) ToInjectCode() string
- type DiParseFields
- func (this *DiParseFields) Parse(field *ast.Field) *DiInject
- func (this *DiParseFields) ParseArrayType(field *ast.Field, di *DiInject) bool
- func (this *DiParseFields) ParseIdent(field *ast.Field, di *DiInject) bool
- func (this *DiParseFields) ParseMapType(field *ast.Field, di *DiInject) bool
- func (this *DiParseFields) ParseName(field *ast.Field, di *DiInject) bool
- func (this *DiParseFields) ParseNoName(field *ast.Field, di *DiInject)
- func (this *DiParseFields) ParseSelectorExpr(field *ast.Field, di *DiInject) bool
- func (this *DiParseFields) ParseStarExpr(field *ast.Field, di *DiInject) bool
- type FileInfoDto
- type FuncDefine
- type StructInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InjectDiDto ¶
func InjectDiDto(s *DiDto)
func InjectDiInject ¶
func InjectDiInject(s *DiInject)
func InjectFileInfoDto ¶
func InjectFileInfoDto(s *FileInfoDto)
func InjectStructInfo ¶
func InjectStructInfo(s *StructInfo)
func LoadDiDto ¶
func LoadDiDto() baseiface.ISingleton
func LoadDiInject ¶
func LoadDiInject() baseiface.ISingleton
func LoadFileInfoDto ¶
func LoadFileInfoDto() baseiface.ISingleton
func LoadStructInfo ¶
func LoadStructInfo() baseiface.ISingleton
Types ¶
type DiDto ¶
type DiDto struct { basedto.BaseEntity //包名 FullPkg string `json:"fullPkg"` //NEW exist ExistNewFunc bool `json:"ExistNewFunc"` NewFuncName string `json:"NewFuncName"` //in PkgName string `json:"pkg_name"` StructName string `json:"struct_name"` PathFile string `json:"pathFile"` //output OutPath string `json:"out_path"` OutFile string `json:"out_file"` ImportedLibs []string `json:"importedLibs,omitempty"` DiInjects map[string]*DiInject `json:"diInjects,omitempty"` //可重新生成! ForceBuild bool `json:"force_build"` }
func (*DiDto) FindImportLib ¶
func (*DiDto) ToInjectCode ¶
func (*DiDto) ToInjectImportLib ¶
type DiInject ¶
type DiInject struct { basedto.BaseEntity InjectMod int `json:"injectMod"` //auto new bind Tag string `json:"tag"` InjectCode string `json:"injectCode"` GoType string `json:"goType"` ImportLib string `json:"importLib"` MemberName string `json:"memberName"` //multi MemberType string `json:"memberType"` //MultiEntity PkgName string `json:"pkgName"` //multi }
di inject member
func NewDiInject ¶
func NewDiInject() *DiInject
func (*DiInject) FilterInject ¶
func (*DiInject) IsRootBaseEntity ¶
func (*DiInject) SetInjectMod ¶
func (*DiInject) Tag2InjectMod ¶
func (this *DiInject) Tag2InjectMod()
func (*DiInject) ToInjectCode ¶
type DiParseFields ¶
type DiParseFields struct { }
func NewParseFields ¶
func NewParseFields() *DiParseFields
func (*DiParseFields) ParseArrayType ¶
func (this *DiParseFields) ParseArrayType(field *ast.Field, di *DiInject) bool
func (*DiParseFields) ParseIdent ¶
func (this *DiParseFields) ParseIdent(field *ast.Field, di *DiInject) bool
func (*DiParseFields) ParseMapType ¶
func (this *DiParseFields) ParseMapType(field *ast.Field, di *DiInject) bool
func (*DiParseFields) ParseName ¶
func (this *DiParseFields) ParseName(field *ast.Field, di *DiInject) bool
func (*DiParseFields) ParseNoName ¶
func (this *DiParseFields) ParseNoName(field *ast.Field, di *DiInject)
func (*DiParseFields) ParseSelectorExpr ¶
func (this *DiParseFields) ParseSelectorExpr(field *ast.Field, di *DiInject) bool
func (*DiParseFields) ParseStarExpr ¶
func (this *DiParseFields) ParseStarExpr(field *ast.Field, di *DiInject) bool
parse struct
type FileInfoDto ¶
type FileInfoDto struct { basedto.BaseEntity PathFile string `json:"path_file,omitempty"` FileContent string `json:"content,omitempty"` StructInfoMap map[string]*StructInfo `json:"struct_info_map,omitempty"` StructInfos []*StructInfo FuncDefines []*FuncDefine `json:"func_defines"` ImportedLibs []string `json:"importedLibs,omitempty"` Node *ast.File `json:"-"` }
func NewFileInfoDto ¶
func NewFileInfoDto() *FileInfoDto
func (*FileInfoDto) FindOf ¶
func (this *FileInfoDto) FindOf(Struname string) *StructInfo
func (*FileInfoDto) ParseNewFunc ¶
func (this *FileInfoDto) ParseNewFunc(Stru *StructInfo)
type FuncDefine ¶
type FuncDefine struct { StruName string Name string Params []*ast.Field `json:"-"` Results []*ast.Field `json:"-"` ParamsCount int ResultType string ParamNameType string }
func NewFuncDefine ¶
func NewFuncDefine(name string) *FuncDefine
type StructInfo ¶
type StructInfo struct { basedto.BaseEntity IsBaseEntiyStruct bool `json:"isBaseEntiyStruct"` *DiDto MethodNames []string `json:"methodNames,omitempty"` FuncDefines []*FuncDefine `json:"func_defines"` Fields []string `json:"fields"` }
func NewStructInfo ¶
func NewStructInfo() *StructInfo
func (*StructInfo) AddField ¶
func (s *StructInfo) AddField(fieldName string)
func (*StructInfo) AddMethodName ¶
func (s *StructInfo) AddMethodName(methodName string)
func (*StructInfo) CheckBaseEntity ¶
func (this *StructInfo) CheckBaseEntity() bool
func (*StructInfo) NewFuncNameDefault ¶
func (this *StructInfo) NewFuncNameDefault() string
func (*StructInfo) ParsePkgName ¶
func (s *StructInfo) ParsePkgName(rootdir, basepkg string)
Click to show internal directories.
Click to hide internal directories.