Expand description
Manifest-to-container specification resolution for LightShuttle.
§Position in the layer graph
lightshuttle-spec sits between the manifest parsing layer and the
execution/export layer:
lightshuttle-manifest (parsing, typed resource declarations)
|
v
lightshuttle-spec (THIS CRATE - resolution, defaults, outputs)
|
+-----+------+
v v
runtime exportIt depends on lightshuttle-manifest and is consumed by
lightshuttle-runtime and lightshuttle-export. It does not depend
on any container daemon, so both consumers share a single, consistent
resolution without drift.
§What resolution does
The entry point is from_resource. Given a project name, a
resource name, and a lightshuttle_manifest::ResourceKind, it
returns a ResolvedResource that bundles:
- A
ContainerSpec: the complete, self-contained description of the container to launch (image, env vars, ports, volumes, healthcheck). - A
ResourceOutputsmap: the key/value pairs exposed to dependent resources via${resources.<name>.<key>}interpolation andLSH_*environment variables.
§Resolved outputs by resource kind
| Kind | Keys |
|---|---|
postgres | host, port, database, user, password, url |
redis | host, port, password, url |
container / dockerfile | host, ports (comma-separated) |
§Errors
Resolution fails with a SpecError when a port mapping, volume
string, or healthcheck duration in the manifest is structurally
invalid.
Structs§
- Container
Spec - Self-contained description of a container to start, derived from a manifest resource declaration.
- Healthcheck
Spec - Healthcheck resolved from the manifest, with duration strings
already parsed into
std::time::Durationvalues. - Port
Binding - Host-to-container port binding resolved from the manifest.
- Resolved
Resource - A
ContainerSpecbundled with theResourceOutputsthe resource exposes to its dependents at runtime. - Volume
Binding - Volume or bind-mount mapping resolved from the manifest.
Enums§
- Image
Source - How the container image is obtained.
- Spec
Error - Errors raised while building a
crate::ContainerSpecfrom a manifest resource declaration. - Volume
Source - Origin of the content mounted into the container.
Functions§
- from_
resource - Resolve a manifest resource declaration into a
ResolvedResource.
Type Aliases§
- Resource
Outputs - Key/value properties that a managed resource exposes to its dependents.
- Result
- Shorthand alias for
std::result::Result<T, SpecError>.