rnetmon/src/plugins/output/mod.rs

15 lines
412 B
Rust
Raw Normal View History

2019-02-05 07:10:55 +00:00
pub mod bluetooth_lightbulb;
pub mod espeak;
2019-01-31 10:01:47 +00:00
pub mod stdout;
2019-02-05 07:10:55 +00:00
use crate::output::*;
use std::collections::HashMap;
pub fn factory(name: &str, config: &HashMap<String, serde_yaml::Value>) -> Box<Output + Send> {
match name {
"stdout" => Box::new(stdout::Stdout::new(&config)),
"espeak" => Box::new(espeak::Espeak::new(&config)),
_ => panic!("Unknown monitor name: {}", name),
}
}