Documentation
¶
Index ¶
- Variables
- func Debugf(pat string, args ...interface{})
- func LoadDir(dir *DirSpec, recurse bool) (map[string]*Package, error)
- func LoadPackages(ctx *build.Context, filepaths map[string][]string) (map[string]*Package, error)
- func ShowChange(c Change) string
- type Change
- type ChangeKind
- type DirSpec
- type Func
- type FuncChange
- type ObjectCategory
- type Package
- type PackageChanges
- type Type
- type TypeChange
- type Value
- type ValueChange
Constants ¶
This section is empty.
Variables ¶
var Debug bool = false
Functions ¶
func LoadPackages ¶
func ShowChange ¶
ShowChange returns a string represnetation of an API change.
Types ¶
type Change ¶
type Change interface { TypesObject() types.Object ShowBefore() string ShowAfter() string Kind() ChangeKind }
A Change represents a change of an API between two revisions.
type ChangeKind ¶
type ChangeKind int
ChangeKind represents the kind of a change of an API between two revisions.
const ( ChangeUnchanged ChangeKind = iota ChangeAdded ChangeRemoved ChangeCompatible ChangeBreaking )
func (ChangeKind) String ¶
func (ck ChangeKind) String() string
type DirSpec ¶
type DirSpec struct { VCS string Revision string Path string // contains filtered or unexported fields }
DirSpec represents a virtual directory which may point to a source tree of a specific Revision controlled under a VCS.
func NewDirSpec ¶
NewDirSpec creates a virtual directory which may point to a source tree of a specific revision controlled under a vcs. The path may be one of:
- An absolute path
- An import path
- A relative import path
type FuncChange ¶
FuncChange represents a change between functions.
func (FuncChange) Kind ¶
func (fc FuncChange) Kind() ChangeKind
func (FuncChange) ShowAfter ¶
func (fc FuncChange) ShowAfter() string
func (FuncChange) ShowBefore ¶
func (fc FuncChange) ShowBefore() string
func (FuncChange) TypesObject ¶
func (fc FuncChange) TypesObject() types.Object
type ObjectCategory ¶
type ObjectCategory string
ObjectCategory is the category of API.
const ( ObjectCategoryFunc ObjectCategory = "func" ObjectCategoryType ObjectCategory = "type" ObjectCategoryValue ObjectCategory = "value" )
type Package ¶
type Package struct { // The types aspect of the package TypesPkg *types.Package // The docs aspect of the package DocPkg *doc.Package Funcs map[string]*Func Types map[string]*Type Values map[string]*Value Fset *token.FileSet }
Package represents a parsed, type-checked and documented package.
type PackageChanges ¶
type PackageChanges struct { Before *Package After *Package Changes map[ObjectCategory]map[string]Change }
PackageChanges represent changes between two packages.
func DiffPackages ¶
func DiffPackages(pkg1, pkg2 *Package) PackageChanges
DiffPackages takes two packages to produce the changes between them.
func (PackageChanges) Funcs ¶
func (pc PackageChanges) Funcs() map[string]FuncChange
Funcs returns API changes of functions.
func (PackageChanges) Path ¶
func (pc PackageChanges) Path() string
Path is the import path of the package.
func (PackageChanges) Types ¶
func (pc PackageChanges) Types() map[string]TypeChange
Types returns API changes of types.
func (PackageChanges) Values ¶
func (pc PackageChanges) Values() map[string]ValueChange
Types returns API changes of values eg. consts and vars.
type Type ¶
type Type struct { Package *Package Types *types.TypeName Doc *doc.Type Funcs map[string]*Func Methods map[string]*Func }
Type is a syntactically parsed, type-checked and (maybe) documented type declaration.
type TypeChange ¶
TypeChange represents a change between two types.
func (TypeChange) Kind ¶
func (tc TypeChange) Kind() ChangeKind
func (TypeChange) ShowAfter ¶
func (tc TypeChange) ShowAfter() string
func (TypeChange) ShowBefore ¶
func (tc TypeChange) ShowBefore() string
func (TypeChange) TypesObject ¶
func (tc TypeChange) TypesObject() types.Object
type Value ¶
type Value struct { Name string Package *Package Doc *doc.Value Types types.Object // *types.Var (IsConst == false) or *types.Const (IsConst == true) IsConst bool }
Value is a syntactically parsed, type-checked and (maybe) documented toplevel value (var or const).
type ValueChange ¶
func (ValueChange) Kind ¶
func (vc ValueChange) Kind() ChangeKind
func (ValueChange) ShowAfter ¶
func (vc ValueChange) ShowAfter() string
func (ValueChange) ShowBefore ¶
func (vc ValueChange) ShowBefore() string
func (ValueChange) TypesObject ¶
func (vc ValueChange) TypesObject() types.Object