Documentation ¶
Index ¶
- func Resolve(importPath, basePath string, bctx build.Context) (string, error)
- type Builder
- type Condition
- type Dependencies
- type Graph
- func (pg Graph) AddPath(path Path)
- func (pg Graph) AllPaths(start, end Package) Graph
- func (pg Graph) DepthFirst(start Package, walkFn WalkFn)
- func (pg Graph) DepthLast(start Package, walkFn WalkFn)
- func (pg Graph) Dot(root Package) string
- func (pg Graph) Has(pkg Package) bool
- func (pg Graph) List(root Package) []Package
- func (pg Graph) Pkg(pkg Package) Set
- func (pg Graph) SomePath(start, end Package) Path
- type Package
- type Path
- type Set
- type WalkFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct { // The base directory for relative imports. BaseDir string // The roots of the dependency graph (source packages). Roots []Package // Stop building the graph if ANY conditions are met. TerminationConditions []Condition // Ignore any packages that match any of these patterns. // Tested on the resolved package path. Ignored []*regexp.Regexp // Include only packages that match any of these patterns. // Tested on the resolved package path. Included []*regexp.Regexp // Whether tests should be included in the dependencies. IncludeTests bool // Whether to include standard library packages IncludeStdlib bool // The build context for processing imports. BuildContext build.Context // contains filtered or unexported fields }
func (*Builder) Build ¶
func (b *Builder) Build() (Dependencies, error)
type Condition ¶
type Condition func(Dependencies) bool
type Dependencies ¶
type Graph ¶
func (Graph) DepthFirst ¶
Walk the graph depth first, starting at start and calling walkFn on each node visited. Each node will be visited at most once.
type Package ¶
type Package string
Package is the full import path of a Go package.
const NullPackage Package = ""
Click to show internal directories.
Click to hide internal directories.