Initial commit

This commit is contained in:
Ivan I. Ovchinnikov
2026-11-16 13:59:40 +03:00
commit 84ca3d07f8
66 changed files with 3774 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
use mm_core::{BridgeState, ServerSummary};
use serde_json::{json, Value};
pub const BRIDGE_VERSION: &str = env!("CARGO_PKG_VERSION");
pub fn status_result() -> Value {
let servers: Vec<ServerSummary> = Vec::new();
json!({
"bridge": {
"version": BRIDGE_VERSION,
"state": BridgeState::Running,
},
"servers": servers,
})
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn status_has_empty_servers() {
let value = status_result();
assert_eq!(value["servers"].as_array().unwrap().len(), 0);
assert_eq!(value["bridge"]["state"], "running");
}
}