Documentation ¶
Index ¶
- func ExportedFilter(tgt Target) bool
- func UniverseFilter(tgt Target) bool
- type Def
- type DefExtractor
- type DefNode
- type DefSet
- type DefSetExtractor
- type FieldSearcher
- type FieldSearcherBuilder
- type Filter
- type Node
- type NodeConfig
- type NodeInfo
- type NodeOption
- type NodeType
- type ObjExtractor
- type Object
- type Pkg
- type RefNode
- type RefPkgSearcher
- type RefSearcher
- type Target
- type TargetExtractor
- type TargetExtractorConfig
- type TargetExtractorOption
- type Use
- type UseSearcher
- type UseSearcherConfig
- type UseSearcherOption
- func WithUseSearcherIgnorePkgSelfloop(v bool) UseSearcherOption
- func WithUseSearcherIgnoreUseSelfloop(v bool) UseSearcherOption
- func WithUseSearcherObjNameRegexp(v util.RegexpPair) UseSearcherOption
- func WithUseSearcherPkgNameRegexp(v util.RegexpPair) UseSearcherOption
- func WithUseSearcherResultBufferSize(v int) UseSearcherOption
- func WithUseSearcherSearchForeign(v bool) UseSearcherOption
- func WithUseSearcherSearchPrivate(v bool) UseSearcherOption
- func WithUseSearcherSearchUniverse(v bool) UseSearcherOption
- func WithUseSearcherWorkerNum(v int) UseSearcherOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportedFilter ¶
ExportedFilter selects an exported target.
Types ¶
type Def ¶
type Def interface { ValueSpecs() []*ast.ValueSpec // var, const, field FuncDecls() []*ast.FuncDecl // func, method TypeSpecs() []*ast.TypeSpec // type alias, defined type // Iterate visits all specs and decls until given function returns false. Iterate(func(ast.Node) bool) }
Def is a set of the top level definitions of a package.
type DefExtractor ¶
func NewDefExtractor ¶
func NewDefExtractor() DefExtractor
type DefSetExtractor ¶
func NewDefSetExtractor ¶
func NewDefSetExtractor(extractor DefExtractor) DefSetExtractor
type FieldSearcher ¶
func NewFieldSearcher ¶
func NewFieldSearcher(pkgs []*types.Package) FieldSearcher
func NewFieldSearcherFromPackages ¶
func NewFieldSearcherFromPackages(pkgs []*packages.Package) FieldSearcher
type FieldSearcherBuilder ¶
type FieldSearcherBuilder interface { Add(*types.Package) Build() FieldSearcher }
func NewFieldSearcherBuilder ¶
func NewFieldSearcherBuilder() FieldSearcherBuilder
type Filter ¶
Filter selects a target.
func DefSetFilter ¶
DefSetFilter selects a target belongs to the defs.
func ObjectNameFilter ¶
func ObjectNameFilter(pair util.RegexpPair) Filter
ObjectNameFilter selects a target whose object name matched.
func OtherPkgFilter ¶
OtherPkgFilter selects a target whose package name is not matched with given packages.
func PkgNameFilter ¶
func PkgNameFilter(pair util.RegexpPair) Filter
PkgNameFilter selects a target whose package name matched.
type NodeConfig ¶
type NodeConfig struct {
// contains filtered or unexported fields
}
type NodeOption ¶
type NodeOption func(*NodeConfig)
func WithNodeRawRecv ¶
func WithNodeRawRecv(v bool) NodeOption
type ObjExtractor ¶
type ObjExtractor interface { // Extract extracts an object with the ident. Extract(pkg *packages.Package, ident *ast.Ident) (Object, bool) }
func NewObjExtractor ¶
func NewObjExtractor() ObjExtractor
type Object ¶
type Object interface { Parent() *types.Scope Pos() token.Pos Pkg() *types.Package Name() string Type() types.Type Exported() bool Id() string }
Object is the set of the public methods of types.Object.
type RefPkgSearcher ¶
func NewRefPkgSearcher ¶
func NewRefPkgSearcher(searcher RefSearcher, defSets []DefSet) RefPkgSearcher
type RefSearcher ¶
type RefSearcher interface { // Search returns a node if the pos is contained in the node. Search(defSet DefSet, pos token.Pos) (node ast.Node, found bool) }
func NewRefSearcher ¶
func NewRefSearcher() RefSearcher
type TargetExtractor ¶
func NewTargetExtractor ¶
func NewTargetExtractor(opt ...TargetExtractorOption) TargetExtractor
type TargetExtractorConfig ¶
type TargetExtractorConfig struct {
// contains filtered or unexported fields
}
type TargetExtractorOption ¶
type TargetExtractorOption func(*TargetExtractorConfig)
func WithTargetExtractorResultBufferSize ¶
func WithTargetExtractorResultBufferSize(v int) TargetExtractorOption
type UseSearcher ¶
type UseSearcher interface {
Search() <-chan Use
}
func NewUseSearcher ¶
func NewUseSearcher( pkgs []*packages.Package, refSearcher RefPkgSearcher, objExtractor ObjExtractor, tgtExtractor TargetExtractor, fieldSearcher FieldSearcher, defSetFilter Filter, opt ...UseSearcherOption, ) UseSearcher
type UseSearcherConfig ¶
type UseSearcherConfig struct {
// contains filtered or unexported fields
}
type UseSearcherOption ¶
type UseSearcherOption func(*UseSearcherConfig)
func WithUseSearcherIgnorePkgSelfloop ¶
func WithUseSearcherIgnorePkgSelfloop(v bool) UseSearcherOption
func WithUseSearcherIgnoreUseSelfloop ¶
func WithUseSearcherIgnoreUseSelfloop(v bool) UseSearcherOption
func WithUseSearcherObjNameRegexp ¶
func WithUseSearcherObjNameRegexp(v util.RegexpPair) UseSearcherOption
func WithUseSearcherPkgNameRegexp ¶
func WithUseSearcherPkgNameRegexp(v util.RegexpPair) UseSearcherOption
func WithUseSearcherResultBufferSize ¶
func WithUseSearcherResultBufferSize(v int) UseSearcherOption
func WithUseSearcherSearchForeign ¶
func WithUseSearcherSearchForeign(v bool) UseSearcherOption
func WithUseSearcherSearchPrivate ¶
func WithUseSearcherSearchPrivate(v bool) UseSearcherOption
func WithUseSearcherSearchUniverse ¶
func WithUseSearcherSearchUniverse(v bool) UseSearcherOption
func WithUseSearcherWorkerNum ¶
func WithUseSearcherWorkerNum(v int) UseSearcherOption
Click to show internal directories.
Click to hide internal directories.