registered command for developement serving
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -135,7 +135,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "docki"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"colored",
|
||||
|
||||
@@ -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
14
src/app/commands/serve.rs
Normal 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 {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user