delta

package
v38.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const None = "<none>"

None is the value used for functions with no parameters and/or no return values.

Variables

This section is empty.

Functions

func GetConstTypeChanges

func GetConstTypeChanges(lhs, rhs exports.Content) map[string]Signature

GetConstTypeChanges returns a collection of const where the type has changed. Key is the const name, value contains the type change information.

func GetFuncSigChanges

func GetFuncSigChanges(lhs, rhs exports.Content) map[string]FuncSig

GetFuncSigChanges returns a collection of functions that contain signature changes (params and/or returns). Key is the function name, value contains the signature change information.

func GetInterfaceMethodSigChanges

func GetInterfaceMethodSigChanges(lhs, rhs exports.Content) map[string]InterfaceDef

GetInterfaceMethodSigChanges returns a collection of interfaces with method signature changes. Key is the interface name, value contains the method signature change information.

func GetInterfaceMethods

func GetInterfaceMethods(lhs, rhs exports.Content) map[string]exports.Interface

GetInterfaceMethods returns interfaces common to lhs and rhs where interfaces in rhs contain methods not in lhs. Key is the interface type name, value contains the added content.

func GetStructFieldChanges

func GetStructFieldChanges(lhs, rhs exports.Content) map[string]StructDef

GetStructFieldChanges returns a collection of structs with fields that changed their type. Key is the struct name, value contains fields with signature changes.

func GetStructFields

func GetStructFields(lhs, rhs exports.Content) map[string]exports.Struct

GetStructFields returns structs common to lhs and rhs where structs in rhs contain fields not in lhs. Key is the struct type name, value contains the added content.

Types

type Content

type Content struct {
	exports.Content

	// contains the names of structs that are modified in whole (i.e. new/removed)
	CompleteStructs []string `json:"newStructs,omitempty"`
}

Content defines the set of exported constants, funcs, and structs.

func GetExports

func GetExports(lhs, rhs exports.Content) Content

GetExports returns a exports.Content struct containing all exports in rhs that aren't in lhs. This includes any new fields added to structs or methods added to interfaces.

func NewContent

func NewContent() Content

NewContent returns an initialized Content object.

func (Content) GetModifiedStructs

func (c Content) GetModifiedStructs() map[string]exports.Struct

GetModifiedStructs returns the subset, if any, of structs that are modified.

type FuncSig

type FuncSig struct {
	// Params contains the parameter signature changes, may be nil.
	Params *Signature `json:"params,omitempty"`

	// Returns contains the return signature changes, may be nil.
	Returns *Signature `json:"returns,omitempty"`
}

FuncSig contains the details of how a function's signature changed.

type InterfaceDef

type InterfaceDef struct {
	MethodSigs map[string]FuncSig `json:"funcSig"`
}

InterfaceDef contains a collection of interface methods with signature changes. Key is the method name, value contains the signature change information.

type Signature

type Signature struct {
	// From contains the originial signature.
	From string `json:"from"`

	// To contains the new signature.
	To string `json:"to"`
}

Signature contains the details of how a type signature changed (e.g. From:"int" To:"string").

type StructDef

type StructDef struct {
	Fields map[string]Signature `json:"fields"`
}

StructDef contains a collection of fields within a struct where the field's type has changed. Key is the field name, value contains the signature change information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL