Documentation
¶
Index ¶
- func ComputeInstrumentationHash(inst *Instrumentor, version string) string
- func ExtendImportcfg(origPath string, addedImports map[string]string, objdir string, ...) (string, error)
- func GetPackageExport(importPath string) (string, error)
- func ReadLinkDeps(archivePath string) ([]string, error)
- func WriteLinkDeps(archivePath string, deps []string, stderr io.Writer, debug bool) error
- type DuplicateImportAliasError
- type InstrumentFileResult
- type Instrumentor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeInstrumentationHash ¶
func ComputeInstrumentationHash(inst *Instrumentor, version string) string
ComputeInstrumentationHash computes a hash of all instrumentation rules and the zen-go version. This hash is used to modify the build ID so that when rules or the version change, Go will rebuild packages.
func ExtendImportcfg ¶
func GetPackageExport ¶
GetPackageExport returns the file path to the compiled export data for the given import path. It runs 'go list -export' from the module root.
func ReadLinkDeps ¶
ReadLinkDeps reads link-time dependencies from a sidecar file next to the archive. Returns nil if the file doesn't exist (which is not an error - it means no link deps).
func WriteLinkDeps ¶
WriteLinkDeps writes link-time dependencies to a sidecar file next to the archive. These dependencies are packages that need to be linked into the final binary but are not direct imports of the package being compiled.
Types ¶
type DuplicateImportAliasError ¶
type DuplicateImportAliasError struct {
// contains filtered or unexported fields
}
func (*DuplicateImportAliasError) Error ¶
func (e *DuplicateImportAliasError) Error() string
type InstrumentFileResult ¶
type Instrumentor ¶
type Instrumentor struct {
WrapRules []rules.WrapRule
PrependRules []rules.PrependRule
InjectDeclRules []rules.InjectDeclRule
}
func NewInstrumentor ¶
func NewInstrumentor() (*Instrumentor, error)
NewInstrumentor creates a new Instrumentor, loading rules from YAML files
func NewInstrumentorWithRules ¶
func NewInstrumentorWithRules(rules *rules.InstrumentationRules) *Instrumentor
NewInstrumentorWithRules creates an Instrumentor with the given rules
func (*Instrumentor) InstrumentFile ¶
func (i *Instrumentor) InstrumentFile(filename string, compilingPkg string) (InstrumentFileResult, error)