Documentation
¶
Index ¶
- Variables
- type Dependency
- type Index
- func (idx *Index) FindIndexedLibrary(lib *libraries.Library) *Library
- func (idx *Index) FindLibraryUpdate(lib *libraries.Library) *Release
- func (idx *Index) FindRelease(name string, version *semver.Version) (*Release, error)
- func (idx *Index) ResolveDependencies(lib *Release, overrides []*Release) []*Release
- type Library
- type Release
Constants ¶
This section is empty.
Variables ¶
var EmptyIndex = &Index{Libraries: map[string]*Library{}}
EmptyIndex is an empty library index
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type Dependency struct { Name string VersionConstraint semver.Constraint }
Dependency is a library dependency
func (*Dependency) GetConstraint ¶
func (r *Dependency) GetConstraint() semver.Constraint
GetConstraint returns the version Constraint of the dependecy
func (*Dependency) GetName ¶
func (r *Dependency) GetName() string
GetName returns the name of the dependency
type Index ¶
Index represents the list of libraries available for download
func (*Index) FindIndexedLibrary ¶
FindIndexedLibrary search an indexed library that matches the provided installed library or nil if not found
func (*Index) FindLibraryUpdate ¶
FindLibraryUpdate check if an installed library may be updated using one of the indexed libraries. This function returns the Release to install to update the library if found, otherwise nil is returned.
func (*Index) FindRelease ¶
FindRelease search a library Release in the index. Returns nil if the release is not found. If the version is not specified returns the latest version available.
func (*Index) ResolveDependencies ¶
ResolveDependencies resolve the dependencies of a library release and returns a possible solution (the set of library releases to install together with the library). An optional "override" releases may be passed if we want to exclude the same libraries from the index (for example if we want to keep an installed library).
type Library ¶
type Library struct { Name string Releases map[semver.NormalizedString]*Release Latest *Release `json:"-"` Index *Index `json:"-"` }
Library is a library available for download
type Release ¶
type Release struct { Author string Version *semver.Version Dependencies []*Dependency Maintainer string Sentence string Paragraph string Website string Category string Architectures []string Types []string Resource *resources.DownloadResource License string ProvidesIncludes []string Library *Library `json:"-"` }
Release is a release of a library available for download
func (*Release) GetDependencies ¶
func (r *Release) GetDependencies() []*Dependency
GetDependencies returns the dependencies of this library.
func (*Release) GetVersion ¶
GetVersion returns the version of this library.
func (*Release) ToRPCLibraryRelease ¶
func (r *Release) ToRPCLibraryRelease() *rpc.LibraryRelease
ToRPCLibraryRelease transform this Release into a rpc.LibraryRelease