pkgset

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStd

func IsStd(p *packages.Package) bool

IsStd returns whether *packages.Package is a std package

func IsStdName

func IsStdName(id string) bool

IsStdName returns whether id corresponds to a standard package

Types

type Set

type Set map[string]*packages.Package

Set is a p.ID -> *packages.Package

func Calc

func Calc(ctx context.Context, expr []string) (Set, error)

func Dependencies added in v0.0.2

func Dependencies(a Set) Set

Dependencies returns packages that has removed first layer in the DAG

func Intersect

func Intersect(a, b Set) Set

Intersect returns packages that exist in both

func New

func New(roots ...*packages.Package) Set

New makes a set from roots recursively

func NewRoot added in v0.0.2

func NewRoot(roots ...*packages.Package) Set

NewRoot makes a set from roots recursively

func Reach added in v0.0.2

func Reach(a, b Set) Set

Reach returns packages in a that terminate in b

func Sources added in v0.0.2

func Sources(a Set) Set

Sources returns packages that don't have incoming edges

func Std

func Std() Set

Std returns the standard package set

func Subtract

func Subtract(a, b Set) Set

Subtract returns packages that exist in a, but not in b

func SymmetricDifference added in v0.0.2

func SymmetricDifference(a, b Set) Set

SymmetricDifference returns packages that are different

func Union

func Union(a, b Set) Set

Union includes packages from both sets

func (Set) Clone

func (set Set) Clone() Set

Clone makes a copy of the set

func (Set) IncludeRecursive

func (set Set) IncludeRecursive(p *packages.Package)

IncludeRecursive adds p recursively

func (Set) Sorted

func (set Set) Sorted() []*packages.Package

Sorted returns packages in sorted order

func (Set) Tree added in v0.0.2

func (set Set) Tree() *Tree

Tree returns package tree

func (Set) Walk added in v0.0.2

func (set Set) Walk(fn func(*packages.Package))

func (Set) WalkDependencies added in v0.0.2

func (set Set) WalkDependencies(fn func(*packages.Package))

type Tree added in v0.0.2

type Tree struct {
	Path    string
	Package *packages.Package

	Child map[string]*Tree

	Parent   *Tree
	Children []*Tree
}

func NewTree added in v0.0.2

func NewTree(parent *Tree, path string) *Tree

func (*Tree) Add added in v0.0.2

func (tree *Tree) Add(pkg *packages.Package)

func (*Tree) HasParent added in v0.0.2

func (tree *Tree) HasParent(parent *Tree) bool

func (*Tree) Insert added in v0.0.2

func (tree *Tree) Insert(prefix, suffix []string, pkg *packages.Package)

func (*Tree) LookupTable added in v0.0.2

func (tree *Tree) LookupTable() map[*packages.Package]*Tree

func (*Tree) Sort added in v0.0.2

func (tree *Tree) Sort()

func (*Tree) Walk added in v0.0.2

func (tree *Tree) Walk(fn func(tree *Tree))

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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