Documentation ¶
Index ¶
- func Copypath(dst string, src string) error
- func FetchMetadata(path string, insecure bool) (rc io.ReadCloser, err error)
- func LoadPaths(paths ...struct{ Root, Prefix string }) (map[string]*Depset, error)
- func ParseImports(root string) (map[string]bool, error)
- func ParseMetadata(path string, insecure bool) (string, string, string, error)
- func RemoveAll(path string) error
- func WriteManifest(path string, m *Manifest) error
- type BzrClone
- type Dependency
- type Depset
- type GitClone
- type HgClone
- type Manifest
- type Pkg
- type RemoteRepo
- type WorkingCopy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copypath ¶
Copypath copies the contents of src to dst, excluding any file or directory that starts with a period.
func FetchMetadata ¶
func FetchMetadata(path string, insecure bool) (rc io.ReadCloser, err error)
FetchMetadata fetchs the remote metadata for path.
func ParseImports ¶
ParseImports parses Go packages from a specific root returning a set of import paths.
func ParseMetadata ¶
ParseMetadata fetchs and decodes remote metadata for path.
func RemoveAll ¶
RemoveAll removes path and any children it contains. Unlike os.RemoveAll it deletes read only files on Windows.
func WriteManifest ¶
WriteManifest writes a Manifest to the path. If the manifest does not exist, it is created. If it does exist, it will be overwritten. If the manifest file is empty (0 dependencies) it will be deleted. The dependencies will be ordered by import path to reduce churn when making changes. TODO(dfc) write to temporary file and move atomically to avoid destroying a working vendorfile.
Types ¶
type BzrClone ¶
type BzrClone struct {
// contains filtered or unexported fields
}
BzrClone is a bazaar WorkingCopy.
type Dependency ¶
type Dependency struct { // Importpath is name by which this dependency is known. Importpath string `json:"importpath"` // Repository is the remote DVCS location that this // dependency was fetched from. Repository string `json:"repository"` // Revision is the revision that describes the dependency's // remote revision. Revision string `json:"revision"` // Branch is the branch the Revision was located on. // Can be blank if not needed. Branch string `json:"branch"` // Path is the path inside the Repository where the // dependency was fetched from. Path string `json:"path,omitempty"` }
Dependency describes one vendored import path of code A Dependency is an Importpath sources from a Respository at Revision from Path.
type GitClone ¶
type GitClone struct {
// contains filtered or unexported fields
}
GitClone is a git WorkingCopy.
type HgClone ¶
type HgClone struct {
// contains filtered or unexported fields
}
HgClone is a mercurial WorkingCopy.
type Manifest ¶
type Manifest struct { // Manifest version. Current manifest version is 0. Version int `json:"version"` // Depenencies is a list of vendored dependencies. Dependencies []Dependency `json:"dependencies"` }
Manifest describes the layout of $PROJECT/vendor/manifest.
func ReadManifest ¶
ReadManifest reads a Manifest from path. If the Manifest is not found, a blank Manifest will be returned.
func (*Manifest) AddDependency ¶
func (m *Manifest) AddDependency(dep Dependency) error
AddDependency adds a Dependency to the current Manifest. If the dependency exists already then it returns and error.
func (*Manifest) GetDependencyForImportpath ¶
func (m *Manifest) GetDependencyForImportpath(path string) (Dependency, error)
GetDependencyForRepository return a dependency for specified URL If the dependency does not exist it returns an error
func (*Manifest) HasImportpath ¶
HasImportpath reports whether the Manifest contains the import path.
func (*Manifest) RemoveDependency ¶
func (m *Manifest) RemoveDependency(dep Dependency) error
RemoveDependency removes a Dependency from the current Manifest. If the dependency does not exist then it returns an error.
type RemoteRepo ¶
type RemoteRepo interface { // Checkout checks out a specific branch, tag, or revision. // The interpretation of these three values is impementation // specific. Checkout(branch, tag, revision string) (WorkingCopy, error) // URL returns the URL the clone was taken from. It should // only be called after Clone. URL() string }
RemoteRepo describes a remote dvcs repository.
func Bzrrepo ¶
func Bzrrepo(url string) (RemoteRepo, error)
Bzrrepo returns a RemoteRepo representing a remote bzr repository.
func DeduceRemoteRepo ¶
func DeduceRemoteRepo(path string, insecure bool) (RemoteRepo, string, error)
DeduceRemoteRepo takes a potential import path and returns a RemoteRepo representing the remote location of the source of an import path. Remote repositories can be bare import paths, or urls including a checkout scheme. If deduction would cause traversal of an insecure host, a message will be printed and the travelsal path will be ignored.
type WorkingCopy ¶
type WorkingCopy interface { // Dir is the root of this working copy. Dir() string // Revision returns the revision of this working copy. Revision() (string, error) // Branch returns the branch to which this working copy belongs. Branch() (string, error) // Destroy removes the working copy and cleans path to the working copy. Destroy() error }
WorkingCopy represents a local copy of a remote dvcs repository.