1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! 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:
//!
//! ```text
//! 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
//!
//! | 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.
pub use crate;
pub use crate;