From 3234c0f4debcdf2f6d4ad07983bc7cdc548f1ac8 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 11 Jul 2024 21:28:18 +0100 Subject: [PATCH] feat: add support for listing volumes --- src/docker/mod.rs | 1 + src/docker/volume.rs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/docker/volume.rs diff --git a/src/docker/mod.rs b/src/docker/mod.rs index c370ae1..0aae9df 100644 --- a/src/docker/mod.rs +++ b/src/docker/mod.rs @@ -3,3 +3,4 @@ pub mod image; pub mod logs; pub mod traits; pub mod util; +pub mod volume; diff --git a/src/docker/volume.rs b/src/docker/volume.rs new file mode 100644 index 0000000..2a6227e --- /dev/null +++ b/src/docker/volume.rs @@ -0,0 +1,21 @@ +use bollard::container::{ListContainersOptions, RemoveContainerOptions}; +use chrono::prelude::DateTime; +use chrono::Local; +use color_eyre::eyre::{bail, Context, Result}; +use serde::Serialize; +use std::{ + collections::HashMap, + time::{Duration, UNIX_EPOCH}, +}; +use tokio::process::Command; + +use bollard::secret::ContainerSummary; + +use super::traits::Describe; + +#[derive(Debug, Clone, PartialEq, Serialize)] +pub struct DockerVolume {} + +impl DockerVolume { + pub async fn list(docker: &bollard::Docker) -> Result> {} +}