Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportsEqual ¶
ExportsEqual returns true if faces are equal, otherwise false.
Types ¶
type Export ¶
type Export interface { // String returns a human-readable presentation of the export. String() string // ID returns a unique identifier for an export. // An export's ID must be unique within its package. ID() string // contains filtered or unexported methods }
Export represents an export.
type ExportDifference ¶
ExportDifference contains the old and new faces.
type FuncSignature ¶
FuncSignature defines a function signature. The ID is a short signature that should be uniquely identifying. The Signature is a complete representation of the function's interface and should be directly comparable between different commits to ensure that backwards compatibility is maintained.
func ParseFuncSignature ¶
func ParseFuncSignature(decl *ast.FuncDecl) FuncSignature
ParseFuncSignature parses a FuncDecl into a FuncSignature.
func (FuncSignature) ID ¶
func (fs FuncSignature) ID() string
ID returns a unique identifier for the function signature. A package should only have one function with this particular ID.
func (FuncSignature) String ¶
func (fs FuncSignature) String() string
type Module ¶
type Module struct { Path string Packages map[string]PackageInterface }
Module represents a module. The Package member contains all exports of the module.
func ParseModule ¶
ParseModule parses a module and returns all of its export signatures.
type ModuleDifference ¶
type ModuleDifference struct { ModPath string OldModPath string ModPathsMatch bool PackageRemovals map[string]PackageInterface PackageAdditions map[string]PackageInterface PackageChanges map[string]*PackageDifference }
ModuleDifference represents the interface difference between two versions of a module.
func Diff ¶
func Diff(oldmod, newmod *Module) *ModuleDifference
Diff computes the interface difference between two versions of a module.
func (ModuleDifference) Any ¶
func (md ModuleDifference) Any() bool
Any returns true if there are any differences, otherwise false.
func (ModuleDifference) Breaking ¶
func (md ModuleDifference) Breaking() bool
Breaking returns true if there are any breaking differences, otherwise false. Any package removals or packages with breaking changes are considered breaking changes for the module.
type ModuleInterface ¶
type ModuleInterface map[string]PackageInterface
ModuleInterface represents all exports of a module.
type PackageDifference ¶
type PackageDifference struct { Additions map[string]Export Removals map[string]Export Changes map[string]ExportDifference }
PackageDifference returns the interface differences between two versions of a package.
func PackageDiff ¶
func PackageDiff(oldpack, newpack PackageInterface) *PackageDifference
PackageDiff returns an object representing the difference between two package versions.
func (PackageDifference) Any ¶
func (pd PackageDifference) Any() bool
Any returns true if there are any differences, otherwise false.
func (PackageDifference) Breaking ¶
func (pd PackageDifference) Breaking() bool
Breaking returns true if there are any breaking differences, otherwise false. Any interface removals or changes in signature are considered breaking changes.
type PackageInterface ¶
PackageInterface represents all exports of a package.