Skip to main content

isoloom_spec/
lib.rs

1//! The Isoloom spec: the format an author writes ([`syntax`]: parsed into types that hold no
2//! invalid state, every problem coded and placed), the form the plan lowers it into ([`model`]),
3//! the schema and the reference page read from the types, normalization (groups, clones, VLANs,
4//! profiles, instances, defaults, the image table) and validation.
5//!
6//! ```
7//! let spec = isoloom_spec::syntax::parse(
8//!     "version: 1\nname: hello\nnetworks:\n  lab: { cidr: 10.1.0.0/24 }\nmachines:\n  web:\n    os: debian@12\n    networks: { lab: 10 }\n    ports: { web: { port: 80, protocol: http } }\n",
9//! )?;
10//! assert!(isoloom_spec::syntax::check(&spec).is_empty());
11//! assert_eq!(spec.machines["web"].os.map(|os| os.to_string()).as_deref(), Some("debian@12"));
12//! # Ok::<(), Vec<isoloom_spec::syntax::Problem>>(())
13//! ```
14
15pub mod appliance;
16pub mod clones;
17pub mod defaults;
18pub mod error;
19pub mod files;
20pub mod groups;
21pub mod host;
22pub mod images;
23pub mod instance;
24mod load;
25pub mod model;
26pub mod os;
27mod placeholders;
28pub mod probe;
29pub mod profile;
30pub mod reference;
31pub mod schema;
32pub mod shell;
33mod sizing;
34pub mod syntax;
35pub mod targets;
36#[cfg(test)]
37mod testing;
38pub mod validate;
39pub mod vlans;
40pub mod windows;
41
42pub use error::{Error, Result};
43pub use load::{SPEC_FILE, SPEC_FILES, find, load, load_profiled, load_with, parse};
44pub use model::{Appliance, Arch, Check, CloudServices, Declared, Dns, Expect, KNOWN_OS, Machine, Network, Port, Reach, Resources, Shape, Target, Tc, Vlan};
45pub use sizing::{DEFAULT_CPUS, DEFAULT_DISK_GB, DEFAULT_MEMORY_MB, Totals, totals};
46pub use syntax::Spec;
47pub use targets::{derive, effective};
48pub use validate::{Problem, validate, validate_files};