use serde::Serialize;
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct SnapshotVerifyReport {
pub digest: String,
pub path: PathBuf,
pub upper: UpperVerifyStatus,
pub checkpoint: Option<CheckpointVerifyStatus>,
}
#[derive(Debug, Clone)]
pub struct CheckpointVerifyStatus {
pub root: String,
}
#[derive(Debug, Clone)]
pub enum UpperVerifyStatus {
NotRecorded,
Verified {
algorithm: String,
digest: String,
},
}
#[derive(Debug, Clone, Default)]
pub struct LoadOpts {
pub dest: Option<PathBuf>,
pub base: Option<String>,
pub group: Option<String>,
pub set_head: bool,
}
#[derive(Debug, Clone, Default)]
pub struct SaveOpts {
pub with_parents: bool,
pub with_image: bool,
pub plain_tar: bool,
pub since: Option<String>,
pub last_layers: Option<usize>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct HeadUpdate {
pub group: String,
pub previous: Option<String>,
pub head: String,
pub reason: HeadUpdateReason,
pub changed: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum HeadUpdateReason {
Initialized,
FastForwarded,
Selected,
Unchanged,
Diverged,
UnknownAncestry,
AmbiguousCandidates,
}