Documentation
¶
Index ¶
Constants ¶
View Source
const (
ErrGuruAmbiguous guruErr = "ambiguous selection within source file"
)
View Source
const (
// ErrNodeNotFound is returned whenever a node was not found
ErrNotFound acnErr = "could not find matching ast node"
)
Variables ¶
This section is empty.
Functions ¶
func RunGuruDescribeQuery ¶
func RunGuruDescribeQuery(filepath string, position int, resp *GuruDescribeResponse) error
Types ¶
type ASTFuncDeclContext ¶
type ASTFuncDeclContext struct {
// contains filtered or unexported fields
}
ASTFuncDeclContext is a function declaration in the ast
type Config ¶
type Config struct {
// Folder is the folder of the Go project
Folder string
MainFileName *regexp.Regexp
Blacklist []*regexp.Regexp
}
Config is the Navigator config
type GoProject ¶
type GoProject struct {
// contains filtered or unexported fields
}
GoProject
func AnalizeGoProject ¶
AnalizeGoProject analizes a go project and extract all selected packages metadata
type GuruDescribeResponse ¶
type GuruDescribeResponse struct {
Desc string `json:"identifier"`
Pos string `json:"pos"`
Detail string `json:"detail"`
Value *GuruDescribeValue `json:"value"`
Type *GuruDescribeType `json:"type"`
}
type GuruDescribeType ¶
type GuruDescribeType struct {
Type string `json:"type"`
NamePos string `json:"namepos"`
NameDef string `json:"namedef"`
Methods []GuruDescribeTypeMethod `json:"methods"`
}
type GuruDescribeTypeMethod ¶
type GuruDescribeValue ¶
type GuruDescribeValue struct {
Type string `json:"type"`
ObjPos string `json:"objpos"`
Typespos []GuruDescribeValueTypePos `json:"typespos"`
}
type Navigator ¶
type Navigator struct {
// contains filtered or unexported fields
}
Navigator is a stateful code navigator that will feed matching AST lines to the caller
func NewNavigator ¶
NewNavigator creates a new Navigator
func (*Navigator) FindFunctionCallFromFunc ¶
FindFunctionCallFromFunc funds a function call using a function declaration as node starting point. If funcDecl is nil, this function will assume that the main function is the starting point
func (*Navigator) FindStructCompositeLiteral ¶
func (n *Navigator) FindStructCompositeLiteral() ([]*ast.CompositeLit, error)
FindStructCompositeLiteral finds all struct values
Click to show internal directories.
Click to hide internal directories.