pkgs

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvingTestVariants added in v1.12.0

func ResolvingTestVariants() bool

ResolvingTestVariants reports whether the current process belongs to the nested test load used to construct synthetic dependency variants.

func ReverseVariantEnvironment added in v1.12.2

func ReverseVariantEnvironment() (flavor string, packageFiles map[string]string, active bool, err error)

ReverseVariantEnvironment returns the flavor and authoritative package files for a nested build that reconstructs synthetic importers for a test binary.

func Subscribe

func Subscribe(ctx context.Context, serverURL string, conn *nats.Conn, stats *common.CacheStats) (config.PackageLoader, error)

Types

type LoadRequest added in v1.3.0

type LoadRequest struct {
	Dir      string   `json:"dir"`      // The directory to resolve from (usually where `go.mod` is)
	Patterns []string `json:"patterns"` // Package pattern to resolve
}

LoadRequest is a request to load packages relative to a specific directory. It only loads the packages' names and (source) files, not their dependencies or export file. The result is cached for a given Dir+Pattern pair. Each pattern is loaded individually (so that they can be cached independently).

func (LoadRequest) ForeachSpanTag added in v1.3.0

func (r LoadRequest) ForeachSpanTag(set func(key string, value any))

func (LoadRequest) ResponseIs added in v1.3.0

func (LoadRequest) ResponseIs(LoadResponse)

func (LoadRequest) Subject added in v1.3.0

func (LoadRequest) Subject() string

type LoadResponse added in v1.3.0

type LoadResponse []*packages.Package

LoadResponse is the response to a LoadRequest. It contains the packages that were loaded.

type ResolveRequest

type ResolveRequest struct {
	Dir                string   `json:"dir"`                          // The directory to resolve from (usually where `go.mod` is)
	Env                []string `json:"env"`                          // Environment variables to use during resolution
	Pattern            string   `json:"pattern"`                      // Package pattern to resolve
	TempDir            string   `json:"tmpdir,omitempty"`             // A temporary directory to use for Go build artifacts
	TestVariantFor     string   `json:"testVariantFor,omitempty"`     // Resolve the literal Pattern as built for this package's tests
	ReverseTestVariant bool     `json:"reverseTestVariant,omitempty"` // Rebuild Pattern's test-binary import closure against the authoritative test target
	// AuthoritativeTarget is the package-under-test archive selected by the outer test-main compilation.
	AuthoritativeTarget string `json:"authoritativeTarget,omitempty"`
	// ReverseVariantFlavor preserves the stable reverse-universe identity while its temporary environment path is canonicalized out.
	ReverseVariantFlavor string `json:"reverseVariantFlavor,omitempty"`
	// contains filtered or unexported fields
}

func NewResolveRequest

func NewResolveRequest(dir string, pattern string) ResolveRequest

func (ResolveRequest) ForeachSpanTag added in v1.3.0

func (r ResolveRequest) ForeachSpanTag(set func(key string, value any))

func (ResolveRequest) ResponseIs added in v1.0.3

func (ResolveRequest) ResponseIs(ResolveResponse)

func (ResolveRequest) Subject

func (ResolveRequest) Subject() string

type ResolveResponse

type ResolveResponse map[string]ResolvedArchive

ResolveResponse maps package import paths to their resolved export archives.

type ResolvedArchive added in v1.12.0

type ResolvedArchive struct {
	ExportFile string `json:"exportFile"`
	ForTest    string `json:"forTest,omitempty"`
}

ResolvedArchive identifies an export archive and, when non-empty, the test target for which Go rebuilt it.

Jump to

Keyboard shortcuts

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