internal

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layout added in v0.2.0

type Layout interface {
	Enter(path string, last bool)
	Print(line string, first, last bool)
	Leave(path string, last bool)
}

The Layout interface shapes a type visitor.

type PackageLoaderFunc added in v0.2.0

type PackageLoaderFunc func(*packages.Config, ...string) ([]*packages.Package, error)

PackageLoaderFunc returns the Go packages named by the given patterns.

type Packagist added in v0.2.0

type Packagist struct {
	PackageLoaderFunc PackageLoaderFunc
	PathFilterFunc    PathFilterFunc

	IncludeUnexported bool
	IncludeTestFiles  bool
	// contains filtered or unexported fields
}

Packagist carries inspection meta data.

func (*Packagist) Inspect added in v0.2.0

func (p *Packagist) Inspect(patterns ...string) (TypeMap, error)

Inspect finds matching types in the packages named by the given patterns.

type PathFilterFunc added in v0.2.0

type PathFilterFunc func(string) bool

PathFilterFunc is a simple string filtering/matching function.

func CreatePathFilterFunc added in v0.2.0

func CreatePathFilterFunc(include, exclude []string) PathFilterFunc

CreatePathFilterFunc gets a list of text patterns which are converted to regular expressions. The result of this function is a PathFilterFunc which can be used as a filter for matching patterns against strings.

type PathMap added in v0.2.0

type PathMap map[string]string

PathMap carries the mapping between the fully qualified import paths and their type projections.

type PathReplaceFunc added in v0.2.0

type PathReplaceFunc func(string) string

PathReplaceFunc is a simple string replacement function.

func CreatePathReplaceFunc added in v0.2.0

func CreatePathReplaceFunc(list []string) PathReplaceFunc

CreatePathReplaceFunc returns the default path and name relocation function. The result is basically sanitized but bad input will lead to bad output.

type QualifierFunc added in v0.2.0

type QualifierFunc func(p types.Package) string

QualifierFunc returns the type qualifier (path) of a package.

type TreeWalk added in v0.3.2

type TreeWalk struct {
	Layout
	// contains filtered or unexported fields
}

TreeWalk knows about Layout.

func (*TreeWalk) Walk added in v0.3.2

func (t *TreeWalk) Walk(m PathMap) error

Walk traverses a PathMap according to the paths.

type TypeMap

type TypeMap map[string]types.Type

TypeMap is a set of types indexed by their package import paths.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL