pkg

package
v0.0.0-...-c8bb454 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	Graph graph.Graph[string, string]
	// contains filtered or unexported fields
}

A Graph represents an interdependent set of Wolfi packages defined in one or more Melange configuration files.

func NewGraph

func NewGraph(dirFS fs.FS, dirPath string) (*Graph, error)

NewGraph returns a new Graph using Melange configuration discovered in the given directory.

The input is any fs.FS filesystem implementation. Given a directory path, you can call NewGraph like this:

pkg.NewGraph(os.DirFS('path/to/directory'))

func (Graph) Config

func (g Graph) Config(name string) *build.Configuration

Config returns the Melange configuration for the package with the given name, if the package is present in the Graph. If it's not present, Config returns nil. Providing the name of a subpackage will return the configuration of the subpackage's origin package.

func (Graph) DependenciesOf

func (g Graph) DependenciesOf(node string) []string

DependenciesOf returns a slice of the names of the given package's dependencies, sorted alphabetically.

func (Graph) MakeTarget

func (g Graph) MakeTarget(pkgName, arch string) (string, error)

MakeTarget creates the make target for the given package in the Graph.

func (Graph) MakefileEntry

func (g Graph) MakefileEntry(pkgName string) (string, error)

func (Graph) Nodes

func (g Graph) Nodes() []string

Nodes returns a slice of the names of all nodes in the Graph, sorted alphabetically.

func (Graph) Sorted

func (g Graph) Sorted() ([]string, error)

Sorted returns a list of all package names in the Graph, sorted in topological order, meaning that packages earlier in the list depend on packages later in the list.

func (Graph) SubgraphWithLeaves

func (g Graph) SubgraphWithLeaves(leaves []string) (*Graph, error)

SubgraphWithLeaves returns a new Graph that's a subgraph of g, where the set of the new Graph's leaves will be identical to or a subset of the given set of leaves.

In other words, the new subgraph will contain all packages (transitively) that are dependent on the packages whose names were given as the `leaves` argument.

func (Graph) SubgraphWithRoots

func (g Graph) SubgraphWithRoots(roots []string) (*Graph, error)

SubgraphWithRoots returns a new Graph that's a subgraph of g, where the set of the new Graph's roots will be identical to or a subset of the given set of roots.

In other words, the new subgraph will contain all dependencies (transitively) of all packages whose names were given as the `roots` argument.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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