aboutsummaryrefslogtreecommitdiffstats
path: root/zone_core
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-04-15 23:04:46 -0500
committerToby Vincent <tobyv13@gmail.com>2022-04-15 23:04:46 -0500
commita601e8b157280bf4cb457c3cfc586796a7989f8f (patch)
tree730ee086e7a4f6ec0cfa67813499630524ea723b /zone_core
parent1bac3edd1f400724f93e7820e6b56015b6dff9ec (diff)
feat: impl run and attach to container
Diffstat (limited to 'zone_core')
-rw-r--r--zone_core/src/container.rs13
-rw-r--r--zone_core/src/lib.rs4
2 files changed, 16 insertions, 1 deletions
diff --git a/zone_core/src/container.rs b/zone_core/src/container.rs
index 4ac9dbf..9296fb6 100644
--- a/zone_core/src/container.rs
+++ b/zone_core/src/container.rs
@@ -43,6 +43,19 @@ pub struct CloneOptions {
pub user: String,
}
+#[derive(Debug, Serialize, Deserialize, Clone, Args)]
+pub struct WebSocketOptions {
+ pub id: u64,
+ pub template: String,
+ pub user: String,
+}
+
+impl From<WebSocketOptions> for String {
+ fn from(val: WebSocketOptions) -> Self {
+ format!("{}-{}-{}", val.user, val.template, val.id)
+ }
+}
+
impl<T> FilterContainer for T
where
T: Iterator,
diff --git a/zone_core/src/lib.rs b/zone_core/src/lib.rs
index 852fa05..e612766 100644
--- a/zone_core/src/lib.rs
+++ b/zone_core/src/lib.rs
@@ -1,6 +1,8 @@
use std::net::{IpAddr, Ipv4Addr};
-pub use crate::container::{CloneOptions, Container, ContainerOptions, ContainerStatus};
+pub use crate::container::{
+ CloneOptions, Container, ContainerOptions, ContainerStatus, WebSocketOptions,
+};
pub use crate::error::{Error, Result};
mod error;