pkgset

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 9 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

func KeyValue

func KeyValue(s string) (string, string)

func Parse

func Parse(ctx context.Context, expr []string) (ast.Expr, error)

Types

type Context

type Context struct {
	Context context.Context
	Tags    Strings
	Env     Strings
}

func (Context) Clone

func (ctx Context) Clone() *Context

func (Context) Config

func (ctx Context) Config() *packages.Config

func (Context) Load

func (ctx Context) Load(patterns ...string) ([]*packages.Package, error)

func (*Context) Set

func (ctx *Context) Set(key, value string)

type Set

type Set map[string]*packages.Package

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

func Calc

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

func DirectDependencies

func DirectDependencies(a Set) Set

DirectDependencies returns packages that are direct dependencies of a, `a` not included.

func Incoming

func Incoming(a, b Set) Set

Incoming returns packages from a that directly import packages in b.

func Intersect

func Intersect(a, b Set) Set

Intersect returns packages that exist in both

func Main

func Main(a Set) Set

Main returns main pacakges.

func New

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

New makes a set from roots recursively

func NewAll

func NewAll(src Set) Set

NewAll reincludes all the dependencies from the graph.

func NewRoot

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

NewRoot makes a set from roots recursively

func Reach

func Reach(a, b Set) Set

Reach returns packages in a that terminate in b

func Sources

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

func SymmetricDifference(a, b Set) Set

SymmetricDifference returns packages that are different

func Transitive

func Transitive(a Set) Set

Transitive returns transitive reduction.

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) List

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

List returns packages in unsorted order.

func (Set) Sorted

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

Sorted returns packages in sorted order

func (Set) Walk

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

func (Set) WalkDependencies

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

type Strings

type Strings []string

func (Strings) Clone

func (strs Strings) Clone() Strings

func (Strings) IndexOf

func (strs Strings) IndexOf(key string) int

func (*Strings) Set

func (strs *Strings) Set(key, value string)

func (Strings) ValueOf

func (strs Strings) ValueOf(key string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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