feat: stub agent file structure

This commit is contained in:
GW_MC
2026-03-03 04:34:06 +00:00
parent 8f213c19c8
commit 9ac5a82c29
29 changed files with 892 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
//! NxMesh Agent - Data Plane
//!
//! The agent is a lightweight sidecar that manages local nginx instances
//! and communicates with the master control plane.
use tracing::{info, error};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize tracing
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.init();
info!("Starting NxMesh Agent v{}", env!("CARGO_PKG_VERSION"));
// Load configuration
let config = match nxmesh_agent::config::Settings::load() {
Ok(cfg) => cfg,
Err(e) => {
error!("Failed to load configuration: {}", e);
std::process::exit(1);
}
};
info!("Configuration loaded successfully");
info!("Master URL: {}", config.master.url);
// Start the agent
if let Err(e) = nxmesh_agent::start(config).await {
error!("Agent error: {}", e);
std::process::exit(1);
}
Ok(())
}