Documentation
¶
Index ¶
- Constants
- func AddGoGraphArtifactsToStoreV3(manifest Manifest, goSum []byte, graphMods map[string][]byte, ...) error
- func BuildGoModuleSnapshotV3(verified VerifiedCapsuleV3) ([]byte, error)
- func BuildWorkspaceSnapshotV3(verified VerifiedCapsuleV3) ([]byte, error)
- func CompareGoModuleGraphV3(expected []GoModuleV3, actual []GoModuleIdentityV3) error
- func DiscoverGoEmbedFilesV3(workspaceRoot string, moduleCacheRoot string, ...) ([]string, error)
- func DiscoverGoEmbedFilesV3WithExecutable(workspaceRoot string, moduleCacheRoot string, goExecutable string, ...) ([]string, error)
- func DiscoverGoSourceFilesV3(workspaceRoot string, moduleCacheRoot string, ...) ([]string, error)
- func DiscoverGoSourceFilesV3WithExecutable(workspaceRoot string, moduleCacheRoot string, goExecutable string, ...) ([]string, error)
- func InspectGoModuleCacheWithExecutable(workingDir string, goExecutable string) (string, error)
- func InspectGoModuleRequirements(workspace string) (bool, error)
- func IsSupportedGoVersion(version string) bool
- func LocalGoToolchainEnv() []string
- func ParseGoEmbedFilesV3(r io.Reader, workspaceRoot string) ([]string, error)
- func ParseGoSourceFilesV3(r io.Reader, workspaceRoot string) ([]string, error)
- func PrepareGoModuleCacheV3(cacheRoot string, verified VerifiedCapsuleV3) error
- func ResolveGoExecutable() (string, error)
- func RestoreWorkspace(root string, verified VerifiedCapsule) error
- func RestoreWorkspaceV2(root string, verified VerifiedCapsuleV2) error
- func RestoreWorkspaceV3(workspaceRoot string, artifactsRoot string, verified VerifiedCapsuleV3) error
- func SHA256(data []byte) string
- func SplitExtendedGoArtifactsV3(manifest Manifest, artifacts map[string][]byte) (map[string][]byte, map[string][]byte, map[string][]byte, error)
- func SplitGoArtifactsV3(modules []GoModuleV3, graphFiles []GoGraphModFileV3, ...) (map[string][]byte, map[string][]byte, error)
- func ValidateGoGraphInfoFilesV3(files []GoGraphInfoFileV3, selected []GoModuleIdentityV3, full []GoModuleV3) error
- func ValidateGoGraphModFilesV3(files []GoGraphModFileV3) error
- func ValidateGoModuleConsistencyV3(goMod []byte, modules []GoModuleV3) error
- func ValidateGoModulesV3(modules []GoModuleV3) error
- func ValidateGoSelectedMetadataCompletenessV3(selected []GoModuleIdentityV3, full []GoModuleV3, ...) error
- func ValidateGoSelectedModuleConsistencyV3(goMod []byte, manifest Manifest) error
- func ValidateGoSelectedModulesV3(selected []GoModuleIdentityV3, full []GoModuleV3) error
- func ValidateGoWorkspaceV3(workingDir string) error
- func ValidateGoWorkspaceV3WithExecutable(workingDir string, goExecutable string) error
- func ValidateWorkspacePath(name string, mode fs.FileMode) error
- func VerifyGoGraphInfoArtifactSetV3(files []GoGraphInfoFileV3, artifacts map[string][]byte) error
- func VerifyGoGraphInfoFileV3(file GoGraphInfoFileV3, data []byte) error
- func VerifyGoGraphModArtifactSetV3(files []GoGraphModFileV3, artifacts map[string][]byte, goSum []byte) error
- func VerifyGoGraphModFileV3(file GoGraphModFileV3, data []byte, goSum []byte) error
- func VerifyGoModuleArtifactSetV3(modules []GoModuleV3, artifacts map[string][]byte, goSum []byte) error
- func VerifyGoModuleArtifactsV3(mod GoModuleV3, artifacts map[string][]byte, goSum []byte) error
- func VerifyStagedWorkspaceV3(root string, manifest Manifest) error
- func VerifyWorkspaceFile(metadata FileMetadata, data []byte) error
- func VerifyWorkspaceFileV2(metadata FileMetadata, data []byte) error
- func Write(w io.Writer, manifest Manifest) error
- func WriteFile(output string, manifest Manifest, file WorkspaceFile) (err error)
- func WriteGoModuleSnapshotFromStoreV3(w io.Writer, verified VerifiedStoredCapsuleV3) error
- func WriteGoModuleSnapshotV3(w io.Writer, verified VerifiedCapsuleV3) error
- func WriteWithWorkspace(w io.Writer, manifest Manifest, file WorkspaceFile) error
- func WriteWorkspaceFromStoreV3(w io.Writer, manifest Manifest, files []WorkspaceFile, store *ArtifactStoreV3) error
- func WriteWorkspaceSnapshotV3(w io.Writer, verified VerifiedCapsuleV3) error
- func WriteWorkspaceV2(w io.Writer, manifest Manifest, files []WorkspaceFile) error
- func WriteWorkspaceV3(w io.Writer, manifest Manifest, files []WorkspaceFile, ...) error
- type ArtifactStoreV3
- type Execution
- type FileMetadata
- type GoBuildEnvironment
- type GoDependencyState
- type GoDependencyStatus
- type GoGraphInfoFileV3
- type GoGraphModFileV3
- type GoModuleArtifact
- type GoModuleIdentityV3
- func EffectiveGoSelectedModulesV3(manifest Manifest) []GoModuleIdentityV3
- func ListGoBuildModulesV3(workspaceRoot string, moduleCacheRoot string, selected []GoModuleIdentityV3) ([]GoModuleIdentityV3, error)
- func ListGoBuildModulesV3WithExecutable(workspaceRoot string, moduleCacheRoot string, selected []GoModuleIdentityV3, ...) ([]GoModuleIdentityV3, error)
- func ListGoGraphModRequirementsV3(workspaceRoot string, moduleCacheRoot string, mainModulePath string, ...) ([]GoModuleIdentityV3, error)
- func ListGoGraphModRequirementsV3WithExecutable(workspaceRoot string, moduleCacheRoot string, mainModulePath string, ...) ([]GoModuleIdentityV3, error)
- func ListGoModuleGraphV3(workspaceRoot string, moduleCacheRoot string) ([]GoModuleIdentityV3, error)
- func ListGoModuleGraphV3WithExecutable(workspaceRoot string, moduleCacheRoot string, goExecutable string) ([]GoModuleIdentityV3, error)
- func ParseGoGraphModRequirementsV3(graph []byte, mainModulePath string, selected []GoModuleIdentityV3) ([]GoModuleIdentityV3, error)
- func ParseGoModuleGraphV3(data []byte) ([]GoModuleIdentityV3, error)
- func SelectGoBuildModulesV3(r io.Reader, selected []GoModuleIdentityV3) ([]GoModuleIdentityV3, error)
- func SelectVerifiedGoGraphModsV3(selected []GoModuleIdentityV3, full []GoModuleV3, ...) ([]GoModuleIdentityV3, error)
- type GoModuleV3
- func ReadGoDependenciesForCaptureV3(goMod []byte, goSum []byte, moduleCacheRoot string) ([]GoModuleV3, map[string][]byte, error)
- func ReadGoModuleArtifactSetForCaptureV3(modules []GoModuleIdentityV3, goSum []byte, moduleCacheRoot string) ([]GoModuleV3, map[string][]byte, error)
- func ReadGoModuleArtifactSetToStoreV3(modules []GoModuleIdentityV3, goSum []byte, moduleCacheRoot string, ...) ([]GoModuleV3, error)
- func ReadGoModuleArtifactsForCaptureV3(goMod []byte, goSum []byte, moduleCacheRoot string) (GoModuleV3, map[string][]byte, error)
- type Manifest
- type Platform
- type Runtime
- type VerifiedCapsule
- type VerifiedCapsuleV2
- type VerifiedCapsuleV3
- type VerifiedStoredCapsuleV3
- type Workspace
- type WorkspaceFile
Constants ¶
const ( MaxGoGraphInfoFilesV3 = MaxGoSelectedModulesV3 MaxGoGraphInfoTotalSizeV3 int64 = 1 << 20 )
const ( MaxGoGraphModFilesV3 = 128 MaxGoGraphModTotalSizeV3 int64 = 1 << 20 )
const ( MaxGoModulesV3 = 64 MaxGoModuleArtifactsV3 = 3 MaxGoModuleTotalSizeV3 int64 = 64 << 20 MaxGoModuleUnpackedSizeV3 int64 = 48 << 20 )
const ( SchemaVersionV1 = 1 SchemaVersionV2 = 2 SchemaVersionV3 = 3 // SchemaVersion remains v1 until the v2 writer and reader are ready. SchemaVersion = SchemaVersionV1 )
const ( SupportedGoVersion = "1.26.6" SupportedGoVersion125 = "1.25.14" )
const ( MaxWorkspaceV2Files = 64 MaxWorkspaceV2TotalSize = 14 << 20 )
const MaxCapsuleSize int64 = 16 << 20
const MaxCapsuleSizeV3 int64 = 96 << 20
MaxCapsuleSizeV3 bounds schema-v3 archives and prepared replay snapshots independently of legacy capsule formats.
const MaxGoDependencyDiagnosticsSize int64 = 8 << 20
const MaxGoModuleUnpackedTotalSizeV3 int64 = 256 << 20
MaxGoModuleUnpackedTotalSizeV3 bounds the combined verified unpacked ZIP contents of selected Go modules.
const MaxGoSelectedModulesV3 = 128
const MaxManifestSize = 1 << 20 // 1 MiB
const MaxWorkspaceFileSize int64 = 10 << 20 // 10 MiB
const MaxWorkspaceV2PathBytes = 90
const MaxWorkspaceV3Files = 2048
Schema v3 can capture larger source trees without relaxing the existing schema-v2 workspace count limit.
Variables ¶
This section is empty.
Functions ¶
func AddGoGraphArtifactsToStoreV3 ¶
func AddGoGraphArtifactsToStoreV3( manifest Manifest, goSum []byte, graphMods map[string][]byte, graphInfos map[string][]byte, store *ArtifactStoreV3, ) error
AddGoGraphArtifactsToStoreV3 appends validated graph-only .mod and .info artifacts to a store that may already contain full Go modules.
Graph metadata is deliberately bounded to its existing 1 MiB category budgets. The caller owns the store and closes it.
func BuildGoModuleSnapshotV3 ¶
func BuildGoModuleSnapshotV3( verified VerifiedCapsuleV3, ) ([]byte, error)
BuildGoModuleSnapshotV3 creates a deterministic TAR containing the verified Go module download cache.
It does not read artifacts from host staging.
func BuildWorkspaceSnapshotV3 ¶
func BuildWorkspaceSnapshotV3( verified VerifiedCapsuleV3, ) ([]byte, error)
BuildWorkspaceSnapshotV3 preserves the existing in-memory API.
func CompareGoModuleGraphV3 ¶
func CompareGoModuleGraphV3( expected []GoModuleV3, actual []GoModuleIdentityV3, ) error
CompareGoModuleGraphV3 requires an exact ordered match between manifest modules and the externally resolved Go module graph.
The main workspace module is excluded from actual.
func DiscoverGoEmbedFilesV3 ¶
func DiscoverGoEmbedFilesV3( workspaceRoot string, moduleCacheRoot string, sourceTarget ...GoBuildEnvironment, ) ([]string, error)
DiscoverGoEmbedFilesV3 finds embedded resources in packages selected by go build ./... for linux/amd64 and, when requested, darwin/arm64. The results are deduplicated.
Discovery uses the local Go toolchain without network module downloads. The subprocess is not a filesystem or network sandbox.
func DiscoverGoEmbedFilesV3WithExecutable ¶
func DiscoverGoEmbedFilesV3WithExecutable( workspaceRoot string, moduleCacheRoot string, goExecutable string, sourceTarget ...GoBuildEnvironment, ) ([]string, error)
DiscoverGoEmbedFilesV3WithExecutable runs discovery using the selected Go toolchain.
func DiscoverGoSourceFilesV3 ¶
func DiscoverGoSourceFilesV3( workspaceRoot string, moduleCacheRoot string, sourceTarget ...GoBuildEnvironment, ) ([]string, error)
DiscoverGoSourceFilesV3 discovers selected Go sources for Linux AMD64 and, when different, the supported source platform.
Discovery does not download modules. It is not a sandbox: only invoke it on workspaces trusted by the user.
func DiscoverGoSourceFilesV3WithExecutable ¶
func DiscoverGoSourceFilesV3WithExecutable( workspaceRoot string, moduleCacheRoot string, goExecutable string, sourceTarget ...GoBuildEnvironment, ) ([]string, error)
DiscoverGoSourceFilesV3WithExecutable runs discovery using the selected Go toolchain.
func InspectGoModuleCacheWithExecutable ¶
InspectGoModuleCacheWithExecutable resolves GOMODCACHE using the explicitly selected Go executable without automatic toolchain switching.
func InspectGoModuleRequirements ¶
InspectGoModuleRequirements reports whether go.mod declares module requirements. It does not resolve dependencies or contact a registry.
func IsSupportedGoVersion ¶
IsSupportedGoVersion accepts only exact Go toolchain patch versions for which REW maintains a compatible replay runtime.
func LocalGoToolchainEnv ¶
func LocalGoToolchainEnv() []string
LocalGoToolchainEnv preserves the process environment while ensuring exactly one GOTOOLCHAIN=local entry.
func ParseGoEmbedFilesV3 ¶
ParseGoEmbedFilesV3 extracts main-workspace embedded files from bounded go list -e -json ./... output. It does not read files.
func ParseGoSourceFilesV3 ¶
ParseGoSourceFilesV3 selects Go source files from bounded go list -e -json ./... metadata. It does not read source contents.
GoFiles reflects the selected platform and build constraints. Incomplete package metadata is not automatically fatal because build failures can still have a valid GoFiles selection.
func PrepareGoModuleCacheV3 ¶
func PrepareGoModuleCacheV3( cacheRoot string, verified VerifiedCapsuleV3, ) error
PrepareGoModuleCacheV3 writes verified Go module artifacts into the standard Go module download-cache layout.
cacheRoot must exist and must be empty. The returned directory is suitable for a read-only Docker bind mount.
func ResolveGoExecutable ¶
ResolveGoExecutable resolves the Go executable from PATH once. It does not establish filesystem immutability or verify the Go version.
func RestoreWorkspace ¶
func RestoreWorkspace(root string, verified VerifiedCapsule) error
func RestoreWorkspaceV2 ¶
func RestoreWorkspaceV2(root string, verified VerifiedCapsuleV2) error
func RestoreWorkspaceV3 ¶
func RestoreWorkspaceV3( workspaceRoot string, artifactsRoot string, verified VerifiedCapsuleV3, ) error
func SplitExtendedGoArtifactsV3 ¶
func SplitExtendedGoArtifactsV3( manifest Manifest, artifacts map[string][]byte, ) ( map[string][]byte, map[string][]byte, map[string][]byte, error, )
SplitExtendedGoArtifactsV3 separates full module artifacts, additional graph .mod artifacts, and metadata-only .info files.
func SplitGoArtifactsV3 ¶
func SplitGoArtifactsV3( modules []GoModuleV3, graphFiles []GoGraphModFileV3, artifacts map[string][]byte, ) (map[string][]byte, map[string][]byte, error)
SplitGoArtifactsV3 separates declared selected-module artifacts from declared graph-only .mod artifacts. Unknown and duplicate artifact names are rejected.
func ValidateGoGraphInfoFilesV3 ¶
func ValidateGoGraphInfoFilesV3( files []GoGraphInfoFileV3, selected []GoModuleIdentityV3, full []GoModuleV3, ) error
ValidateGoGraphInfoFilesV3 validates metadata-only .info declarations against the complete selected module graph.
Full ZIP modules already contain their own .info artifacts and must never be duplicated here.
func ValidateGoGraphModFilesV3 ¶
func ValidateGoGraphModFilesV3(files []GoGraphModFileV3) error
ValidateGoGraphModFilesV3 validates metadata for additional go.mod files required to reconstruct a Go module graph offline.
These files are separate from selected modules and must contain only module metadata, never ZIP archives or executable content.
func ValidateGoModuleConsistencyV3 ¶
func ValidateGoModuleConsistencyV3( goMod []byte, modules []GoModuleV3, ) error
ValidateGoModuleConsistencyV3 checks that every root go.mod requirement exists in the manifest with the same version.
Additional manifest modules may be transitive dependencies. This check does not prove that the manifest contains the complete selected Go module graph.
func ValidateGoModulesV3 ¶
func ValidateGoModulesV3(modules []GoModuleV3) error
func ValidateGoSelectedMetadataCompletenessV3 ¶
func ValidateGoSelectedMetadataCompletenessV3( selected []GoModuleIdentityV3, full []GoModuleV3, infoFiles []GoGraphInfoFileV3, ) error
ValidateGoSelectedMetadataCompletenessV3 requires precisely one representation for every selected module:
- a full ZIP/MOD/INFO module; or
- an additional metadata-only .info file.
Legacy schema-v3 manifests retain their existing behavior.
func ValidateGoSelectedModuleConsistencyV3 ¶
ValidateGoSelectedModuleConsistencyV3 checks root go.mod requirements against the effective selected module build list.
Legacy schema-v3 manifests derive that list from full ZIP modules. Extended manifests use GoSelectedModules.
func ValidateGoSelectedModulesV3 ¶
func ValidateGoSelectedModulesV3( selected []GoModuleIdentityV3, full []GoModuleV3, ) error
ValidateGoSelectedModulesV3 checks a complete, strictly ordered selected Go module build list, independently of ZIP availability.
An absent list means legacy schema-v3 behavior. An explicit list must include every module represented by a full ZIP artifact.
func ValidateGoWorkspaceV3 ¶
ValidateGoWorkspaceV3 rejects an active go.work configuration. An empty effective GOWORK means module mode is in use.
func ValidateGoWorkspaceV3WithExecutable ¶
ValidateGoWorkspaceV3WithExecutable checks GOWORK using the selected Go executable without automatic toolchain switching.
func VerifyGoGraphInfoArtifactSetV3 ¶
func VerifyGoGraphInfoArtifactSetV3( files []GoGraphInfoFileV3, artifacts map[string][]byte, ) error
VerifyGoGraphInfoArtifactSetV3 verifies the complete set of metadata-only .info files declared by a manifest.
The caller must separately validate the manifest's selected graph and full ZIP module lists.
func VerifyGoGraphInfoFileV3 ¶
func VerifyGoGraphInfoFileV3( file GoGraphInfoFileV3, data []byte, ) error
VerifyGoGraphInfoFileV3 verifies a bounded metadata-only .info artifact. It establishes capsule integrity and identity consistency, not external module provenance.
func VerifyGoGraphModArtifactSetV3 ¶
func VerifyGoGraphModArtifactSetV3( files []GoGraphModFileV3, artifacts map[string][]byte, goSum []byte, ) error
VerifyGoGraphModArtifactSetV3 verifies additional module graph metadata independently from the selected module artifact set.
func VerifyGoGraphModFileV3 ¶
func VerifyGoGraphModFileV3( file GoGraphModFileV3, data []byte, goSum []byte, ) error
VerifyGoGraphModFileV3 verifies an additional module go.mod needed to reconstruct the dependency graph offline.
func VerifyGoModuleArtifactSetV3 ¶
func VerifyGoModuleArtifactSetV3( modules []GoModuleV3, artifacts map[string][]byte, goSum []byte, ) error
VerifyGoModuleArtifactSetV3 validates the entire artifact set. It rejects missing, extra, and incorrectly indexed artifacts.
func VerifyGoModuleArtifactsV3 ¶
func VerifyGoModuleArtifactsV3( mod GoModuleV3, artifacts map[string][]byte, goSum []byte, ) error
VerifyGoModuleArtifactsV3 preserves the single-module API.
func VerifyStagedWorkspaceV3 ¶
VerifyStagedWorkspaceV3 checks the restored workspace immediately before Docker receives it as a bind mount.
func VerifyWorkspaceFile ¶
func VerifyWorkspaceFile(metadata FileMetadata, data []byte) error
func VerifyWorkspaceFileV2 ¶
func VerifyWorkspaceFileV2(metadata FileMetadata, data []byte) error
func WriteGoModuleSnapshotFromStoreV3 ¶
func WriteGoModuleSnapshotFromStoreV3( w io.Writer, verified VerifiedStoredCapsuleV3, ) error
WriteGoModuleSnapshotFromStoreV3 streams a verified module-cache snapshot from disk-backed artifacts without loading ZIPs into RAM.
The caller must discard the destination if an error occurs.
func WriteGoModuleSnapshotV3 ¶
func WriteGoModuleSnapshotV3( w io.Writer, verified VerifiedCapsuleV3, ) error
WriteGoModuleSnapshotV3 writes a verified module-cache TAR to w. On error the destination may contain an incomplete archive; callers must discard it rather than pass it to Docker.
func WriteWithWorkspace ¶
func WriteWithWorkspace( w io.Writer, manifest Manifest, file WorkspaceFile, ) error
func WriteWorkspaceFromStoreV3 ¶
func WriteWorkspaceFromStoreV3( w io.Writer, manifest Manifest, files []WorkspaceFile, store *ArtifactStoreV3, ) error
WriteWorkspaceFromStoreV3 emits a schema-v3 capsule using verified disk-backed dependency artifacts.
All validation completes before output begins. A destination write failure can leave a partial TAR; callers must discard it.
func WriteWorkspaceSnapshotV3 ¶
func WriteWorkspaceSnapshotV3( w io.Writer, verified VerifiedCapsuleV3, ) error
WriteWorkspaceSnapshotV3 writes a verified workspace TAR to w. On write failure, w may contain a partial archive. The caller must not publish or execute a partial archive.
func WriteWorkspaceV2 ¶
func WriteWorkspaceV2( w io.Writer, manifest Manifest, files []WorkspaceFile, ) error
func WriteWorkspaceV3 ¶
func WriteWorkspaceV3( w io.Writer, manifest Manifest, files []WorkspaceFile, artifacts map[string][]byte, ) error
WriteWorkspaceV3 writes a schema-v3 capsule containing a workspace and up to sixteen verified Go modules.
It validates all inputs before writing any bytes to w.
Types ¶
type ArtifactStoreV3 ¶
type ArtifactStoreV3 struct {
// contains filtered or unexported fields
}
ArtifactStoreV3 holds verified artifacts in a private temporary directory. It is not safe for concurrent use.
func NewArtifactStoreV3 ¶
func NewArtifactStoreV3(budget int64) (*ArtifactStoreV3, error)
NewArtifactStoreV3 creates a private store with a strict byte budget.
func (*ArtifactStoreV3) Close ¶
func (s *ArtifactStoreV3) Close() error
Close invalidates the store and removes its temporary directory. Callers must close any readers previously returned by Open.
func (*ArtifactStoreV3) Open ¶
func (s *ArtifactStoreV3) Open(name string) (*os.File, error)
Open returns a reader for a previously verified, published artifact.
func (*ArtifactStoreV3) Put ¶
func (s *ArtifactStoreV3) Put( name string, src io.Reader, size int64, expectedSHA256 string, ) (resultErr error)
Put writes exactly size bytes, verifies SHA-256 and publishes atomically. On failure, no artifact is published or charged against the budget.
func (*ArtifactStoreV3) Used ¶
func (s *ArtifactStoreV3) Used() int64
type FileMetadata ¶
type GoBuildEnvironment ¶
type GoBuildEnvironment struct {
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
CGOEnabled string `json:"cgo_enabled"`
GOFLAGS string `json:"goflags"`
}
func InspectGoBuildEnvironment ¶
func InspectGoBuildEnvironment(workingDir string) ( GoBuildEnvironment, error, )
InspectGoBuildEnvironment reads the effective Go configuration. It does not modify the user's environment.
func InspectGoBuildEnvironmentWithExecutable ¶
func InspectGoBuildEnvironmentWithExecutable( workingDir string, goExecutable string, ) (GoBuildEnvironment, error)
InspectGoBuildEnvironmentWithExecutable reads the Go environment through an explicitly selected executable with GOTOOLCHAIN=local.
func (GoBuildEnvironment) ValidatePortableGoBuild ¶
func (e GoBuildEnvironment) ValidatePortableGoBuild() error
ValidatePortableGoBuild checks the initial portability policy.
type GoDependencyState ¶
type GoDependencyState string
const ( GoDependenciesReady GoDependencyState = "ready" GoDependenciesUnknown GoDependencyState = "unknown" )
type GoDependencyStatus ¶
type GoDependencyStatus struct {
State GoDependencyState `json:"state"`
Reason string `json:"reason,omitempty"`
}
func InspectGoListOutput ¶
func InspectGoListOutput(r io.Reader) (GoDependencyStatus, error)
InspectGoListOutput analyzes the structured output of "go list -deps -e -json ./...".
It does not execute Go, access the network, or change files.
func (GoDependencyStatus) Validate ¶
func (s GoDependencyStatus) Validate() error
type GoGraphInfoFileV3 ¶
type GoGraphInfoFileV3 struct {
Path string `json:"path"`
Version string `json:"version"`
Artifact GoModuleArtifact `json:"artifact"`
}
func ReadGoGraphInfoFilesForCaptureV3 ¶
func ReadGoGraphInfoFilesForCaptureV3( selected []GoModuleIdentityV3, full []GoModuleV3, moduleCacheRoot string, ) ([]GoGraphInfoFileV3, map[string][]byte, error)
ReadGoGraphInfoFilesForCaptureV3 reads metadata-only .info files from the local cache without downloading dependencies.
type GoGraphModFileV3 ¶
type GoGraphModFileV3 struct {
Path string `json:"path"`
Version string `json:"version"`
Artifact GoModuleArtifact `json:"artifact"`
}
func ReadGoGraphModFilesForCaptureV3 ¶
func ReadGoGraphModFilesForCaptureV3( identities []GoModuleIdentityV3, goSum []byte, moduleCacheRoot string, ) ([]GoGraphModFileV3, map[string][]byte, error)
ReadGoGraphModFilesForCaptureV3 reads additional go.mod files from the local Go module cache without network access.
type GoModuleArtifact ¶
type GoModuleIdentityV3 ¶
GoModuleIdentityV3 represents one selected external module.
func EffectiveGoSelectedModulesV3 ¶
func EffectiveGoSelectedModulesV3( manifest Manifest, ) []GoModuleIdentityV3
EffectiveGoSelectedModulesV3 returns the explicit selected graph, or the complete ZIP-module list used by legacy schema-v3 capsules.
func ListGoBuildModulesV3 ¶
func ListGoBuildModulesV3( workspaceRoot string, moduleCacheRoot string, selected []GoModuleIdentityV3, ) ([]GoModuleIdentityV3, error)
ListGoBuildModulesV3 finds external modules actually used by go build ./... without allowing network module downloads.
This invokes the local Go toolchain. It is not a filesystem sandbox.
func ListGoBuildModulesV3WithExecutable ¶
func ListGoBuildModulesV3WithExecutable( workspaceRoot string, moduleCacheRoot string, selected []GoModuleIdentityV3, goExecutable string, ) ([]GoModuleIdentityV3, error)
func ListGoGraphModRequirementsV3 ¶
func ListGoGraphModRequirementsV3( workspaceRoot string, moduleCacheRoot string, mainModulePath string, selected []GoModuleIdentityV3, ) ([]GoModuleIdentityV3, error)
ListGoGraphModRequirementsV3 resolves additional graph-only module versions without permitting network downloads.
This invokes the local Go toolchain, not a filesystem sandbox.
func ListGoGraphModRequirementsV3WithExecutable ¶
func ListGoGraphModRequirementsV3WithExecutable( workspaceRoot string, moduleCacheRoot string, mainModulePath string, selected []GoModuleIdentityV3, goExecutable string, ) ([]GoModuleIdentityV3, error)
func ListGoModuleGraphV3 ¶
func ListGoModuleGraphV3( workspaceRoot string, moduleCacheRoot string, ) ([]GoModuleIdentityV3, error)
ListGoModuleGraphV3 determines selected Go modules without permitting Go module downloads.
This is not a filesystem sandbox. It invokes the local Go toolchain.
func ListGoModuleGraphV3WithExecutable ¶
func ListGoModuleGraphV3WithExecutable( workspaceRoot string, moduleCacheRoot string, goExecutable string, ) ([]GoModuleIdentityV3, error)
func ParseGoGraphModRequirementsV3 ¶
func ParseGoGraphModRequirementsV3( graph []byte, mainModulePath string, selected []GoModuleIdentityV3, ) ([]GoModuleIdentityV3, error)
ParseGoGraphModRequirementsV3 identifies module versions referenced by go mod graph that are not part of the selected module set.
The input must come from a separately bounded, offline Go command.
func ParseGoModuleGraphV3 ¶
func ParseGoModuleGraphV3(data []byte) ([]GoModuleIdentityV3, error)
ParseGoModuleGraphV3 parses the JSON stream produced by: go list -m -json all
It rejects replacements, invalid identities, duplicate paths, missing main modules, and oversized graphs.
func SelectGoBuildModulesV3 ¶
func SelectGoBuildModulesV3( r io.Reader, selected []GoModuleIdentityV3, ) ([]GoModuleIdentityV3, error)
SelectGoBuildModulesV3 extracts the external modules used by packages in a complete go list -deps -e -json ./... result.
The complete selected module graph is provided separately. Dependency loading errors are never treated as an empty or successful dependency selection.
func SelectVerifiedGoGraphModsV3 ¶
func SelectVerifiedGoGraphModsV3( selected []GoModuleIdentityV3, full []GoModuleV3, historical []GoModuleIdentityV3, goSum []byte, ) ([]GoModuleIdentityV3, error)
SelectVerifiedGoGraphModsV3 selects additional .mod versions whose /go.mod checksums are declared in the captured go.sum.
Full ZIP modules already contain a verified .mod. Metadata-only selected modules and historical graph versions may need .mod.
type GoModuleV3 ¶
type GoModuleV3 struct {
Path string `json:"path"`
Version string `json:"version"`
Artifacts []GoModuleArtifact `json:"artifacts"`
}
func ReadGoDependenciesForCaptureV3 ¶
func ReadGoDependenciesForCaptureV3( goMod []byte, goSum []byte, moduleCacheRoot string, ) ([]GoModuleV3, map[string][]byte, error)
ReadGoDependenciesForCaptureV3 captures zero or one direct Go dependency. It never downloads modules.
func ReadGoModuleArtifactSetForCaptureV3 ¶
func ReadGoModuleArtifactSetForCaptureV3( modules []GoModuleIdentityV3, goSum []byte, moduleCacheRoot string, ) ([]GoModuleV3, map[string][]byte, error)
ReadGoModuleArtifactSetForCaptureV3 reads selected Go module artifacts from the local module download cache.
It never downloads modules or accesses the network. Modules must have unique paths in ascending order.
func ReadGoModuleArtifactSetToStoreV3 ¶
func ReadGoModuleArtifactSetToStoreV3( modules []GoModuleIdentityV3, goSum []byte, moduleCacheRoot string, store *ArtifactStoreV3, ) ([]GoModuleV3, error)
ReadGoModuleArtifactSetToStoreV3 copies selected Go module artifacts from the local cache to an existing private store.
No downloads are performed. ZIP contents are never accumulated in memory. The caller owns and closes the store.
Use a fresh store; partial artifacts on error belong to the caller.
func ReadGoModuleArtifactsForCaptureV3 ¶
func ReadGoModuleArtifactsForCaptureV3( goMod []byte, goSum []byte, moduleCacheRoot string, ) (GoModuleV3, map[string][]byte, error)
ReadGoModuleArtifactsForCaptureV3 reads one direct Go dependency from the local Go module download cache.
It does not download modules or access the network.
type Manifest ¶
type Manifest struct {
SchemaVersion int `json:"schema_version"`
Execution Execution `json:"execution"`
Platform Platform `json:"platform"`
Workspace Workspace `json:"workspace"`
Runtime *Runtime `json:"runtime,omitempty"`
GoBuildEnv *GoBuildEnvironment `json:"go_build_env,omitempty"`
GoDependencies *GoDependencyStatus `json:"go_dependencies,omitempty"`
GoModules []GoModuleV3 `json:"go_modules,omitempty"`
GoSelectedModules []GoModuleIdentityV3 `json:"go_selected_modules,omitempty"`
GoGraphInfoFiles []GoGraphInfoFileV3 `json:"go_graph_info_files,omitempty"`
GoGraphModFiles []GoGraphModFileV3 `json:"go_graph_mod_files,omitempty"`
}
func ReadManifest ¶
type Runtime ¶
func DetectRuntime ¶
DetectRuntime identifies supported toolchains for capture. Unknown commands return nil, preserving legacy behavior.
func DetectRuntimeWithExecutable ¶
DetectRuntimeWithExecutable checks the runtime using an explicitly selected Go executable. It does not change supported Go versions.
type VerifiedCapsule ¶
type VerifiedCapsule struct {
Manifest Manifest
File WorkspaceFile
}
func ReadVerified ¶
func ReadVerified(filename string) (VerifiedCapsule, error)
type VerifiedCapsuleV2 ¶
type VerifiedCapsuleV2 struct {
Manifest Manifest
Files []WorkspaceFile
}
func ReadVerifiedV2 ¶
func ReadVerifiedV2(filename string) (VerifiedCapsuleV2, error)
type VerifiedCapsuleV3 ¶
type VerifiedCapsuleV3 struct {
Manifest Manifest
Files []WorkspaceFile
Artifacts map[string][]byte
}
func ReadVerifiedV3 ¶
func ReadVerifiedV3(filename string) (VerifiedCapsuleV3, error)
type VerifiedStoredCapsuleV3 ¶
type VerifiedStoredCapsuleV3 struct {
Manifest Manifest
Files []WorkspaceFile
Store *ArtifactStoreV3
}
VerifiedStoredCapsuleV3 owns a disk-backed artifact store. The caller must call Close when finished.
func ReadVerifiedToStoreV3 ¶
func ReadVerifiedToStoreV3( filename string, ) (result VerifiedStoredCapsuleV3, resultErr error)
ReadVerifiedToStoreV3 reads a schema-v3 capsule and places dependencies on disk instead of retaining their ZIP bytes in RAM.
Workspace files remain bounded in memory. All dependencies are verified before this function succeeds.
func (*VerifiedStoredCapsuleV3) Close ¶
func (v *VerifiedStoredCapsuleV3) Close() error
type Workspace ¶
type Workspace struct {
Files []FileMetadata `json:"files"`
}
type WorkspaceFile ¶
func ReadWorkspaceFile ¶
func ReadWorkspaceFile(root, name string) (WorkspaceFile, error)
func ReadWorkspaceFilesV2 ¶
func ReadWorkspaceFilesV2(root string, paths []string) ([]WorkspaceFile, error)
func ReadWorkspaceFilesV3 ¶
func ReadWorkspaceFilesV3(root string, paths []string) ([]WorkspaceFile, error)
Source Files
¶
- archive_size_preflight_v3.go
- artifact_store_v3.go
- detect_runtime.go
- digest.go
- file_writer.go
- go_artifact_store_complete_v3.go
- go_build_env.go
- go_build_module_exec_v3.go
- go_build_module_selection_v3.go
- go_dependencies.go
- go_dependencies_capture_v3.go
- go_dependency_diagnostics.go
- go_dependency_status.go
- go_embed_discovery_v3.go
- go_embed_exec_v3.go
- go_extended_artifact_split_v3.go
- go_graph_capture_store_v3.go
- go_graph_info_artifact_set_v3.go
- go_graph_info_files_v3.go
- go_graph_info_reader_v3.go
- go_graph_mod_artifact_set_v3.go
- go_graph_mod_discovery_v3.go
- go_graph_mod_exec_v3.go
- go_graph_mod_files_v3.go
- go_graph_mod_reader_v3.go
- go_graph_mod_selection_v3.go
- go_graph_mod_verify_v3.go
- go_graph_store_verify_v3.go
- go_module_artifact.go
- go_module_artifact_reader_multi_v3.go
- go_module_artifact_set_v3.go
- go_module_cache_env.go
- go_module_cache_v3.go
- go_module_capture_store_v3.go
- go_module_capture_v3.go
- go_module_consistency_v3.go
- go_module_graph_compare_v3.go
- go_module_graph_exec_v3.go
- go_module_graph_v3.go
- go_module_store_set_v3.go
- go_module_store_verify_v3.go
- go_module_unpacked_limit_v3.go
- go_module_verify.go
- go_selected_metadata_completeness_v3.go
- go_selected_module_consistency_v3.go
- go_selected_modules_v3.go
- go_source_discovery_v3.go
- go_source_exec_v3.go
- go_toolchain.go
- go_toolchain_env.go
- go_workspace_v3.go
- limited_output_v3.go
- manifest.go
- module_snapshot_store_v3.go
- module_snapshot_v3.go
- paths.go
- reader.go
- regular_cache_path_v3.go
- restore.go
- restore_v2.go
- restore_v3.go
- runtime.go
- size_limits_v3.go
- snapshot_v3.go
- tar_size.go
- verified_reader.go
- verified_reader_store_v3.go
- verified_reader_v2.go
- verified_reader_v3.go
- verify.go
- verify_staging_v3.go
- verify_v2.go
- workspace.go
- workspace_metadata.go
- workspace_read_v2.go
- workspace_ustar_v3.go
- workspace_v2.go
- workspace_v3_limits.go
- workspace_writer.go
- workspace_writer_store_v3.go
- workspace_writer_v2.go
- workspace_writer_v3.go
- writer.go