summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwojciechkepka <wojtek.kepka@protonmail.com>2021-03-12 03:18:33 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-07-05 15:29:29 +0200
commit93bdeec423140fe4efc4a01b2dd31e39b817da1b (patch)
tree19730566770eb2bd48404919ea7f71d1d11b8373 /src
parent4616e70cf97d9db258c6f54b783395d08337d350 (diff)
Add ImageBuildChunk
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r--src/image.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/image.rs b/src/image.rs
index addf4ee..20a6886 100644
--- a/src/image.rs
+++ b/src/image.rs
@@ -862,6 +862,47 @@ pub enum Status {
Deleted(String),
}
+#[derive(Serialize, Deserialize, Debug)]
+#[serde(untagged)]
+/// Represents a response chunk from Docker api when building, pulling or importing an image.
+pub enum ImageBuildChunk {
+ Update {
+ stream: String,
+ },
+ Error {
+ error: String,
+ #[serde(rename = "errorDetail")]
+ error_detail: ErrorDetail,
+ },
+ Digest {
+ aux: Aux,
+ },
+ PullStatus {
+ status: String,
+ id: Option<String>,
+ progress: Option<String>,
+ #[serde(rename = "progressDetail")]
+ progress_detail: Option<ProgressDetail>,
+ },
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct Aux {
+ #[serde(rename = "ID")]
+ id: String,
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct ErrorDetail {
+ message: String,
+}
+
+#[derive(Serialize, Deserialize, Debug)]
+pub struct ProgressDetail {
+ current: Option<u64>,
+ total: Option<u64>,
+}
+
#[cfg(test)]
mod tests {
use super::*;