Documentation ¶
Index ¶
- type AnnotationInfo
- type AstFuncDecl
- type AstInfo
- type AstTypeDecl
- type FieldInfo
- type FieldStructInfo
- type FieldStructWalk
- type FunctionInfo
- type Indexer
- func (indexer *Indexer) FindInterfaceByAnnotation(name string) []*StructInfo
- func (indexer *Indexer) FindInterfaceImplementation(name string) []*StructInfo
- func (indexer *Indexer) FindStructByAnnotation(name string) []*StructInfo
- func (indexer *Indexer) Interfaces() map[string]*InterfaceInfo
- func (indexer *Indexer) Load() error
- func (indexer *Indexer) LoadPattern(pattern ...string) error
- func (indexer *Indexer) Packages() map[string]*PackageInfo
- func (indexer *Indexer) Structs() map[string]*StructInfo
- type InterfaceInfo
- type PackageInfo
- type StructInfo
- func (s *StructInfo) Annotations() []*AnnotationInfo
- func (s *StructInfo) Ast() *AstTypeDecl
- func (s *StructInfo) Fields(walk FieldStructWalk)
- func (s *StructInfo) Id() string
- func (s *StructInfo) Name() string
- func (s *StructInfo) Named() *types.Named
- func (s *StructInfo) Package() *PackageInfo
- func (s *StructInfo) Struct() *types.Struct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnnotationInfo ¶
AnnotationInfo represents annotation
type AstFuncDecl ¶
type AstFuncDecl struct {
// contains filtered or unexported fields
}
AstFuncDecl ast function declaration
func (*AstFuncDecl) Annotations ¶
func (a *AstFuncDecl) Annotations() []*AnnotationInfo
Annotations returns list of annotations
func (*AstFuncDecl) FuncType ¶
func (a *AstFuncDecl) FuncType() *ast.FuncType
FuncType struct type of the type
type AstInfo ¶
type AstInfo struct {
// contains filtered or unexported fields
}
AstInfo syntax info
type AstTypeDecl ¶
type AstTypeDecl struct {
// contains filtered or unexported fields
}
AstFuncDecl ast type declaration
func (*AstTypeDecl) Annotations ¶
func (a *AstTypeDecl) Annotations() []*AnnotationInfo
Annotations returns list of annotations
func (*AstTypeDecl) GenDecl ¶
func (a *AstTypeDecl) GenDecl() *ast.GenDecl
GenDecl struct type of the type
func (*AstTypeDecl) InterfaceType ¶
func (a *AstTypeDecl) InterfaceType() *ast.InterfaceType
InterfaceType struct type of the type
func (*AstTypeDecl) StructType ¶
func (a *AstTypeDecl) StructType() *ast.StructType
StructType struct type of the type
type FieldInfo ¶ added in v0.6.0
type FieldInfo struct { Struct *FieldStructInfo Index int Metadata map[string]string }
func (*FieldInfo) FieldStructInfo ¶ added in v0.6.0
type FieldStructInfo ¶ added in v0.6.0
type FieldStructInfo struct { Info *StructInfo Parent *FieldInfo Named *types.Named Struct *types.Struct Level int Metadata map[string]string }
func (*FieldStructInfo) Field ¶ added in v0.6.0
func (f *FieldStructInfo) Field(index int) *FieldInfo
func (*FieldStructInfo) Name ¶ added in v0.6.0
func (f *FieldStructInfo) Name() string
func (*FieldStructInfo) NumFields ¶ added in v0.6.0
func (f *FieldStructInfo) NumFields() int
func (*FieldStructInfo) Tag ¶ added in v0.6.0
func (f *FieldStructInfo) Tag(index int) string
type FieldStructWalk ¶ added in v0.6.0
type FieldStructWalk interface { FieldBefore(f *FieldInfo) bool FieldAfter(f *FieldInfo) Basic(f *FieldInfo, t *types.Basic) Interface(f *FieldInfo, n *types.Named, t *types.Interface) Array(f *FieldInfo, t *types.Array) bool Slice(f *FieldInfo, t *types.Slice) bool Map(f *FieldInfo, t *types.Map) (bool, bool) Struct(f *FieldInfo, n *types.Named, t *types.Struct) bool StructBefore(s *FieldStructInfo) bool StructAfter(s *FieldStructInfo) }
type FunctionInfo ¶
type FunctionInfo struct {
// contains filtered or unexported fields
}
FunctionInfo represents function
func (*FunctionInfo) Decl ¶
func (s *FunctionInfo) Decl() *AstFuncDecl
Decl ast declaration of the type
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer hold the information about the packages and types
func (*Indexer) FindInterfaceByAnnotation ¶
func (indexer *Indexer) FindInterfaceByAnnotation(name string) []*StructInfo
FindInterfaceByAnnotation find all interfaces by annotation
func (*Indexer) FindInterfaceImplementation ¶
func (indexer *Indexer) FindInterfaceImplementation(name string) []*StructInfo
FindInterfaceImplementation find all interface implementations
func (*Indexer) FindStructByAnnotation ¶
func (indexer *Indexer) FindStructByAnnotation(name string) []*StructInfo
FindStructByAnnotation find all structs by annotation
func (*Indexer) Interfaces ¶
func (indexer *Indexer) Interfaces() map[string]*InterfaceInfo
Interfaces return map of all interfaces
func (*Indexer) LoadPattern ¶
LoadPattern load packages by the pattern to the indexer
func (*Indexer) Packages ¶
func (indexer *Indexer) Packages() map[string]*PackageInfo
Packages return map of all packages
func (*Indexer) Structs ¶
func (indexer *Indexer) Structs() map[string]*StructInfo
Structs return map of all structs
type InterfaceInfo ¶
type InterfaceInfo struct {
// contains filtered or unexported fields
}
InterfaceInfo represents interface
func (*InterfaceInfo) Annotations ¶
func (s *InterfaceInfo) Annotations() []*AnnotationInfo
Annotations returns list of interface annotations or emtpy list
func (*InterfaceInfo) Ast ¶
func (s *InterfaceInfo) Ast() *AstTypeDecl
Ast ast declaration of the type
type PackageInfo ¶
type PackageInfo struct {
// contains filtered or unexported fields
}
PackageInfo struct represents the package information
type StructInfo ¶
type StructInfo struct {
// contains filtered or unexported fields
}
StructInfo information about the struct
func (*StructInfo) Annotations ¶
func (s *StructInfo) Annotations() []*AnnotationInfo
Annotations returns list of struct annotations of empty list
func (*StructInfo) Fields ¶ added in v0.6.0
func (s *StructInfo) Fields(walk FieldStructWalk)
func (*StructInfo) Package ¶
func (s *StructInfo) Package() *PackageInfo
Package struct package info