butterflow_models/
runtime.rs1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3use ts_rs::TS;
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema, TS)]
6#[serde(rename_all = "lowercase")]
7pub enum RuntimeType {
8 Direct,
10
11 Docker,
13
14 Podman,
16}
17
18impl std::fmt::Display for RuntimeType {
19 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20 match self {
21 RuntimeType::Direct => write!(f, "direct"),
22 RuntimeType::Docker => write!(f, "docker"),
23 RuntimeType::Podman => write!(f, "podman"),
24 }
25 }
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, TS)]
30pub struct Runtime {
31 pub r#type: RuntimeType,
33
34 #[serde(default)]
36 #[ts(optional=nullable)]
37 pub image: Option<String>,
38
39 #[serde(default)]
41 #[ts(optional=nullable)]
42 pub working_dir: Option<String>,
43
44 #[serde(default)]
46 #[ts(optional=nullable)]
47 pub user: Option<String>,
48
49 #[serde(default)]
51 #[ts(optional=nullable)]
52 pub network: Option<String>,
53
54 #[serde(default)]
56 #[ts(optional=nullable)]
57 pub options: Option<Vec<String>>,
58}