Documentation ¶
Index ¶
- type Dependency
- type EmptyLibraryError
- type GroupedIndex
- type Index
- func (ind *Index) BuildGraph(verbose bool) (graph.Resolver, error)
- func (i Index) Find(name string, version semver.Version) (VersionDetails, error)
- func (i *Index) GetLibrary(name string, uri string, owner_uri string) recorder.LibraryRecorder
- func (i Index) Group(disamb map[string]string) GroupedIndex
- func (i Index) JSON() (string, error)
- func (i1 *Index) Merge(i2 Index) error
- func (index *Index) ParseIndex(index_url string) error
- func (i Index) Reduce(disamb map[string]string) *Index
- type LibList
- type Library
- func (lib *Library) AddVersion(v semver.Version) recorder.VersionRecorder
- func (lib Library) Matches(term string) bool
- func (lib *Library) SetDescription(desc string)
- func (lib *Library) SetEmail(email string)
- func (lib *Library) SetHomepage(url string)
- func (lib *Library) SetRepository(url string, format string)
- func (lib *Library) SetStars(stars int)
- type MissingLibraryError
- type MissingVersionError
- type VersionConflictError
- type VersionDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dependency ¶
type EmptyLibraryError ¶
type EmptyLibraryError struct {
Name string
}
func (EmptyLibraryError) Error ¶
func (e EmptyLibraryError) Error() string
type GroupedIndex ¶ added in v0.8.0
func (GroupedIndex) Selected ¶ added in v0.8.0
func (g GroupedIndex) Selected() *Index
Return and index that has no "extra" libraries in it, only the ones that can possibly be chosen.
func (GroupedIndex) SortByRating ¶ added in v0.8.0
func (g GroupedIndex) SortByRating() GroupedIndex
This sorts **all but the first** match by rating. This is because the first match is the one that is first in the install path so it should always be listed first. Among those not in the search path, this rearranges them by rating.
type Index ¶
func (*Index) GetLibrary ¶
func (*Index) Merge ¶
This function merges two indices. The libraries from i2 will be appended to the list from i1.
func (*Index) ParseIndex ¶
The ParseIndex function reads index information from a given URL and then merges it into the associated index.
TODO: This will eventually need to be able to handle different index versions (by parsing the Version field in the index first and then determining how, or if, to parse it).
type Library ¶
type Library struct { // Library name Name string `json:"name"` // Canonical URI for this library (used for disambiguation) URI string `json:"uri"` // Versions of this library that are available Versions map[string]*VersionDetails `json:"versions"` // Owner of library OwnerURI string `json:"owner_uri"` // Email for library contact Email string `json:"email"` // Web site Homepage string `json:"homepage"` // Repository Repository string `json:"repository_uri"` // Repository format Format string `json:"repository_format"` // Textual description Description string `json:"description"` // Stars (if applicable, otherwise -1) Stars int `json:"stars"` }
func (*Library) AddVersion ¶
func (lib *Library) AddVersion(v semver.Version) recorder.VersionRecorder
func (*Library) SetDescription ¶
func (*Library) SetHomepage ¶
func (*Library) SetRepository ¶
type MissingLibraryError ¶
type MissingLibraryError struct {
Name string
}
func (MissingLibraryError) Error ¶
func (e MissingLibraryError) Error() string
type MissingVersionError ¶
func (MissingVersionError) Error ¶
func (e MissingVersionError) Error() string
type VersionConflictError ¶
type VersionConflictError struct { Name string Existing VersionDetails Additional VersionDetails }
func (VersionConflictError) Error ¶
func (e VersionConflictError) Error() string
type VersionDetails ¶
type VersionDetails struct { Version semver.Version `json:"version"` Tarball string `json:"tarball_url"` Zipball string `json:"zipball_url"` // This indicates where (within an archive) the library can be found: Path string `json:"path"` // This indicates whether the specified path is to a file or directory: IsFile bool `json:"isfile"` Dependencies []Dependency `json:"dependencies"` Sha string `json:"sha"` }
func NewVersionDetails ¶
func NewVersionDetails(v semver.Version) *VersionDetails
func (*VersionDetails) AddDependency ¶
func (v *VersionDetails) AddDependency(library string, version semver.Version)
func (*VersionDetails) SetHash ¶
func (v *VersionDetails) SetHash(hash string)
func (*VersionDetails) SetPath ¶
func (v *VersionDetails) SetPath(path string, file bool)
func (*VersionDetails) SetTarballURL ¶
func (v *VersionDetails) SetTarballURL(url string)
func (*VersionDetails) SetZipballURL ¶
func (v *VersionDetails) SetZipballURL(url string)