Documentation ¶
Index ¶
- type Configuration
- type LibraryGraph
- func (graph *LibraryGraph) AddDependency(lib LibraryName, libver semver.Version, deplib LibraryName, ...) error
- func (graph *LibraryGraph) AddLibrary(lib LibraryName, libver semver.Version)
- func (graph LibraryGraph) Contains(lib LibraryName, libver semver.Version) bool
- func (graph LibraryGraph) Dependencies(lib LibraryName, ver semver.Version) Possible
- func (graph LibraryGraph) Exists(d dependency) bool
- func (graph LibraryGraph) Resolve(libraries ...LibraryName) (config Configuration, err error)
- func (graph *LibraryGraph) Verbose(v bool)
- func (graph LibraryGraph) Versions(lib LibraryName) *VersionList
- type LibraryName
- type Possible
- type Resolver
- type VersionList
- func (vl *VersionList) Add(v semver.Version) *VersionList
- func (vl *VersionList) Clone() *VersionList
- func (vl VersionList) Contains(v semver.Version) bool
- func (vl VersionList) Get(i int) semver.Version
- func (vl VersionList) Intersection(vl2 VersionList) *VersionList
- func (vl VersionList) Len() int
- func (vl VersionList) Less(i, j int) bool
- func (vl VersionList) ReverseSort()
- func (vl VersionList) Sort()
- func (vl VersionList) String() string
- func (vl VersionList) Swap(i, j int)
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) Empty ¶
func (a Possible) Empty() []LibraryName
* This method provides a list of libraries for which no more * possible versions exists.
func (Possible) Refine ¶
* 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 ¶
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) 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)