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:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user