registered command for developement serving

This commit is contained in:
2023-03-07 15:56:21 +01:00
parent f3a3ff2248
commit ab4d2bf7c3
3 changed files with 18 additions and 2 deletions

2
Cargo.lock generated
View File

@@ -135,7 +135,7 @@ dependencies = [
[[package]]
name = "docki"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"bytes",
"colored",

View File

@@ -2,13 +2,14 @@ use std::collections::HashMap;
use traits::Command;
use self::{build::Build, health::Health, reveal::Reveal};
use self::{build::Build, health::Health, reveal::Reveal, serve::Serve};
pub mod traits;
pub mod executions;
mod build;
mod health;
mod reveal;
mod serve;
pub struct CommandRegistry {
commands: HashMap<String, Box<dyn Command>>
@@ -21,6 +22,7 @@ impl CommandRegistry {
registry.register("/build".to_string(), Box::new(Build::new()), true);
registry.register("/health".to_string(), Box::new(Health::new()), true);
registry.register("/install-reveal".to_string(), Box::new(Reveal::new()), true);
registry.register("/serve".to_string(), Box::new(Serve::new()), true)
}

14
src/app/commands/serve.rs Normal file
View File

@@ -0,0 +1,14 @@
use super::traits::Command;
pub struct Serve;
impl Command for Serve {
fn execute(&self, _args: &std::collections::HashMap<String, String>) -> Result<(), String> {
println!("serving the application");
return Ok(())
}
fn new() -> Self where Self: Sized {
return Self {}
}
}