Documentation ¶
Index ¶
- type ArrayType
- func (a *ArrayType) Compare(def Definition) bool
- func (a *ArrayType) Expr() ast.Expr
- func (ed ArrayType) File() *File
- func (a *ArrayType) Len() int
- func (ed ArrayType) Node() ast.Node
- func (ed ArrayType) Package() *Package
- func (a *ArrayType) Slice() bool
- func (a *ArrayType) String() string
- func (a *ArrayType) ValueDefinition() Definition
- type ChanDir
- type ChannelType
- type Constant
- type Definition
- type Docs
- type EllipsisType
- type Embed
- type Embeds
- type Field
- type Fields
- type File
- func (f *File) Docs() Docs
- func (f *File) FileName() string
- func (f *File) FindConstant(t string) (*Constant, error)
- func (f *File) FindFunction(t string) (*Function, error)
- func (f *File) FindImport(pkg string) (*Import, error)
- func (f *File) FindMethod(t string, fn string) (*Function, error)
- func (f *File) FindType(t string) (*Type, error)
- func (f *File) FindVariable(t string) (*Variable, error)
- func (f *File) FullPath() string
- func (f *File) Package() *Package
- func (f *File) Source() string
- type FuncType
- func (f *FuncType) Compare(def Definition) bool
- func (ed FuncType) File() *File
- func (ed FuncType) Node() ast.Node
- func (ed FuncType) Package() *Package
- func (f *FuncType) Parameters() []*Variable
- func (f *FuncType) Results() []*Variable
- func (f *FuncType) Sign() string
- func (f *FuncType) String() string
- type Function
- func (f *Function) Body() string
- func (f *Function) Definition() Definition
- func (f *Function) Docs() Docs
- func (f *Function) File() *File
- func (f *Function) Func() *FuncType
- func (f *Function) Name() string
- func (f *Function) Package() *Package
- func (f *Function) Receiver() *Variable
- func (f *Function) ReceiverType() string
- func (f *Function) RecieverPointer() bool
- type IdentType
- type Import
- type InterfaceType
- func (i *InterfaceType) Compare(def Definition) bool
- func (i *InterfaceType) Embeds() Embeds
- func (ed InterfaceType) File() *File
- func (i *InterfaceType) Functions() []*Function
- func (ed InterfaceType) Node() ast.Node
- func (ed InterfaceType) Package() *Package
- func (i *InterfaceType) String() string
- type MapType
- type Package
- func (p *Package) Constants() []*Constant
- func (p *Package) Files() []*File
- func (p *Package) FindConstant(t string) (*Constant, error)
- func (p *Package) FindFunction(t string) (*Function, error)
- func (p *Package) FindImport(pkg string) (*Import, error)
- func (p *Package) FindMethod(t string, fn string) (*Function, error)
- func (p *Package) FindType(t string) (*Type, error)
- func (p *Package) FindVariable(t string) (*Variable, error)
- func (p *Package) Functions() []*Function
- func (p *Package) Imports() []*Import
- func (p *Package) Name() string
- func (p *Package) Path() string
- func (p *Package) Types() []*Type
- func (p *Package) Variables() []*Variable
- type SelectorType
- func (s *SelectorType) Compare(def Definition) bool
- func (ed SelectorType) File() *File
- func (s *SelectorType) Ident() string
- func (s *SelectorType) Import() *Import
- func (ed SelectorType) Node() ast.Node
- func (ed SelectorType) Package() *Package
- func (s *SelectorType) Selector() string
- func (s *SelectorType) String() string
- type StarType
- type StructType
- type Type
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayType ¶
type ArrayType struct {
// contains filtered or unexported fields
}
ArrayType is the base array
func (*ArrayType) Compare ¶
func (a *ArrayType) Compare(def Definition) bool
Compare try to compare this to def
func (*ArrayType) ValueDefinition ¶
func (a *ArrayType) ValueDefinition() Definition
ValueDefinition return the definition of value
type ChanDir ¶
type ChanDir int
ChanDir The direction of a channel type is indicated by a bit mask including one or both of the following constants.
type ChannelType ¶
type ChannelType struct {
// contains filtered or unexported fields
}
ChannelType is the channel type in go source code
func (*ChannelType) Compare ¶
func (c *ChannelType) Compare(def Definition) bool
Compare try to compare this to def
func (*ChannelType) Direction ¶
func (c *ChannelType) Direction() ChanDir
Direction return the channel direction
func (*ChannelType) String ¶
func (c *ChannelType) String() string
String represent string version of the data
func (*ChannelType) ValueDefinition ¶
func (c *ChannelType) ValueDefinition() Definition
ValueDefinition return the definition of the type in channel
type Constant ¶
type Constant struct {
// contains filtered or unexported fields
}
Constant is a string represent of a function parameter
func (*Constant) Definition ¶
func (c *Constant) Definition() Definition
Definition return the constant definition
type Definition ¶
type Definition interface { fmt.Stringer // Package return the package name of the type Package() *Package // Compare two definition // TODO : this is here, but the implementation is not complete. for {Selector,Map,Struct,Interface,Func}Type we need to check for selector type canonical name and pkg name Compare(Definition) bool // Node return the original ast node Node() ast.Node }
Definition is the interface for all types without name
func NewDefinition ¶
func NewDefinition(s string) (Definition, error)
NewDefinition try to extract definition from string
type EllipsisType ¶
type EllipsisType struct {
*ArrayType
}
EllipsisType is slice type but with ...type definition
func (*EllipsisType) Compare ¶
func (e *EllipsisType) Compare(def Definition) bool
Compare try to compare this to def
func (*EllipsisType) String ¶
func (e *EllipsisType) String() string
String represent ellipsis array in string
type Embed ¶
type Embed struct {
// contains filtered or unexported fields
}
Embed is the embedded type in the struct or interface
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field is a single field of a structure, a variable, with tag
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is a single file in a structure
func (*File) FindConstant ¶
FindConstant try to find constant in package
func (*File) FindFunction ¶
FindFunction try to find function in file
func (*File) FindImport ¶
FindImport try to find an import in a file
func (*File) FindMethod ¶
FindMethod try to find function in file
func (*File) FindVariable ¶
FindVariable try to find variable in file
type FuncType ¶
type FuncType struct {
// contains filtered or unexported fields
}
FuncType is the single function
func (*FuncType) Compare ¶
func (f *FuncType) Compare(def Definition) bool
Compare try to compare this to def
func (*FuncType) Parameters ¶
Parameters is the parameter of the function
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
Function is functions with name, not the func types
func (*Function) Definition ¶
func (f *Function) Definition() Definition
Definition return the definition of the func
func (*Function) Func ¶
Func return the definition in correct cast. for faster access without a cast
func (*Function) Receiver ¶
Receiver get the receiver of the function if the function is a method, if not, return nil
func (*Function) ReceiverType ¶
ReceiverType return the type of the receiver
func (*Function) RecieverPointer ¶
RecieverPointer means this is a pointer method
type IdentType ¶
type IdentType struct {
// contains filtered or unexported fields
}
IdentType is the normal type name
func (*IdentType) Compare ¶
func (i *IdentType) Compare(def Definition) bool
Compare try to compare this to def
type Import ¶
type Import struct {
// contains filtered or unexported fields
}
Import is one imported path
func (*Import) Canonical ¶
Canonical is the canonical package name, if the package not imported with another name, the package name and canonical name are same +lazy
func (*Import) TargetPackage ¶
TargetPackage return the target package name. (name after package keyword in package ) +lazy
type InterfaceType ¶
type InterfaceType struct {
// contains filtered or unexported fields
}
InterfaceType is the interface in go code
func (*InterfaceType) Compare ¶
func (i *InterfaceType) Compare(def Definition) bool
Compare try to compare this to def
func (*InterfaceType) Embeds ¶
func (i *InterfaceType) Embeds() Embeds
Embeds is the embedded interfaces
func (*InterfaceType) Functions ¶
func (i *InterfaceType) Functions() []*Function
Functions return the functions in the interface
func (*InterfaceType) String ¶
func (i *InterfaceType) String() string
type MapType ¶
type MapType struct {
// contains filtered or unexported fields
}
MapType is the map in the go code
func (*MapType) Compare ¶
func (m *MapType) Compare(def Definition) bool
Compare try to compare this to def
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
Package is the package in one place
func ParsePackage ¶
ParsePackage is here for loading a single package and parse all files in it if the package is imported from another package, the other parameter is required for checking vendors of that package.
func (*Package) FindConstant ¶
FindConstant try to find constant in package
func (*Package) FindFunction ¶
FindFunction try to find function in package
func (*Package) FindImport ¶
FindImport try to find an import in a package
func (*Package) FindMethod ¶
FindMethod try to find function in package
func (*Package) FindVariable ¶
FindVariable try to find variable in package
type SelectorType ¶
type SelectorType struct {
// contains filtered or unexported fields
}
SelectorType is the type in another package
func (*SelectorType) Compare ¶
func (s *SelectorType) Compare(def Definition) bool
Compare try to compare this to def
func (*SelectorType) Import ¶
func (s *SelectorType) Import() *Import
Import is the import of this selector
func (*SelectorType) Selector ¶
func (s *SelectorType) Selector() string
Selector is the selector type
func (*SelectorType) String ¶
func (s *SelectorType) String() string
type StarType ¶
type StarType struct {
// contains filtered or unexported fields
}
StarType is the pointer of a type
func (*StarType) Compare ¶
func (s *StarType) Compare(def Definition) bool
Compare try to compare this to def
func (*StarType) Target ¶
func (s *StarType) Target() Definition
Target is the target type of this star type
type StructType ¶
type StructType struct {
// contains filtered or unexported fields
}
StructType is the structures in golang source code
func (*StructType) Compare ¶
func (s *StructType) Compare(def Definition) bool
Compare try to compare this to def
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type is the type with name in a package
func (*Type) Definition ¶
func (t *Type) Definition() Definition
Definition return the definition of this type
type Variable ¶
type Variable struct {
// contains filtered or unexported fields
}
Variable is a string represent of a function parameter
func (*Variable) Definition ¶
func (v *Variable) Definition() Definition
Definition return the variable definition