Documentation
¶
Index ¶
- Variables
- func ComputeNativeSourceDigest(sourceDir string) (string, error)
- func DefaultCacheRoot() (string, error)
- func VerifyInputFiles(manifest Manifest, inputRoot string) error
- func VerifyInputTarget(manifest Manifest, inputRoot, targetID string) error
- func VerifyReleaseAssets(manifest Manifest, assetRoot string) error
- func WriteManifest(path string, manifest Manifest) error
- type File
- type HTTPDoer
- type Manifest
- type Mode
- type Options
- type Result
- type Target
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotPrepared means the verified native runtime is not present in the // local cache. Preparation is always an explicit operation. ErrNotPrepared = errors.New("gomonty native runtime is not prepared") // ErrIntegrity means bytes on disk or in a downloaded bundle do not match // the hashes committed with this Go module. ErrIntegrity = errors.New("gomonty native runtime integrity check failed") // ErrUnsupported means there is no runtime manifest for the current target. ErrUnsupported = errors.New("gomonty native runtime target is unsupported") // ErrBuildPrerequisite means local build preparation cannot prove that the // reviewed compiler and target are available. ErrBuildPrerequisite = errors.New("gomonty native runtime build prerequisite is not satisfied") )
Functions ¶
func ComputeNativeSourceDigest ¶
ComputeNativeSourceDigest hashes every reviewed input executed or compiled by PrepareBuild. Generated target directories and native outputs are excluded.
func DefaultCacheRoot ¶
DefaultCacheRoot returns the cache root used by both Prepare and the loader. GOMONTY_CACHE_DIR is an explicit location override; it does not weaken hash verification.
func VerifyInputFiles ¶
VerifyInputFiles checks whether build outputs reproduce every committed release file byte-for-byte. It is an explicit reproducibility audit, not a requirement for locally built runtimes.
func VerifyInputTarget ¶
VerifyInputTarget performs that exact-byte audit for one target.
func VerifyReleaseAssets ¶
VerifyReleaseAssets proves that exact release bytes match a manifest.
func WriteManifest ¶
WriteManifest writes canonical, reviewable manifest JSON.
Types ¶
type File ¶
type File struct {
Role string `json:"role"`
Name string `json:"name"`
SHA256 string `json:"sha256"`
Size int64 `json:"size"`
Executable bool `json:"executable"`
}
File describes an exact file installed from a runtime release asset.
func InspectInputTarget ¶
InspectInputTarget validates one local build's exact layout and returns the hashes it actually produced. It deliberately does not claim that an unpinned local toolchain reproduces a committed release byte-for-byte.
type Manifest ¶
type Manifest struct {
Schema int `json:"schema"`
RuntimeVersion string `json:"runtime_version"`
ReleaseTag string `json:"release_tag"`
ReleaseBaseURL string `json:"release_base_url"`
MontyVersion string `json:"monty_version"`
MontyCommit string `json:"monty_commit"`
RustToolchain string `json:"rust_toolchain"`
SourceSHA256 string `json:"native_source_sha256"`
Targets []Target `json:"targets"`
// contains filtered or unexported fields
}
Manifest is the committed trust root for one native runtime release.
The JSON representation is intentionally public to the repository tooling, but the Go type remains internal so consumers cannot replace the manifest at runtime.
func CurrentManifest ¶
CurrentManifest loads and validates the immutable manifest embedded in the package. Only text metadata, never native code, is embedded in the Go module.
func GenerateReleaseAssets ¶
GenerateReleaseAssets is used only by repository release automation. It creates deterministic ZIP files and returns a manifest containing hashes for both each archive and both files inside it.
func ParseManifest ¶
ParseManifest decodes and strictly validates a manifest. It is exported only for the repository's release tooling and tests.
func (Manifest) AssetURL ¶
AssetURL returns the immutable release URL for target. A non-empty base URL is an explicit mirror override; hashes remain anchored in the manifest.
func (Manifest) CurrentTarget ¶
CurrentTarget returns the manifest entry selected for the current process. Linux libc is detected from the running system so callers cannot silently prepare a GNU runtime on musl, or the reverse, because of a missing build tag.
type Mode ¶
type Mode string
Mode selects the only two operations allowed to create a prepared runtime.
type Options ¶
type Options struct {
Mode Mode
SourceDir string
BaseURL string
HTTPClient HTTPDoer
// CacheRoot is intentionally internal-package surface. The public API uses
// the same default root as the loader; tests can isolate it here.
CacheRoot string
}
Options configures an explicit preparation operation.
type Result ¶
type Result struct {
RuntimeVersion string `json:"runtime_version"`
Target string `json:"target"`
Origin string `json:"origin"`
RustToolchain string `json:"rust_toolchain"`
Directory string `json:"directory"`
LibraryPath string `json:"library_path"`
WorkerPath string `json:"worker_path"`
}
Result identifies an installed runtime that was verified against the embedded manifest in this process.
type Target ¶
type Target struct {
ID string `json:"id"`
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
Variant string `json:"variant,omitempty"`
RustTarget string `json:"rust_target"`
Asset string `json:"asset"`
ArchiveSHA256 string `json:"archive_sha256"`
ArchiveSize int64 `json:"archive_size"`
Files []File `json:"files"`
}
Target describes one release asset and its exact installed contents.