Documentation ¶
Index ¶
- Constants
- Variables
- func Build(m *Metadata, outputDir string) error
- func CleanUnlinkedPackages(baseDir, binDir string) ([]string, error)
- func Fetch(urlStr string) (io.ReadCloser, error)
- func Install(baseDir, pth string) error
- func Link(baseDir, pkg, binDir string) (map[string]string, error)
- func ListCachedPackagesSlice(cacheDir string) ([]string, error)
- func ListLinkedPackages(baseDir, binDir string) (map[string]string, error)
- func ListLinkedPackagesSlice(baseDir, binDir string) ([]string, error)
- func ListUnpackedPackagesSlice(baseDir string) ([]string, error)
- func Unlink(baseDir, binDir, name, version string) ([]string, error)
- func Unpack(baseDir string, pkg io.Reader) ([]string, error)
- type DirtyLinkError
- type FetchFunc
- type Metadata
Constants ¶
View Source
const PackageFieldSeparator = "-"
Variables ¶
View Source
var FetchSupportedSchemes = []string{"http", "https", "file"}
Functions ¶
func CleanUnlinkedPackages ¶
CleanUnlinkedPackages removes all of the unpacked archives that do not currently have a symbolic link in binDir targeting a binary within them.
This function will return a list of the names and vesrions of unpacked archives, that were removed, in the format:
name/version
func Install ¶
Install unpacks the archive at the specified path, to the directory specified by baseDir.
func ListCachedPackagesSlice ¶
func ListLinkedPackages ¶
ListLinkedPackages returns a map of unpacked archives that currently have symbolic links in binDir targeting the binaries within them.
The returned map holds the format:
map["package_name"] = "package_version"
func ListLinkedPackagesSlice ¶
ListLinkedPackagesSlice is a convenience function that creates a string slice from the map produced by ListLinkedPackages.
Types ¶
type DirtyLinkError ¶
type DirtyLinkError struct {
LinkPath, PackageName, Version, WantVersion string
}
func (*DirtyLinkError) Error ¶
func (e *DirtyLinkError) Error() string
type Metadata ¶
type Metadata struct { Architecture string `json:"architecture"` Platform string `json:"platform"` Description string `json:"description"` Name string `json:"name"` Maintainer string `json:"maintainer"` SourceURL string `json:"source_url"` Resources map[string][]string `json:"resources"` Binaries []string `json:"binaries"` Version string `json:"version"` Checksums []string `json:"checksums"` }
func LoadMetadata ¶
func (*Metadata) PackageName ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.