Documentation
¶
Overview ¶
Package cellpack is the Piglet-Binary-side counterpart to the host's prebuilt-cell seam (runtimecell.PrebuiltResolver). A Piglet Binary embeds its packed cells plus a manifest describing each cell's composition; at startup it extracts the binaries and registers a Resolver so the host serves them without any Go/Rust toolchain.
Matching is by composition (language + cell key + target + extension set), which is stable across machines, rather than the host's from-source build hash, which embeds the toolchain version and is not reproducible on a toolchain-less consumer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CellEntry ¶
type CellEntry struct {
Language string `json:"language"` // go | rust | python
Key string `json:"key"`
Strategy string `json:"strategy,omitempty"` // isolated | packed-go | packed-rust | packed-python
OS string `json:"os"`
Arch string `json:"arch"`
Binary string `json:"binary"` // path relative to the extraction dir
Extensions []ExtEntry `json:"extensions"`
}
CellEntry is one prebuilt cell: its composition and where its binary lives relative to the extraction directory.
type LoadedCell ¶
type LoadedCell struct {
Language string
Key string
Strategy string
BinaryPath string
Extensions []ExtEntry
}
LoadedCell is an embedded cell extracted from the Piglet Binary binary and ready to start without source or a language toolchain.
func LoadedCells ¶
func LoadedCells() []LoadedCell
LoadedCells returns the embedded cells extracted by Register. The returned slice is a copy, so callers may sort or filter it.
type Manifest ¶
type Manifest struct {
PigCoreVersion string `json:"pigCoreVersion"`
Cells []CellEntry `json:"cells"`
}
Manifest describes the cells embedded in a Piglet Binary.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver serves embedded cells by composition. It implements runtimecell.PrebuiltResolver.
func NewResolver ¶
NewResolver indexes a manifest against the directory its binaries were extracted into.
func (*Resolver) ResolvePrebuilt ¶
func (r *Resolver) ResolvePrebuilt(req runtimecell.PrebuiltRequest) (string, bool)
ResolvePrebuilt returns the embedded binary for a request's composition, or ok=false to let the host build from source. It fails closed: a pinned hash that disagrees with the request, or a missing extracted binary, is a miss.