pkgset

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 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 added in v0.1.0

func KeyValue(s string) (string, string)

func Parse added in v0.0.3

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

Types

type Context added in v0.1.0

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

func (Context) Clone added in v0.1.0

func (ctx Context) Clone() *Context

func (Context) Config added in v0.1.0

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

func (Context) Load added in v0.1.0

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

func (*Context) Set added in v0.1.0

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 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 Transitive added in v0.1.4

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

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

Sorted returns packages in sorted order

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 Strings added in v0.1.0

type Strings []string

func (Strings) Clone added in v0.1.0

func (strs Strings) Clone() Strings

func (Strings) IndexOf added in v0.1.0

func (strs Strings) IndexOf(key string) int

func (*Strings) Set added in v0.1.0

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

func (Strings) ValueOf added in v0.1.0

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