graph

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration map[LibraryName]semver.Version

* This type represents a specific configuration of libraries. This is used to represent * the resolution of dependencies.

func (Configuration) Clone

func (conf Configuration) Clone() Configuration

type LibraryGraph

type LibraryGraph struct {
	// contains filtered or unexported fields
}

* A library graph is simply a list of dependencies (edges)

func NewLibraryGraph

func NewLibraryGraph() *LibraryGraph

* This function creates a new LibraryGraph object.

func (*LibraryGraph) AddDependency

func (graph *LibraryGraph) AddDependency(lib LibraryName, libver semver.Version,
	deplib LibraryName, depver semver.Version) error

* Method to add a new dependency to a library graph

func (*LibraryGraph) AddLibrary

func (graph *LibraryGraph) AddLibrary(lib LibraryName, libver semver.Version)

func (LibraryGraph) Contains

func (graph LibraryGraph) Contains(lib LibraryName, libver semver.Version) bool

func (LibraryGraph) Dependencies

func (graph LibraryGraph) Dependencies(lib LibraryName, ver semver.Version) Possible

* This method returns a map where the keys are libraries that the named * library+version depends on and the values are the versions that are * compatible with the named library+version.

func (LibraryGraph) Exists

func (graph LibraryGraph) Exists(d dependency) bool

func (LibraryGraph) Resolve

func (graph LibraryGraph) Resolve(libraries ...LibraryName) (config Configuration, err error)

func (*LibraryGraph) Verbose

func (graph *LibraryGraph) Verbose(v bool)

* This function sets debugging output

func (LibraryGraph) Versions

func (graph LibraryGraph) Versions(lib LibraryName) *VersionList

* Builds a list of all versions of a given library known to the * graph. These are returned in sorted order (latest to earliest)

type LibraryName

type LibraryName string

* Create a special type to specifically represent library names. This just * helps make the API clearer.

type Possible

type Possible map[LibraryName]*VersionList

* This type represents remaining possible values for a given library

func (Possible) Clone

func (a Possible) Clone() Possible

* Create a clone of the map

func (Possible) Empty

func (a Possible) Empty() []LibraryName

* This method provides a list of libraries for which no more * possible versions exists.

func (Possible) Refine

func (a Possible) Refine(subset Possible) Possible

* For each key in 'subset', only the values in that subset are still * possible. So this method returns a new set of possible values which * represents either 1) the values provided in 'a' for keys of 'a' that * are not present in 'subset' or 2) the intersection of the values from * 'a' and 'subset' for keys they share.

type Resolver

type Resolver interface {
	Contains(LibraryName, semver.Version) bool
	AddLibrary(LibraryName, semver.Version)
	AddDependency(LibraryName, semver.Version, LibraryName, semver.Version) error
	Resolve(...LibraryName) (Configuration, error)
}

type VersionList

type VersionList []semver.Version

func NewVersionList

func NewVersionList(init ...semver.Version) *VersionList

func (*VersionList) Add

func (vl *VersionList) Add(v semver.Version) *VersionList

func (*VersionList) Clone

func (vl *VersionList) Clone() *VersionList

func (VersionList) Contains

func (vl VersionList) Contains(v semver.Version) bool

func (VersionList) Get

func (vl VersionList) Get(i int) semver.Version

func (VersionList) Intersection

func (vl VersionList) Intersection(vl2 VersionList) *VersionList

func (VersionList) Len

func (vl VersionList) Len() int

func (VersionList) Less

func (vl VersionList) Less(i, j int) bool

func (VersionList) ReverseSort

func (vl VersionList) ReverseSort()

func (VersionList) Sort

func (vl VersionList) Sort()

func (VersionList) String

func (vl VersionList) String() string

func (VersionList) Swap

func (vl VersionList) Swap(i, j int)

Jump to

Keyboard shortcuts

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