mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 05:10:55 +00:00
cleanup(ctl): move logic for branching ctl run steps into ControlCommands
This commit is contained in:
@ -43,8 +43,13 @@ impl ControlCommand {
|
|||||||
pub async fn run(self) -> Result<()> {
|
pub async fn run(self) -> Result<()> {
|
||||||
let client = ControlClientProvider::dial(self.connection.parse()?).await?;
|
let client = ControlClientProvider::dial(self.connection.parse()?).await?;
|
||||||
let events = EventStream::open(client.clone()).await?;
|
let events = EventStream::open(client.clone()).await?;
|
||||||
|
self.command.run(client, events).await
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
match self.command {
|
impl ControlCommands {
|
||||||
|
pub async fn run(self, client: ControlServiceClient<Channel>, events: EventStream) -> Result<()> {
|
||||||
|
match self {
|
||||||
ControlCommands::Zone(zone) => zone.run(client, events).await,
|
ControlCommands::Zone(zone) => zone.run(client, events).await,
|
||||||
|
|
||||||
ControlCommands::Image(image) => image.run(client, events).await,
|
ControlCommands::Image(image) => image.run(client, events).await,
|
||||||
|
Reference in New Issue
Block a user