subbeat
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
459 B

pub mod grafana;
pub mod influx;
pub mod prometheus;
use crate::{metric::Metric, types::DatasourceConfig};
pub fn resolve(config: &DatasourceConfig) -> Box<dyn Metric + Sync + Send> {
match config {
DatasourceConfig::Grafana(cfg) => Box::new(grafana::Grafana::new(cfg)),
DatasourceConfig::Prometheus(cfg) => Box::new(prometheus::Prometheus::new(cfg)),
DatasourceConfig::Influx(cfg) => Box::new(influx::Influx::new(cfg)),
}
}