Skip to main content

Module store

Module store 

Source
Expand description

Versioned, labelled storage for session specs (“bundles”).

A bundle is a session spec under a name. Every push stores an immutable version, identified by the SHA-256 of the spec’s canonical JSON, so pushing the same spec twice yields the same version. Labels such as prod or staging are movable pointers to a version. A runtime loads booking:prod, and promoting or rolling back is moving a label; nothing is rebuilt or redeployed.

booking            the latest version
booking@3f2a9c1d   a version, by id or unique prefix
booking:prod       the version a label points to

open_store picks a backend from a URI: a directory path (or file://) for local work and tests, or gs://bucket/prefix for Cloud Storage (feature gcs-store). Other backends implement BundleObjects, a three-method object interface, and get versions and labels from ObjectBundleStore.

Only valid specs are stored: a push that fails validate is refused, so whatever a runtime loads has already passed validation.

Structs§

BundleVersion
One stored version of a bundle.
DirObjects
Bundles in a local directory.
GcsObjects
Bundles in a Cloud Storage bucket, through the JSON API.
ObjectBundleStore
A BundleStore over any BundleObjects backend.

Enums§

BundleRef
Which version of a bundle to load.
StoreError
Why a bundle operation failed.

Traits§

BundleObjects
The object interface a bundle backend implements. Keys are relative paths with / separators, such as booking/versions/3f2a9c1d4e5f.json.
BundleStore
Versioned, labelled storage for session specs. See the module docs.

Functions§

open_store
Open the store a URI names: a directory path or file:// URI, or gs://bucket/prefix (feature gcs-store, credentials from GoogleAccessToken::from_env).