refactor: execute_command()

Include Id and DockerCommand in a DockerMessage, used by the execute_command function to reduce duplicated code
This commit is contained in:
Jack Wills
2024-11-15 15:39:06 +00:00
parent 1f9062a5cb
commit 2a834d6c2f
6 changed files with 104 additions and 148 deletions
+9 -7
View File
@@ -1,19 +1,21 @@
use std::sync::Arc;
use crate::app_data::ContainerId;
use crate::app_data::{ContainerId, DockerCommand};
use bollard::Docker;
use tokio::sync::oneshot::Sender;
#[derive(Debug)]
pub enum DockerMessage {
ConfirmDelete(ContainerId),
Delete(ContainerId),
Control((DockerCommand, ContainerId)),
// Delete(ContainerId),
Exec(Sender<Arc<Docker>>),
Pause(ContainerId),
// Pause(ContainerId),
Quit,
Restart(ContainerId),
Start(ContainerId),
Stop(ContainerId),
Resume(ContainerId),
// Restart(ContainerId),
// Start(ContainerId),
// Stop(ContainerId),
// Resume(ContainerId),
Update,
}