2025-12-10 08:39:32 +01:00
|
|
|
use serde::Serialize;
|
|
|
|
|
|
|
|
|
|
mod node;
|
|
|
|
|
|
|
|
|
|
pub use node::{EnvEntry, NodeDescriptor};
|
|
|
|
|
|
2026-02-02 07:19:22 +01:00
|
|
|
/// Top-level docker-compose descriptor built from an environment-specific
|
|
|
|
|
/// topology.
|
2025-12-10 08:39:32 +01:00
|
|
|
#[derive(Clone, Debug, Serialize)]
|
|
|
|
|
pub struct ComposeDescriptor {
|
2026-01-26 08:26:15 +01:00
|
|
|
nodes: Vec<NodeDescriptor>,
|
2025-12-10 08:39:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl ComposeDescriptor {
|
|
|
|
|
#[must_use]
|
2026-02-02 07:19:22 +01:00
|
|
|
pub fn new(nodes: Vec<NodeDescriptor>) -> Self {
|
|
|
|
|
Self { nodes }
|
2025-12-10 08:39:32 +01:00
|
|
|
}
|
|
|
|
|
|
2026-02-02 07:19:22 +01:00
|
|
|
#[must_use]
|
2026-01-26 08:26:15 +01:00
|
|
|
pub fn nodes(&self) -> &[NodeDescriptor] {
|
|
|
|
|
&self.nodes
|
2025-12-10 08:39:32 +01:00
|
|
|
}
|
|
|
|
|
|
2026-02-02 07:19:22 +01:00
|
|
|
#[cfg(test)]
|
|
|
|
|
pub fn test_nodes(&self) -> &[NodeDescriptor] {
|
|
|
|
|
self.nodes()
|
2025-12-18 13:05:40 +01:00
|
|
|
}
|
2025-12-10 08:39:32 +01:00
|
|
|
}
|