registry

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = NewRegistry()

Functions

This section is empty.

Types

type Instrumentation

type Instrumentation interface {
	// ImportPath returns instrumentation import path
	ImportPath() string
}

type Recipe

type Recipe interface {
	Instrument(fset *token.FileSet, f ast.Node, pkgName, sensorVar string) bool
	Instrumentation
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is responsible for keeping mapping between packages and their instrumentation.

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns Registry instance

func (*Registry) InstrumentationImportPath

func (r *Registry) InstrumentationImportPath(targetPkg string) string

InstrumentationImportPath returns instrumentation import path for targetPkg, if any registered or empty string otherwise.

func (*Registry) InstrumentationRecipe

func (r *Registry) InstrumentationRecipe(targetPkg string) Recipe

InstrumentationRecipe returns recipe for the targetPkg if any registered.

func (*Registry) ListNames

func (r *Registry) ListNames() []string

ListNames returns list of the package names, that has registered instrumentations.

func (*Registry) Register

func (r *Registry) Register(targetPkg string, instrumentation Recipe)

Register creates a mapping between targetPkg and instrumentation. It should be invoked with `init()` function

func (*Registry) Unregister

func (r *Registry) Unregister(targetPkg string)

Unregister the recipe by package name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL