Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// If "a" imports "b", DependsOn["a"]["b"] == true
DependsOn map[string]map[string]bool
// If "a" imports "b", UsedBy["b"]["a"] == true
UsedBy map[string]map[string]bool
// Package["import/path"] = &Package{...}
Package map[string]*Package
// Repository["repo/path"] = &Repository{...}
Repository map[string]*Repository
// When this graph was last updated.
LastScan time.Time
}
Graph stores the dependency graph of packages.
func (*Graph) FindRepo ¶
func (g *Graph) FindRepo(key string) (*Repository, error)
FindRepo attempts to find a repository with the given key. If a unique repository is found it is returned, an error otherwise.
func (*Graph) RepoDeps ¶
func (g *Graph) RepoDeps(repo *Repository) ([]*Repository, error)
RepoDeps returns a list of the repositories which contain packages upon which packages in the given repository depend.
func (*Graph) RepoUsers ¶
func (g *Graph) RepoUsers(repo *Repository) ([]*Repository, error)
RepoUsers returns a list of the repositories which contain packages which depend on packages in the given repository.
type Package ¶
type Package struct {
// General
Dir string // directory containing package sources
ImportPath string // import path of package in dir
Name string // package name
Target string // install path
Goroot bool // is this package in the Go root?
Standard bool // is this package part of the standard Go library?
Root string // Go root or Go path dir containing this package
Incomplete bool // this package or a dependency has an error
// Package files
GoFiles []string // .go files
TestGoFiles []string // _test.go files
XTestGoFiles []string // currently ignored
// Package imports
Imports []string // import paths used by this package
TestImports []string // import paths used by _test.go files in this package
XTestImports []string // currently ignored
// Rx specific
RepoRoot string
}
Package is a subset of cmd/go.Package Parsed from `go list`
func (*Package) DetectVCS ¶
DetectVCS attempts to detect which version control system is hosting the package, or "" if none is found. If two are detected, the one with the longer root path is chosen. If more than one have identical length paths, the result is undefined.
func (*Package) IsBinary ¶
IsBinary returns true if the package is a binary. A package is a binary iff the name of the package is "main".
func (*Package) IsTestable ¶
IsTestable returns true if the package is testable. A package is testable iff there are one or more _test.go files.
type Repository ¶
type Repository struct {
Root string // directory containing the repository
VCS string // version control system
Packages []string // packages contained in this repository
}
A Repository is a version-controlled directory containing one or more packages.
func (*Repository) Downgrades ¶
func (r *Repository) Downgrades() (TagList, error)
func (*Repository) Head ¶
func (r *Repository) Head() (string, error)
func (*Repository) String ¶
func (r *Repository) String() string
String returns the import pattern matching all packages
func (*Repository) Tags ¶
func (r *Repository) Tags() (TagList, error)
func (*Repository) ToRev ¶
func (r *Repository) ToRev(rev string) error
func (*Repository) Upgrades ¶
func (r *Repository) Upgrades() (TagList, error)
Source Files
¶
- graph.go
- repo.go
- scan.go
- tag.go