Documentation
¶
Index ¶
- func ParseTypeName(typeName string) (pkg string, name string)
- type ASTHelper
- func (u *ASTHelper) FindFileByFilename(pkg *packages.Package, filename string) *ast.File
- func (u *ASTHelper) FindType(typ string) *ASTType
- func (u *ASTHelper) FindTypeInFile(pkg *packages.Package, file *ast.File, name string) *ASTType
- func (u *ASTHelper) FindTypeInFilePath(pkg *packages.Package, filename string, name string) *ASTType
- func (u *ASTHelper) FindTypeInPackage(pkg *packages.Package, name string) *ASTType
- func (u *ASTHelper) FindTypeWithError(typ string) (*ASTType, error)
- func (u *ASTHelper) FindTypes(types ...string) (ASTTypeList, error)
- func (u *ASTHelper) ToTypes(pkg *packages.Package, node ast.Node) types.Object
- type ASTType
- type ASTTypeList
- type DataWithPackage
- type Generator
- func (g *Generator) ASTHelper() *ASTHelper
- func (g *Generator) FindPackageByPath(pkgPath string) *packages.Package
- func (g *Generator) GoFile() string
- func (g *Generator) GoLine() int
- func (g *Generator) GoPackage() string
- func (g *Generator) IsGoGenerateLine(node ast.Node) bool
- func (g *Generator) Packages() []*packages.Package
- func (g *Generator) Patterns() []string
- func (g *Generator) Root() *Root
- func (g *Generator) RootDir() string
- func (g *Generator) RootPackage() *packages.Package
- func (g *Generator) TypesHelper() *TypesHelper
- type Option
- func WithAddRootPattern(addRoot bool) Option
- func WithDefaultValues(goPackage string, goFile string, goLine int) Option
- func WithDefaults() Option
- func WithPackagesConfig(config *packages.Config) Option
- func WithPatterns(patterns ...string) Option
- func WithRootDir(rootDir string) Option
- func WithRootRequired(required bool) Option
- type Root
- type TypesHelper
- func (u *TypesHelper) FindType(typ string) *TypesType
- func (u *TypesHelper) FindTypeWithError(typ string) (*TypesType, error)
- func (u *TypesHelper) FindTypes(types ...string) (TypesList, error)
- func (u *TypesHelper) ToAST(obj types.Object) (*ASTType, error)
- func (u *TypesHelper) ToPackage(pkg *types.Package) *packages.Package
- type TypesList
- type TypesType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTypeName ¶
Types ¶
type ASTHelper ¶
type ASTHelper struct {
// contains filtered or unexported fields
}
func NewASTHelper ¶
func (*ASTHelper) FindFileByFilename ¶
func (*ASTHelper) FindTypeInFile ¶
func (*ASTHelper) FindTypeInFilePath ¶
func (*ASTHelper) FindTypeInPackage ¶
func (*ASTHelper) FindTypeWithError ¶
type ASTTypeList ¶
type ASTTypeList []*ASTType
func (ASTTypeList) ByPackage ¶
func (l ASTTypeList) ByPackage() []*DataWithPackage[[]*ASTType]
func (ASTTypeList) Named ¶
func (l ASTTypeList) Named(name string) *ASTType
type DataWithPackage ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func (*Generator) FindPackageByPath ¶
func (*Generator) RootPackage ¶
func (*Generator) TypesHelper ¶
func (g *Generator) TypesHelper() *TypesHelper
type Option ¶
func WithAddRootPattern ¶
func WithDefaults ¶
func WithDefaults() Option
func WithPackagesConfig ¶
func WithPatterns ¶
func WithRootDir ¶
func WithRootRequired ¶
type TypesHelper ¶
type TypesHelper struct {
// contains filtered or unexported fields
}
func NewTypesHelper ¶
func NewTypesHelper(g *Generator) *TypesHelper
func (*TypesHelper) FindType ¶
func (u *TypesHelper) FindType(typ string) *TypesType
func (*TypesHelper) FindTypeWithError ¶
func (u *TypesHelper) FindTypeWithError(typ string) (*TypesType, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.