Documentation ¶
Index ¶
- type Cache
- type Lock
- type LockPackage
- type Manifest
- type ManifestPackage
- type Project
- func (p *Project) Download(pkg ManifestPackage) (LockPackage, error)
- func (p *Project) Import(m *Manifest) error
- func (p *Project) LoadLock() (*Lock, error)
- func (p *Project) LoadManifest() (*Manifest, error)
- func (p *Project) Remove(importPath string) error
- func (p *Project) UpdateLock(f func(l *Lock) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Dir maps a remote repo to a directory. Dir(remote string, f func(dir string) error) error // Clear removes all cached packages from disk. Clear() error }
Cache provides a space for downloading packages.
var NoCache Cache = tempDir{}
NoCache is a cache implementation that doesn't cache anything.
type Lock ¶
type Lock struct {
Import []LockPackage `json:"import"`
}
Lock is the lock file serialization format.
type LockPackage ¶
type LockPackage struct { Package string `json:"name"` Version string `json:"version"` Remote string `json:"remote,omitempty"` Subpackages []string `json:"subpackage,omitempty"` }
LockPackage is the lock file serialization of a package.
type Manifest ¶
type Manifest struct {
Import []ManifestPackage `json:"import,omitempty"`
}
Manifest is the manifest file serialization format.
type ManifestPackage ¶
type ManifestPackage struct { Package string `json:"package"` Version string `json:"version"` Remote string `json:"remote,omitempty"` Subpackages []string `json:"subpackages,omitempty"` }
ManifestPackage is the manifest file serialization of a package.
type Project ¶
Project can be used to manage manifest and lock files.
func (*Project) Download ¶
func (p *Project) Download(pkg ManifestPackage) (LockPackage, error)
Download downloads a package to the vendor directory of a project. It does not modify the lock files.
func (*Project) LoadLock ¶
LoadLock reads and parses the project's lock file. If it doesn't exist, an empty lock file is returned.
func (*Project) LoadManifest ¶
LoadManifest reads and parses the project's manifest file.