Skip to content

Commit

Permalink
feat: add support for listing volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpsoane committed Jul 11, 2024
1 parent 6ac2e62 commit 3234c0f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/docker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pub mod image;
pub mod logs;
pub mod traits;
pub mod util;
pub mod volume;
21 changes: 21 additions & 0 deletions src/docker/volume.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use bollard::container::{ListContainersOptions, RemoveContainerOptions};

Check warning on line 1 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused imports: `ListContainersOptions`, `RemoveContainerOptions`

warning: unused imports: `ListContainersOptions`, `RemoveContainerOptions` --> src/docker/volume.rs:1:26 | 1 | use bollard::container::{ListContainersOptions, RemoveContainerOptions}; | ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default

Check warning on line 1 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused imports: `ListContainersOptions`, `RemoveContainerOptions`

warning: unused imports: `ListContainersOptions`, `RemoveContainerOptions` --> src/docker/volume.rs:1:26 | 1 | use bollard::container::{ListContainersOptions, RemoveContainerOptions}; | ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
use chrono::prelude::DateTime;

Check warning on line 2 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused import: `chrono::prelude::DateTime`

warning: unused import: `chrono::prelude::DateTime` --> src/docker/volume.rs:2:5 | 2 | use chrono::prelude::DateTime; | ^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 2 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused import: `chrono::prelude::DateTime`

warning: unused import: `chrono::prelude::DateTime` --> src/docker/volume.rs:2:5 | 2 | use chrono::prelude::DateTime; | ^^^^^^^^^^^^^^^^^^^^^^^^^
use chrono::Local;

Check warning on line 3 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused import: `chrono::Local`

warning: unused import: `chrono::Local` --> src/docker/volume.rs:3:5 | 3 | use chrono::Local; | ^^^^^^^^^^^^^

Check warning on line 3 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused import: `chrono::Local`

warning: unused import: `chrono::Local` --> src/docker/volume.rs:3:5 | 3 | use chrono::Local; | ^^^^^^^^^^^^^
use color_eyre::eyre::{bail, Context, Result};

Check warning on line 4 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused imports: `Context`, `bail`

warning: unused imports: `Context`, `bail` --> src/docker/volume.rs:4:24 | 4 | use color_eyre::eyre::{bail, Context, Result}; | ^^^^ ^^^^^^^

Check warning on line 4 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused imports: `Context`, `bail`

warning: unused imports: `Context`, `bail` --> src/docker/volume.rs:4:24 | 4 | use color_eyre::eyre::{bail, Context, Result}; | ^^^^ ^^^^^^^
use serde::Serialize;
use std::{
collections::HashMap,

Check warning on line 7 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused imports: `Duration`, `UNIX_EPOCH`, `collections::HashMap`

warning: unused imports: `Duration`, `UNIX_EPOCH`, `collections::HashMap` --> src/docker/volume.rs:7:5 | 7 | collections::HashMap, | ^^^^^^^^^^^^^^^^^^^^ 8 | time::{Duration, UNIX_EPOCH}, | ^^^^^^^^ ^^^^^^^^^^

Check warning on line 7 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused imports: `Duration`, `UNIX_EPOCH`, `collections::HashMap`

warning: unused imports: `Duration`, `UNIX_EPOCH`, `collections::HashMap` --> src/docker/volume.rs:7:5 | 7 | collections::HashMap, | ^^^^^^^^^^^^^^^^^^^^ 8 | time::{Duration, UNIX_EPOCH}, | ^^^^^^^^ ^^^^^^^^^^
time::{Duration, UNIX_EPOCH},
};
use tokio::process::Command;

Check warning on line 10 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused import: `tokio::process::Command`

warning: unused import: `tokio::process::Command` --> src/docker/volume.rs:10:5 | 10 | use tokio::process::Command; | ^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 10 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused import: `tokio::process::Command`

warning: unused import: `tokio::process::Command` --> src/docker/volume.rs:10:5 | 10 | use tokio::process::Command; | ^^^^^^^^^^^^^^^^^^^^^^^

use bollard::secret::ContainerSummary;

Check warning on line 12 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused import: `bollard::secret::ContainerSummary`

warning: unused import: `bollard::secret::ContainerSummary` --> src/docker/volume.rs:12:5 | 12 | use bollard::secret::ContainerSummary; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 12 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused import: `bollard::secret::ContainerSummary`

warning: unused import: `bollard::secret::ContainerSummary` --> src/docker/volume.rs:12:5 | 12 | use bollard::secret::ContainerSummary; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

use super::traits::Describe;

Check warning on line 14 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

unused import: `super::traits::Describe`

warning: unused import: `super::traits::Describe` --> src/docker/volume.rs:14:5 | 14 | use super::traits::Describe; | ^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 14 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

unused import: `super::traits::Describe`

warning: unused import: `super::traits::Describe` --> src/docker/volume.rs:14:5 | 14 | use super::traits::Describe; | ^^^^^^^^^^^^^^^^^^^^^^^

#[derive(Debug, Clone, PartialEq, Serialize)]
pub struct DockerVolume {}

impl DockerVolume {
pub async fn list(docker: &bollard::Docker) -> Result<Vec<Self>> {}

Check failure on line 20 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / stable / clippy

mismatched types

error[E0308]: mismatched types --> src/docker/volume.rs:20:70 | 20 | pub async fn list(docker: &bollard::Docker) -> Result<Vec<Self>> {} | ^^ expected `Result<Vec<DockerVolume>, Report>`, found `()` | = note: expected enum `std::result::Result<std::vec::Vec<docker::volume::DockerVolume>, color_eyre::Report>` found unit type `()`

Check failure on line 20 in src/docker/volume.rs

View workflow job for this annotation

GitHub Actions / check / beta / clippy

mismatched types

error[E0308]: mismatched types --> src/docker/volume.rs:20:70 | 20 | pub async fn list(docker: &bollard::Docker) -> Result<Vec<Self>> {} | ^^ expected `Result<Vec<DockerVolume>, Report>`, found `()` | = note: expected enum `std::result::Result<std::vec::Vec<docker::volume::DockerVolume>, color_eyre::Report>` found unit type `()`
}

0 comments on commit 3234c0f

Please sign in to comment.