Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayType ¶
ArrayType is the base array
func (*ArrayType) GetDefinition ¶
GetName the name of this type
type ChannelType ¶
type ChannelType struct { Direction ast.ChanDir Type Type // contains filtered or unexported fields }
ChannelType is used to handle channel type definition
func (*ChannelType) GetDefinition ¶
func (i *ChannelType) GetDefinition() string
GetName the name of this type
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 NewConstant ¶
func NewConstant(v *ast.ValueSpec, c *ast.CommentGroup, src string, f *File, p *Package) []*Constant
NewConstant return an array of constant in the scope
type EllipsisType ¶
type EllipsisType struct {
*ArrayType
}
EllipsisType is slice type but with ...type definition
func (*EllipsisType) GetDefinition ¶
func (i *EllipsisType) GetDefinition() string
GetName the name of this type
type File ¶
type File struct { FileName string PackageName string Docs Docs Functions []*Function Imports []*Import Variables []*Variable Constants []*Constant Types []*TypeName }
File is the annotations in package and all its sub types
type FuncType ¶
type FuncType struct { Parameters []*Variable Results []*Variable // contains filtered or unexported fields }
FuncType is for function type
func (*FuncType) GetDefinition ¶
GetName the name of this type
type Function ¶
type Function struct { Name string Receiver *Variable // Nil means normal function Docs Docs Type *FuncType }
Function is annotation data for a single function
type IdentType ¶
type IdentType struct { Ident string // contains filtered or unexported fields }
IdentType is for simple definition of a type, like int, string ...
func (*IdentType) GetDefinition ¶
GetName the name of this type
type Import ¶
Import is a single import entity
func NewImport ¶
func NewImport(i *ast.ImportSpec, c *ast.CommentGroup) *Import
NewImport extract a new import entry
func (Import) LoadPackage ¶
LoadPackage is the function to load import package
type InterfaceType ¶
type InterfaceType struct { Functions []*Function Embed []Type // IdentType or SelectorType // contains filtered or unexported fields }
InterfaceType is a single interface in system
func (*InterfaceType) GetDefinition ¶
func (i *InterfaceType) GetDefinition() string
GetName the name of this type
type MapType ¶
MapType is the map type
func (*MapType) GetDefinition ¶
GetName the name of this type
type Package ¶
type Package struct { Files []*File Path string Name string // contains filtered or unexported fields }
pkg is list of files
func ParsePackage ¶
ParsePackage is here for loading a single package and parse all files in it
func (Package) FindConstant ¶
FindConstant try to find a package level variable
func (Package) FindFunction ¶
FindFunction try to find a package level variable
func (Package) FindImport ¶
FindImport try to find an import by its full import path
type SelectorType ¶
type SelectorType struct { Type Type // contains filtered or unexported fields }
SelectorType a type from another package
func (*SelectorType) GetDefinition ¶
func (i *SelectorType) GetDefinition() string
GetName the name of this type
func (*SelectorType) IdentType ¶
func (st *SelectorType) IdentType() *IdentType
func (*SelectorType) Package ¶
func (st *SelectorType) Package() *Package
Package in selector type is not this package
type StarType ¶
type StarType struct { Target Type // contains filtered or unexported fields }
StarType is a pointer to another type
func (*StarType) GetDefinition ¶
GetName the name of this type
type StructType ¶
type StructType struct { Fields []*Field Embeds []*Embed // contains filtered or unexported fields }
StructType is a struct in source code
func (*StructType) GetDefinition ¶
func (i *StructType) GetDefinition() string
GetName the name of this type
type Type ¶
type Type interface { // GetDefinition return the definition of type GetDefinition() string // pkg return the package where this type is inside it Package() *Package }
Type is for handling a type definition
type TypeName ¶
type TypeName struct { Type Type Name string Docs Docs Methods []*Function StarMethods []*Function }
TypeName contain type and its name, means the type is in this package
func (TypeName) GetAllMethods ¶
func (TypeName) GetDefinition ¶
GetDefinition return the definition of this type