Documentation
¶
Overview ¶
Package godiscovery decodes the closed Go 1.27 package-discovery stream. It never executes Go or reads repository files; callers supply independently verified path, mode, and content commitments for every consumed input.
Index ¶
- Constants
- func Hash(kind, profile string, body []byte) (string, error)
- func VerifyDocument(document Document, encoded []byte) error
- type Code
- type Commitments
- type Document
- type DocumentInput
- type Error
- type FileCommitment
- type FileField
- type InputFile
- type InputRole
- type Manifest
- type Module
- type ModuleMode
- type Package
- type PackageKind
- type PackageMaterial
- type PathCommitment
- type PathNamespace
Constants ¶
View Source
const ( MaxDiscoveryBytes = 16 << 20 MaxPackages = 4_096 MaxStringBytes = 1 << 20 MaxJSONDepth = 16 MaxArgvBytes = 4 << 20 )
View Source
const ClosedFields = "" /* 259-byte string literal not displayed */
View Source
const DiscoveryProfile = "go-live-discovery/0"
Variables ¶
This section is empty.
Functions ¶
func VerifyDocument ¶
VerifyDocument rejects any structural, identity, or canonical-byte drift in a composed discovery document. External materialization verification remains the caller's responsibility; this verifies the closed discovery transcript.
Types ¶
type Commitments ¶
type Commitments struct {
DependencyMaterializationSHA256 string
ModuleMode ModuleMode
ModulePaths []PathCommitment
Packages []PackageMaterial
SourceWSI string
}
type Document ¶
type Document struct {
Argv []string
DependencyMaterializationSHA256 string
EnvironmentSHA256 string
ExitCode string
ID string
InputsSHA256 string
ModuleMode ModuleMode
Packages []Package
Profile string
RawStderrSHA256 string
RawStdoutSHA256 string
RequestedRunnerPackages []string
SourceWSI string
ToolchainID string
}
type DocumentInput ¶
type FileCommitment ¶
type FileField ¶
type FileField string
const ( FieldGoFiles FileField = "GoFiles" FieldCgoFiles FileField = "CgoFiles" FieldCFiles FileField = "CFiles" FieldCXXFiles FileField = "CXXFiles" FieldMFiles FileField = "MFiles" FieldHFiles FileField = "HFiles" FieldFFiles FileField = "FFiles" FieldSFiles FileField = "SFiles" FieldSwigFiles FileField = "SwigFiles" FieldSwigCXXFiles FileField = "SwigCXXFiles" FieldSysoFiles FileField = "SysoFiles" FieldEmbedFiles FileField = "EmbedFiles" FieldTestGoFiles FileField = "TestGoFiles" FieldXTestGoFiles FileField = "XTestGoFiles" FieldTestEmbedFiles FileField = "TestEmbedFiles" FieldXTestEmbedFiles FileField = "XTestEmbedFiles" )
type Manifest ¶
type ModuleMode ¶
type ModuleMode string
const ( ModuleModeModule ModuleMode = "MODULE" ModuleModeWorkspace ModuleMode = "WORKSPACE" ModuleModeVendor ModuleMode = "VENDOR" )
type PackageKind ¶
type PackageKind string
const ( Dependency PackageKind = "DEPENDENCY" Requested PackageKind = "REQUESTED" TestMain PackageKind = "TEST_MAIN" TestVariant PackageKind = "TEST_VARIANT" )
type PackageMaterial ¶
type PackageMaterial struct {
ImportPath string
RawDir string
DirNamespace PathNamespace
DirLogicalPath string
DirPathSHA256 string
Files []FileCommitment
}
type PathCommitment ¶
type PathCommitment struct {
RawPath string
Namespace PathNamespace
LogicalPath string
PathSHA256 string
}
type PathNamespace ¶
type PathNamespace string
const ( NamespaceSource PathNamespace = "SOURCE" NamespaceDependency PathNamespace = "DEPENDENCY" NamespaceToolchain PathNamespace = "TOOLCHAIN" )
Click to show internal directories.
Click to hide internal directories.