Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportPathFromSelector ¶
func ImportPathFromSelector(it *ast.SelectorExpr) (path string, name string, err error)
ImportPathFromSelector gives us a path and a selector like for some pkg.SomeStruct
Types ¶
type Importer ¶
type Importer func(path string) (PackageInfo, error)
Importer retrieves an object representing a package
func NewImporter ¶
NewImporter creates a memoizing function for importing packages
func (Importer) FindImportedTypeSpec ¶
func (importer Importer) FindImportedTypeSpec(it *ast.SelectorExpr) (importPath, typeName string, _ *ast.TypeSpec, _ error)
FindImportedTypeSpec takes a SelectorExpr `pkg.Struct` where `pkg` refers to an import and finds the corresponding TypeSpec
func (Importer) SearchEntryPackageForObj ¶
SearchEntryPackageForObj takes a name like SomeStruct and looks in the starting package
type PackageInfo ¶
type PackageInfo struct { Pkg *ast.Object Variants VariantMap }
PackageInfo holds all of the information we can understand about a package
type VariantMap ¶
VariantMap groups constants together under a name
Click to show internal directories.
Click to hide internal directories.