fleetflow_container/
runtime.rs

1use anyhow::Result;
2use fleetflow_atom::Flow;
3
4/// コンテナランタイムのトレイト
5#[allow(async_fn_in_trait)]
6pub trait ContainerRuntime {
7    async fn start(&self, flow: &Flow) -> Result<()>;
8    async fn stop(&self, flow: &Flow) -> Result<()>;
9    async fn status(&self) -> Result<Vec<ContainerStatus>>;
10}
11
12/// コンテナのステータス
13#[derive(Debug, Clone)]
14pub struct ContainerStatus {
15    pub name: String,
16    pub state: ContainerState,
17    pub image: String,
18}
19
20/// コンテナの状態
21#[derive(Debug, Clone, PartialEq)]
22pub enum ContainerState {
23    Running,
24    Stopped,
25    Paused,
26    Unknown,
27}