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.
30 lines
795 B
Rust
30 lines
795 B
Rust
use harmony::{
|
|
inventory::Inventory,
|
|
maestro::Maestro,
|
|
modules::{
|
|
dummy::{ErrorScore, PanicScore, SuccessScore},
|
|
k8s::deployment::K8sDeploymentScore,
|
|
},
|
|
topology::HAClusterTopology,
|
|
};
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let inventory = Inventory::autoload();
|
|
let topology = HAClusterTopology::autoload();
|
|
let mut maestro = Maestro::new(inventory, topology);
|
|
|
|
maestro.register_all(vec![
|
|
// ADD scores :
|
|
// 1. OPNSense setup scores
|
|
// 2. Bootstrap node setup
|
|
// 3. Control plane setup
|
|
// 4. Workers setup
|
|
// 5. Various tools and apps setup
|
|
Box::new(SuccessScore {}),
|
|
Box::new(ErrorScore {}),
|
|
Box::new(PanicScore {}),
|
|
]);
|
|
harmony_tui::init(maestro).await.unwrap();
|
|
}
|