MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / DockerClient

Interface DockerClient

src/context/docker_client.rs:274–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272
273#[async_trait]
274pub trait DockerClient: Send + Sync {
275 async fn create_container(
276 &self,
277 options: Option<CreateContainerOptions>,
278 config: ContainerCreateBody,
279 ) -> Result<String, String>;
280
281 async fn start_container(&self, id: &str) -> Result<(), String>;
282
283 async fn wait_container(&self, id: &str) -> Result<i64, String>;
284
285 async fn kill_container(&self, id: &str) -> Result<(), String>;
286
287 /// Get container logs as a single string
288 ///
289 /// Used by test utilities and debugging tools
290 #[allow(dead_code)] // Used by test implementations
291 async fn logs(&self, id: &str, options: Option<LogsOptions>) -> Result<String, String>;
292
293 async fn logs_stream(
294 &self,
295 id: &str,
296 options: Option<LogsOptions>,
297 ) -> Result<Box<dyn futures_util::Stream<Item = Result<String, String>> + Send + Unpin>, String>;
298
299 async fn remove_container(
300 &self,
301 id: &str,
302 options: Option<RemoveContainerOptions>,
303 ) -> Result<(), String>;
304
305 async fn create_network(&self, name: &str) -> Result<String, String>;
306
307 async fn network_exists(&self, name: &str) -> Result<bool, String>;
308
309 /// Create an internal network (no external route)
310 ///
311 /// Internal networks cannot reach the internet directly, making them ideal
312 /// for isolating agent containers that must route through the proxy.
313 ///
314 /// # Arguments
315 /// * `name` - The network name (e.g., "tsk-agent-abc123")
316 ///
317 /// # Returns
318 /// The network ID on success
319 async fn create_internal_network(&self, name: &str) -> Result<String, String>;
320
321 /// Connect a running container to an additional network
322 ///
323 /// Used to connect the proxy container to each agent's isolated network.
324 ///
325 /// # Arguments
326 /// * `container` - Container ID or name
327 /// * `network` - Network name to connect to
328 async fn connect_container_to_network(
329 &self,
330 container: &str,
331 network: &str,

Callers

nothing calls this directly

Implementers 3

docker_clients.rssrc/test_utils/docker_clients.rs
docker_client.rssrc/context/docker_client.rs
test_stop_proxy_container_not_foundsrc/docker/proxy_manager.rs

Calls

no outgoing calls

Tested by

no test coverage detected