Documentation ¶
Index ¶
- func BasicSpanName(receiver, function string) string
- func IsBuildExclude(s string) bool
- func IsBuildIgnore(s string) bool
- func IsGoBuildExclude(s string) bool
- func IsGoBuildIgnore(s string) bool
- type Command
- type FunctionSelector
- type GoBuildDirective
- type Instrumenter
- type MapFunctionSelector
- type Processor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicSpanName ¶
BasicSpanName is common notation of <class>.<method> or <pkg>.<func>
func IsBuildExclude ¶
func IsBuildIgnore ¶
func IsGoBuildExclude ¶
func IsGoBuildIgnore ¶
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command to change behavior of Processor or Instrumentor
func CommandsFromFile ¶
CommandsFromFile that has been parsed by `go/parse` with comments
func ParseCommand ¶
ParseCommand from string representation
type FunctionSelector ¶
FunctionSelector tells if function has to be instrumented.
type GoBuildDirective ¶
type GoBuildDirective uint
GoBuildDirective is standard Go compiler directive.
const ( UnknownDirective GoBuildDirective = iota GoBuildIgnore GoBuildExclude BuildIgnore BuildExclude )
func GoBuildDirectivesFromFile ¶
func GoBuildDirectivesFromFile(file ast.File) (directives []GoBuildDirective)
func ParseGoBuildDirective ¶
func ParseGoBuildDirective(s string) GoBuildDirective
func (GoBuildDirective) SkipFile ¶
func (v GoBuildDirective) SkipFile() bool
type Instrumenter ¶
type Instrumenter interface { Imports() []*types.Package PrefixStatements(spanName string, hasError bool) []ast.Stmt }
Instrumenter supplies ast of Go code that will be inserted and required dependencies.
type MapFunctionSelector ¶
MapFunctionSelector makes decision basedd on map value or else default.
func NewMapFunctionSelectorFromCommands ¶
func NewMapFunctionSelectorFromCommands(defaultSelect bool, commands []Command) MapFunctionSelector
NewMapFunctionSelectorFromCommands performs join of function names stored in maps of commands.
func (MapFunctionSelector) AcceptFunction ¶
func (s MapFunctionSelector) AcceptFunction(functionName string) bool
type Processor ¶
type Processor struct { Instrumenter Instrumenter FunctionSelector FunctionSelector SpanName func(receiver, function string) string ContextName string ContextPackage string ContextType string ErrorName string ErrorType string }
Processor traverses AST, collects details on functions and methods, and invokes Instrumenter