harmony/examples/lamp/src/main.rs
Jean-Gabriel Gill-Couture b4cc5cff4f feat: add serde derive to Score types
This commit adds `serde` dependency and derives `Serialize` trait for `Score` types. This is necessary for serialization and deserialization of these types, which is required to display Scores to various user interfaces

- Added `serde` dependency to `harmony_types/Cargo.toml`.
- Added `serde::Serialize` derive macro to `MacAddress` in `harmony_types/src/lib.rs`.
- Added `serde::Serialize` derive macro to `Config` in `opnsense-config/src/config/config.rs`.
- Added `serde::Serialize` derive macro to `Score` in `harmony_types/src/lib.rs`.
- Added `serde::Serialize` derive macro to `Config` and `Score` in relevant modules.
- Added placeholder `todo!()` implementations for `serialize` methods. These will be implemented in future commits.
2025-04-05 14:36:08 -04:00

25 lines
655 B
Rust

use harmony::{
data::Version,
maestro::Maestro,
modules::lamp::{LAMPConfig, LAMPScore},
topology::{HAClusterTopology, Url},
};
#[tokio::main]
async fn main() {
let lamp_stack = LAMPScore {
name: "harmony-lamp-demo".to_string(),
domain: Url::Url(url::Url::parse("https://lampdemo.harmony.nationtech.io").unwrap()),
php_version: Version::from("8.4.4").unwrap(),
config: LAMPConfig {
project_root: "./php".into(),
..Default::default()
},
};
Maestro::<HAClusterTopology>::load_from_env()
.interpret(Box::new(lamp_stack))
.await
.unwrap();
}