Skip to main content

Module package_index

Module package_index 

Source
Expand description

Wire types for the ZLayer package index (packages.zlayer.dev).

These are pure serde shapes: they carry no HTTP client and do no I/O. The index client (which fetches /formula/:name and /choco/:name, follows redirects, and fires HMAC-signed refresh hints) lives in zlayer-toolchain so that this crate stays dependency-light (no reqwest, no tokio).

FormulaData deserializes the subset of a Homebrew formula JSON that the provisioning + integrity pipeline consumes: versions.stable, urls.stable.{url,checksum} (the source-tarball sha256, sometimes sha256:-prefixed), and bottle.stable.files.<tag>.{url,sha256} (the per-platform prebuilt bottle digests), plus the dependency graph the macOS source builder walks. Every field is permissive (#[serde(default)]) so a partial or evolving index payload never fails to parse.

Structs§

ChocoData
A parsed Chocolatey OData package entry (the subset served by /choco/:name).
FormulaBottle
Bottle block (bottle.stable).
FormulaBottleFile
A single per-platform bottle file ({url, sha256}).
FormulaBottleStable
The stable bottle entry, keyed by platform tag (arm64_sonoma, …).
FormulaData
A parsed Homebrew formula (the subset served verbatim by /formula/:name).
FormulaUrlStable
The stable source URL entry (urls.stable).
FormulaUrls
URLs block (urls.stable).
FormulaVersions
Versions block (versions.stable).
PackageIndexConfig
Configuration for the package-index client.

Enums§

UsesFromMacos
An entry in uses_from_macos: either a bare formula name, or a {name: [conditions]} object (e.g. {"llvm": ["build"]}).

Constants§

DEFAULT_PACKAGE_INDEX_URL
Default base URL for the ZLayer package index.
PACKAGE_INDEX_URL_ENV
Environment variable overriding the package-index base URL.