Documentation ¶
Index ¶
- type ArrayType
- type ChannelType
- type Constant
- type Docs
- type EllipsisType
- type Embed
- type Embeds
- type Field
- type Fields
- type File
- type FuncType
- type Function
- type IdentType
- type Import
- type InterfaceType
- type MapType
- type Package
- func (p *Package) Bind() error
- func (p *Package) Equal(t *Package) bool
- 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) FindType(t string) (*TypeName, error)
- func (p *Package) FindVariable(t string) (*Variable, error)
- type SelectorType
- type StarType
- type StructType
- type Type
- type TypeName
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayType ¶
ArrayType is the base array
type ChannelType ¶
type ChannelType struct { Direction ast.ChanDir Type Type // contains filtered or unexported fields }
ChannelType is the channel type in go source code
func (*ChannelType) Equal ¶
func (c *ChannelType) Equal(t Type) bool
Equal check if two channel are exported
func (*ChannelType) Package ¶
func (c *ChannelType) Package() *Package
Package is the package of channel
func (*ChannelType) String ¶
func (c *ChannelType) String() string
String represent string version of the data
type Constant ¶
type Constant struct { Name string Type Type Docs Docs Value string // contains filtered or unexported fields }
Constant is a string represent of a function parameter
func (*Constant) Equal ¶
Equal check for equality TODO : currently it check if the value is equal and the type is equal too.
type EllipsisType ¶
type EllipsisType struct {
*ArrayType
}
EllipsisType is slice type but with ...type definition
func (EllipsisType) Equal ¶
func (e EllipsisType) Equal(t Type) bool
Equal if two ellipsis array are equal
func (*EllipsisType) String ¶
func (e *EllipsisType) String() string
String represent ellipsis array in string
type Embed ¶
Embed is the embedded type in the struct or interface
type Field ¶
Field is a single field of a structure, a variable, with tag
type File ¶
type File struct { FileName string PackageName string Docs Docs Imports []*Import Variables []*Variable Functions []*Function Constants []*Constant Types []*TypeName }
File is a single file in a structure
func ParseFile ¶
ParseFile try to parse a single file for its annotations
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) FindType ¶
FindType try to find type in file
type FuncType ¶
type FuncType struct { Parameters []*Variable Results []*Variable // contains filtered or unexported fields }
FuncType is the single function
type Function ¶
type Function struct { Name string Docs Docs Type *FuncType Receiver *Variable // Nil means normal function // contains filtered or unexported fields }
Function is functions with name, not the func types
func (*Function) Equal ¶
Equal check if two functions are equal
func (*Function) Package ¶
Package get the package of function
type IdentType ¶
type IdentType struct { Ident string // contains filtered or unexported fields }
IdentType is the normal type name
type Import ¶
type Import struct { Package string Canonical string Path string Docs Docs Folder string // contains filtered or unexported fields }
Import is one imported path
func (Import) LoadPackage ¶
LoadPackage is the function to load import package
type InterfaceType ¶
type InterfaceType struct { Functions []*Function Embeds []Type // IdentType or SelectorType // contains filtered or unexported fields }
InterfaceType is the interface in go code
func (*InterfaceType) Equal ¶
func (i *InterfaceType) Equal(t Type) bool
Equal if both interfaces are equal
func (*InterfaceType) Package ¶
func (i *InterfaceType) Package() *Package
Package get the interface package
func (*InterfaceType) String ¶
func (i *InterfaceType) String() string
type MapType ¶
MapType is the map in the go code
type Package ¶
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) Bind ¶
Bind try to bind package. this check every type and bind them to actual value
func (*Package) Equal ¶
Equal check if to packages are equal
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) FindType ¶
FindType try to find type in package
type SelectorType ¶
type SelectorType struct { Type Type // contains filtered or unexported fields }
SelectorType is the type in another package
func (*SelectorType) Package ¶
func (s *SelectorType) Package() *Package
Package is the package of selector
func (*SelectorType) String ¶
func (s *SelectorType) String() string
func (*SelectorType) TargetPackage ¶
func (s *SelectorType) TargetPackage() (*Package, error)
TargetPackage is the selector target package
type StarType ¶
type StarType struct { Target Type // contains filtered or unexported fields }
StarType is the pointer of a type
func (*StarType) Equal ¶
Equal check if two star type are equal
type StructType ¶
StructType is the structures in golang source code
func (*StructType) Package ¶
func (s *StructType) Package() *Package
Package return the package of this struct
type Type ¶
type Type interface { fmt.Stringer // Package return the package name of the type Package() *Package Equal(Type) bool }
Type is the interface for all types without name
type TypeName ¶
type TypeName struct { Docs Docs Type Type Name string Methods []*Function StarMethods []*Function // contains filtered or unexported fields }
TypeName is the type with name in a package
func FindTypeName ¶
FindTypeName try to find type name based on the type. it can fail for anonymous types, so watch about the result
func (*TypeName) Equal ¶
Equal if two type name are equal
func (*TypeName) InstanceOf ¶
InstanceOf if this type is instance of some other type
func (*TypeName) Package ¶
Package return the package name of this type name