Skip to main content

Crate lightshuttle_spec

Crate lightshuttle_spec 

Source
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      export

It 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 ResourceOutputs map: the key/value pairs exposed to dependent resources via ${resources.<name>.<key>} interpolation and LSH_* environment variables.

§Resolved outputs by resource kind

KindKeys
postgreshost, port, database, user, password, url
redishost, port, password, url
container / dockerfilehost, 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§

ContainerSpec
Self-contained description of a container to start, derived from a manifest resource declaration.
HealthcheckSpec
Healthcheck resolved from the manifest, with duration strings already parsed into std::time::Duration values.
PortBinding
Host-to-container port binding resolved from the manifest.
ResolvedResource
A ContainerSpec bundled with the ResourceOutputs the resource exposes to its dependents at runtime.
VolumeBinding
Volume or bind-mount mapping resolved from the manifest.

Enums§

ImageSource
How the container image is obtained.
SpecError
Errors raised while building a crate::ContainerSpec from a manifest resource declaration.
VolumeSource
Origin of the content mounted into the container.

Functions§

from_resource
Resolve a manifest resource declaration into a ResolvedResource.

Type Aliases§

ResourceOutputs
Key/value properties that a managed resource exposes to its dependents.
Result
Shorthand alias for std::result::Result<T, SpecError>.