Documentation ¶
Overview ¶
package Repo provides tools for working with VCS repositories.
Glide manages repositories in the vendor directory by using the native VCS systems of each repository upon which the code relies.
Index ¶
- func ConcurrentUpdate(deps []*cfg.Dependency, cwd string, i *Installer) error
- func SetReference(conf *cfg.Config) error
- func VcsGet(dep *cfg.Dependency, dest, home string, cache, cacheGopath, useGopath bool) error
- func VcsUpdate(dep *cfg.Dependency, vend string, inst *Installer) error
- func VcsVersion(dep *cfg.Dependency, vend string) error
- func VendoredCleanup(conf *cfg.Config) error
- type Installer
- func (i *Installer) Checkout(conf *cfg.Config, useDev bool) error
- func (i *Installer) Install(lock *cfg.Lockfile, conf *cfg.Config) (*cfg.Config, error)
- func (i *Installer) List(conf *cfg.Config) []*cfg.Dependency
- func (i *Installer) Update(conf *cfg.Config) error
- func (i *Installer) VendorPath() string
- type MissingPackageHandler
- type VersionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcurrentUpdate ¶
func ConcurrentUpdate(deps []*cfg.Dependency, cwd string, i *Installer) error
ConcurrentUpdate takes a list of dependencies and updates in parallel.
func SetReference ¶
SetReference is a command to set the VCS reference (commit id, tag, etc) for a project.
func VcsGet ¶
func VcsGet(dep *cfg.Dependency, dest, home string, cache, cacheGopath, useGopath bool) error
VcsGet figures out how to fetch a dependency, and then gets it.
VcsGet installs into the dest.
func VcsUpdate ¶
func VcsUpdate(dep *cfg.Dependency, vend string, inst *Installer) error
VcsUpdate updates to a particular checkout based on the VCS setting.
func VcsVersion ¶
func VcsVersion(dep *cfg.Dependency, vend string) error
VcsVersion set the VCS version for a checkout.
func VendoredCleanup ¶
VendoredCleanUp cleans up vendored codebases after an update.
This should _only_ be run for installations that do not want VCS repos inside of the vendor/ directory.
Types ¶
type Installer ¶
type Installer struct { // Force the install when certain normally stopping conditions occur. Force bool // Home is the location of cache Home string // Vendor contains the path to put the vendor packages Vendor string // Use a cache UseCache bool // Use Gopath to cache UseCacheGopath bool // Use Gopath as a source to read from UseGopath bool // UpdateVendored instructs the environment to update in a way that is friendly // to packages that have been "vendored in" (e.g. are copies of source, not repos) UpdateVendored bool // DeleteUnused deletes packages that are unused, but found in the vendor dir. DeleteUnused bool // RootPackage is the top level package importing other packages. If an // imported pacakgage references this pacakage it does not need to be // downloaded and searched out again. RootPackage string }
Installer provides facilities for installing the repos in a config file.
func (*Installer) Checkout ¶
Checkout reads the config file and checks out all dependencies mentioned there.
This is used when initializing an empty vendor directory, or when updating a vendor directory based on changed config.
func (*Installer) Update ¶
Update updates all dependencies.
It begins with the dependencies in the config file, but also resolves transitive dependencies. The returned lockfile has all of the dependencies listed, but the version reconciliation has not been done.
In other words, all versions in the Lockfile will be empty.
func (*Installer) VendorPath ¶
VendorPath returns the path to the location to put vendor packages
type MissingPackageHandler ¶
type MissingPackageHandler struct { RootPackage string Config *cfg.Config Use *importCache // contains filtered or unexported fields }
MissingPackageHandler is a dependency.MissingPackageHandler.
When a package is not found, this attempts to resolve and fetch.
When a package is found on the GOPATH, this notifies the user.
type VersionHandler ¶
type VersionHandler struct { // If Try to use the version here if we have one. This is a cache and will // change over the course of setting versions. Use *importCache // Cache if importing scan has already occured here. Imported map[string]bool // Where the packages exist to set the version on. Destination string RootPackage string Config *cfg.Config // There's a problem where many sub-packages have been asked to set a version // and you can end up with numerous conflict messages that are exactly the // same. We are keeping track to only display them once. // the parent pac Conflicts map[string]bool }
VersionHandler handles setting the proper version in the VCS.
func (*VersionHandler) Process ¶
func (d *VersionHandler) Process(pkg string) (e error)
Process imports dependencies for a package
func (*VersionHandler) SetVersion ¶
func (d *VersionHandler) SetVersion(pkg string) (e error)
SetVersion sets the version for a package. If that package version is already set it handles the case by: - keeping the already set version - proviting messaging about the version conflict TODO(mattfarina): The way version setting happens can be improved. Currently not optimal.