Refactor for additional socktop connector library

- socktop connector allows you to communicate with socktop agent directly from you code without needing to implement the agent API directly.
- will also be used for non tui implementation of "socktop collector" in the future.
- moved to rust 2024 to take advantage of some new features that helped with refactor.
- fixed everything that exploded with update.
- added rust docs for lib.
This commit is contained in:
2025-09-04 05:30:25 -07:00
parent 622767a605
commit e51054811c
25 changed files with 823 additions and 229 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ mod state;
mod types;
mod ws;
use axum::{http::StatusCode, routing::get, Router};
use axum::{Router, http::StatusCode, routing::get};
use std::net::SocketAddr;
use std::str::FromStr;
+1 -1
View File
@@ -1,8 +1,8 @@
//! Shared agent state: sysinfo handles and hot JSON cache.
use std::collections::HashMap;
use std::sync::atomic::{AtomicBool, AtomicUsize};
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, AtomicUsize};
use std::time::{Duration, Instant};
use sysinfo::{Components, Disks, Networks, System};
use tokio::sync::Mutex;
+1 -1
View File
@@ -5,7 +5,7 @@ use axum::{
extract::{Query, State, WebSocketUpgrade},
response::Response,
};
use flate2::{write::GzEncoder, Compression};
use flate2::{Compression, write::GzEncoder};
use futures_util::StreamExt;
use once_cell::sync::OnceCell;
use std::collections::HashMap;