Documentation ¶
Index ¶
- Variables
- func CopyDir(src, target string) error
- func NewGitProjectFromPath(path, rootPath string) (*localGitProject, error)
- func NewlocalGitProjectFromURI(uri, reference string) *localGitProject
- func RemoveSubdirsWithNoFiles(dirPath string) (hasAtLeastOneFile bool, err error)
- type LocalGitProject
- type LocalProject
- type Project
- type ProjectNoVCL
- func (self *ProjectNoVCL) AddVendor(importPath string, project Project) (Vendor, error)
- func (self *ProjectNoVCL) GetBaseDir() string
- func (self *ProjectNoVCL) GetImports() (importPaths Set, err error)
- func (self *ProjectNoVCL) GetSubpackages() (subpackages Set, err error)
- func (self *ProjectNoVCL) GetVendors() (vendors map[string]Vendor, err error)
- func (self *ProjectNoVCL) Install(destination string) (LocalProject, error)
- func (self *ProjectNoVCL) RemoveVendor(importPath string) error
- type RemoteGitProject
- type Set
- type Vendor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateVendor = errors.New("Vendor already added to this project") ErrUnknownVendor = errors.New("Vendor doesn't exist in this project") )
View Source
var DefaultExcludesRegexp = []*regexp.Regexp{regexp.MustCompile(`/?vendor/?`)}
View Source
var ErrImportPathNotFound = errors.New("Import path not found in GOPATH nor as Go-Gettable")
View Source
var ErrNotImplemented = errors.New("Feature not implemented yet")
View Source
var ErrOrphan = errors.New("Vendor does not have a parent project")
View Source
var ErrStandardLibrary = errors.New("Import path is part of the standard library")
Functions ¶
func NewGitProjectFromPath ¶
func NewlocalGitProjectFromURI ¶
func NewlocalGitProjectFromURI(uri, reference string) *localGitProject
Types ¶
type LocalGitProject ¶
type LocalGitProject interface { LocalProject // GetReference returns the HEAD reference. // Can be a commit hash, a branch, a tag etc. // Must be usable with the `git checkout` command GetReference() (string, error) // GetRemote returns the RemoteGitProject if possible // Returns nil if there is no remote. GetRemote() (RemoteGitProject, error) }
type LocalProject ¶
type LocalProject interface { Project // GetVendors returns all the project's vendors as a map[importPath]Vendor GetVendors() (vendors map[string]Vendor, err error) // AddVendor adds a vendor to the project AddVendor(importPath string, project Project) (Vendor, error) // RemoveVendor removes a vendor from the project by import path RemoveVendor(importPath string) error // GetImports returns all the project's imports (as a set of import paths) GetImports() (importPaths Set, err error) // GetSubpackages returns all the project's subpackages, (excluding vendors). GetSubpackages() (subpackages Set, err error) // GetBaseDir returns the path to the base directory of the project GetBaseDir() string }
LocalProject represents a Project we have available on the local file system
func NewLocalProject ¶
func NewLocalProject(path string, rootPath string) (LocalProject, error)
NewLocalProject takes a path and builds a Project object from it, determining if it is a Git/Mercurial/No VCL/etc. project
type Project ¶
type Project interface { // Install downloads/copies/generates the project at specified destination on the filesystem Install(destination string) (LocalProject, error) }
Project represents a Go project
type ProjectNoVCL ¶
type ProjectNoVCL struct { BaseDir string Recursive bool Subpackages Set Imports Set Vendors map[string]Vendor GoFiles Set PathExcludes []*regexp.Regexp // contains filtered or unexported fields }
ProjectNoVCL is the most baisc local project : without any Version Control System
func NewProjectNoVCL ¶
func NewProjectNoVCL(path string) *ProjectNoVCL
func (*ProjectNoVCL) AddVendor ¶
func (self *ProjectNoVCL) AddVendor(importPath string, project Project) (Vendor, error)
AddVendor by simply copying it
func (*ProjectNoVCL) GetBaseDir ¶
func (self *ProjectNoVCL) GetBaseDir() string
func (*ProjectNoVCL) GetImports ¶
func (self *ProjectNoVCL) GetImports() (importPaths Set, err error)
func (*ProjectNoVCL) GetSubpackages ¶
func (self *ProjectNoVCL) GetSubpackages() (subpackages Set, err error)
func (*ProjectNoVCL) GetVendors ¶
func (self *ProjectNoVCL) GetVendors() (vendors map[string]Vendor, err error)
func (*ProjectNoVCL) Install ¶
func (self *ProjectNoVCL) Install(destination string) (LocalProject, error)
func (*ProjectNoVCL) RemoveVendor ¶
func (self *ProjectNoVCL) RemoveVendor(importPath string) error
RemoveVendor by deleting it from the file system
type RemoteGitProject ¶
type Set ¶
type Set map[string]struct{}
Set is a simple strings set implementation Warning : It is not concurrency-safe
type Vendor ¶
type Vendor interface { LocalProject // GetParent returns the project vendoring this one. GetParent() Project // SetParent saves the reference to the project vendoring this one. SetParent(parent Project) // GetBaseImportPath returns the base import path (the one containing all the eventual subpackages) GetImportPath() string // GetProject returns the vendor's project GetProject() LocalProject }
Vendor represents a vendored project
Source Files ¶
Click to show internal directories.
Click to hide internal directories.