A0: contract stubs types, transport, fake and registry seams
Land the shared peer contracts: types, error mapping, transport trait, fake transport and fixtures, registry/proxy/health skeletons, the AppState.peers and Config.peers seams, the ping and peers route stubs, and unit plus integration tests. No loops, no network, feature off by default.
This commit is contained in:
1 parent
746b389a2b
commit
4bfb097be6
22 files changed
+1781
-1
No files matched your search
@@ -6,6 +6,7 @@ use sqlx::SqlitePool;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::peers::PeerRegistry;
|
||||
use crate::sources::{DockerSource, JournalSource, SystemdSource};
|
||||
|
||||
/// Cheap to clone. Every stream and background task must select on
|
||||
@@ -18,6 +19,8 @@ pub struct AppState {
|
||||
pub docker: Arc<dyn DockerSource>,
|
||||
/// `None` when auth is disabled.
|
||||
pub db: Option<SqlitePool>,
|
||||
/// `None` when the peers feature is off: no routes, tools, tasks or metrics.
|
||||
pub peers: Option<Arc<PeerRegistry>>,
|
||||
pub shutdown: CancellationToken,
|
||||
}
|
||||
|
||||
@@ -32,6 +35,7 @@ impl AppState {
|
||||
docker: Arc::new(BollardDocker::new(&config, shutdown.clone())),
|
||||
config: Arc::new(config),
|
||||
db,
|
||||
peers: None,
|
||||
shutdown,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user