internal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

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 ExtendImportcfg(origPath string, addedImports map[string]string, objdir string, stderr io.Writer, debug bool) (string, error)

func GetPackageExport

func GetPackageExport(importPath string) (string, error)

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

func ReadLinkDeps(archivePath string) ([]string, error)

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

func WriteLinkDeps(archivePath string, deps []string, stderr io.Writer, debug bool) error

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 InstrumentFileResult struct {
	Code     []byte
	Modified bool
	Imports  map[string]string // alias -> import path (for compile-time imports)
	LinkDeps []string          // import paths (for link-time dependencies via go:linkname)
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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