pg_exporter 0.1.0

PostgreSQL metric exporter for Prometheus
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::cli::actions::Action;
use anyhow::Result;
use secrecy::SecretString;

pub fn handler(matches: &clap::ArgMatches) -> Result<Action> {
    Ok(Action::Run {
        dsn: SecretString::from(
            matches
                .get_one::<String>("dsn")
                .map(|s| s.to_string())
                .unwrap_or_default(),
        ),
    })
}