Module local_registry_source

Module local_registry_source 

Source

Structs§

LocalRegistrySource
A Source backed by a directory tree laid out like a registry: <root>/<namespace>/<name>/<version>.webc, or <root>/<name>/<version>.webc for un-namespaced packages.

Functions§

id_from_path 🔒
The package id encoded by a webc’s location under root (<namespace>/<name>/<version>.webc or <name>/<version>.webc), if it fits the layout. Used where a walk finds a file and its id must be derived backwards; named lookups go the other way via package_dir_path.
load_summary 🔒
Open one matched webc and build its summary. The layout’s id (when given) wins over the manifest’s; a <stem>.sha256 sibling, if present, must match the content.
package_dir_path 🔒
Where the layout would keep a package’s published versions: the full name’s components (namespace, then name) become path components under root. Only builds the path — existence is the caller’s question. None for names the layout can’t hold (empty or path-like components), rather than letting them escape the root.
published_versions 🔒
The versions published for one package: its directory’s <version>.webc files, read from the names alone. No webc is opened.
read_sha256_sibling 🔒
The trimmed digest of an optional <stem>.sha256 sibling, if present.
verify_sha256 🔒
Error if actual doesn’t match expected (hex, an optional sha256: prefix allowed).