Documentation
¶
Index ¶
Constants ¶
const ( TypeDeclaration DeclarationType = "type" AliasDeclaration = "alias" VarDeclaration = "var" ConstDeclaration = "const" FuncDeclaration = "func" )
const ( StructType Type = "struct" BasicType = "basic" SliceType = "slice" ArrayType = "array" FuncType = "func" ChanType = "chan" MapType = "map" PointerType = "pointer" InterfaceType = "interface" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { // Packages included directly in the API. Packages []*Package // Reachable is the set of all objects that are reachable from the API. Reachable []*Object }
API
func ReachableFromPackages ¶
ReachableFromPackages gets an API given list of package paths.
func (*API) LookupSymbol ¶ added in v0.2.0
func (API) MarshalEasyJSON ¶ added in v0.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (API) MarshalJSON ¶ added in v0.2.0
MarshalJSON supports json.Marshaler interface
func (*API) UnmarshalEasyJSON ¶ added in v0.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*API) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Change ¶
type Change struct { Type ChangeType Symbol string }
func CompareObjects ¶
CompareObjects compares two objects and reports backwards incompatible changes.
type ChangeType ¶
type ChangeType int
const ( // PackageDeleted means that a package that was added explicitly to the API // was deleted. This is not used when a package that is reachable but not // explicitly added to the API is deleted. In that case, a package deletion // would be seen as type changes that render the package not reachable // anymore. PackageDeleted ChangeType // TopLevelDeclarationAdded means that a top-level declaration was added to // a package. This can be either a type, var, const or func. It does not // include method declarations. TopLevelDeclarationAdded // TopLevelDeclarationDeleted means that a top-level declaration is deleted // from a package. It does not include method declarations. TopLevelDeclarationDeleted // DeclarationTypeChanged means that the type of declaration changed. For // example, a declaration changed from being a var to a const. Note that // changing between type definitions and type aliases is covered here too. DeclarationTypeChanged // TypeChanged means that an entity (type declaration, field, parameter, // return type) has changed its type. // // This does not cover when there is a change in the type underlying a type // name. For example, TypeChanged will be signaled if a var changes from // MyTypeA to MyTypeB, but it will not if MyType itself changes from being // a struct to an interface. // // A change in the direction of a channel is also considered a type change. // // See https://golang.org/ref/spec#Types TypeChanged // FieldAdded means that a new exported field was added to a struct. FieldAdded // FieldDeleted means that a previously exported field was deleted from a // struct. FieldDeleted // FieldChangedType means that a field in a struct changed its type. // See TypeChanged. FieldChangedType // SignatureChanged means that a function declaration changed its signature. SignatureChanged // MethodAdded means that a new exported method declaration was added. MethodAdded // MethodDeleted means that a previously exported method declaration was // deleted. MethodDeleted // MethodSignatureChanged means that the signature of a method has changed. // Receiver name, parameter names and return type names are ignored. MethodSignatureChanged // InterfaceChanged means that any function, exported or not, was added, // deleted or had its signature changed. InterfaceChanged )
func ChangeTypeFromString ¶
func ChangeTypeFromString(s string) (ChangeType, error)
ChangeTypeFromString converts a string representation of the ChangeType to its numeric value.
func (ChangeType) String ¶
func (i ChangeType) String() string
type DeclarationType ¶ added in v0.2.0
type DeclarationType string
type Definition ¶ added in v0.2.0
type Definition struct { Type Type `json:"type"` Symbol *Symbol `json:"symbol,omitempty"` Elem *Definition `json:"elem,omitempty"` Key *Definition `json:"key,omitempty"` Len int64 `json:"len,omitempty"` ChanDir types.ChanDir `json:"chandir,omitempty"` Fields []*Field `json:"fields,omitempty"` Functions []*Func `json:"functions,omitempty"` Signature *Signature `json:"signature,omitempty"` }
func (Definition) MarshalEasyJSON ¶ added in v0.2.0
func (v Definition) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Definition) MarshalJSON ¶ added in v0.2.0
func (v Definition) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Definition) UnmarshalEasyJSON ¶ added in v0.2.0
func (v *Definition) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Definition) UnmarshalJSON ¶ added in v0.2.0
func (v *Definition) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Field ¶ added in v0.2.0
type Field struct { Name string Type *Definition }
func (Field) MarshalEasyJSON ¶ added in v0.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Field) MarshalJSON ¶ added in v0.2.0
MarshalJSON supports json.Marshaler interface
func (*Field) UnmarshalEasyJSON ¶ added in v0.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Field) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Func ¶ added in v0.2.0
func (Func) MarshalEasyJSON ¶ added in v0.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Func) MarshalJSON ¶ added in v0.2.0
MarshalJSON supports json.Marshaler interface
func (*Func) UnmarshalEasyJSON ¶ added in v0.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Func) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Object ¶ added in v0.2.0
type Object struct { Symbol Symbol `json:"symbol"` Type DeclarationType `json:"type"` Definition *Definition `json:"definition,omitempty"` Methods []*Func `json:"methods,omitempty"` }
func ConvertObject ¶ added in v0.2.0
func (Object) MarshalEasyJSON ¶ added in v0.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Object) MarshalJSON ¶ added in v0.2.0
MarshalJSON supports json.Marshaler interface
func (*Object) UnmarshalEasyJSON ¶ added in v0.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Object) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Package ¶ added in v0.2.0
func NewPackage ¶ added in v0.2.0
func (Package) MarshalEasyJSON ¶ added in v0.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Package) MarshalJSON ¶ added in v0.2.0
MarshalJSON supports json.Marshaler interface
func (*Package) UnmarshalEasyJSON ¶ added in v0.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Package) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Signature ¶ added in v0.2.0
type Signature struct { Params []*Definition Results []*Definition Variadic bool }
func (Signature) MarshalEasyJSON ¶ added in v0.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Signature) MarshalJSON ¶ added in v0.2.0
MarshalJSON supports json.Marshaler interface
func (*Signature) UnmarshalEasyJSON ¶ added in v0.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Signature) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON supports json.Unmarshaler interface
type Symbol ¶ added in v0.2.0
func (Symbol) MarshalEasyJSON ¶ added in v0.2.0
MarshalEasyJSON supports easyjson.Marshaler interface
func (Symbol) MarshalJSON ¶ added in v0.2.0
MarshalJSON supports json.Marshaler interface
func (*Symbol) UnmarshalEasyJSON ¶ added in v0.2.0
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Symbol) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON supports json.Unmarshaler interface