P0: config, DTOs, source traits, fakes, error, state and module stubs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa9b0da962
commit
1802f97d94
22 files changed
+1736
No files matched your search
@@ -0,0 +1,46 @@
|
||||
//! Docker source over the unix socket via `bollard` (WS-C owns this file).
|
||||
//!
|
||||
//! STUB: signatures are final, bodies are `todo!()`.
|
||||
//! Notes for WS-C: build the client lazily. A missing or denied socket maps to
|
||||
//! `AppError::Unavailable` per request and never fails startup (review G9).
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tokio::sync::mpsc;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use super::{ContainerStatus, ContainerSummary, DockerSource, LogLine, LogOptions};
|
||||
use crate::config::Config;
|
||||
use crate::error::AppError;
|
||||
|
||||
pub struct BollardDocker {}
|
||||
|
||||
impl BollardDocker {
|
||||
/// Must not fail or block. Reads `sources.docker_socket` and
|
||||
/// `limits.max_tail` from `config`. Follow tasks stop on `shutdown`.
|
||||
pub fn new(_config: &Config, _shutdown: CancellationToken) -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl DockerSource for BollardDocker {
|
||||
async fn ps(&self, _all: bool) -> Result<Vec<ContainerSummary>, AppError> {
|
||||
todo!("WS-C C2")
|
||||
}
|
||||
|
||||
async fn container_status(&self, _name: &str) -> Result<ContainerStatus, AppError> {
|
||||
todo!("WS-C C3")
|
||||
}
|
||||
|
||||
async fn logs(&self, _name: &str, _opts: &LogOptions) -> Result<Vec<LogLine>, AppError> {
|
||||
todo!("WS-C C4")
|
||||
}
|
||||
|
||||
async fn follow_logs(
|
||||
&self,
|
||||
_name: &str,
|
||||
_opts: &LogOptions,
|
||||
) -> Result<mpsc::Receiver<LogLine>, AppError> {
|
||||
todo!("WS-C C4")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user