fn new(parameters: &ArgMatches) -> RiemannClient {
        let address = String::from(parameters.value_of("address").unwrap());
        let port = parameters
            .value_of("port")
            .unwrap()
            .parse::<u16>()
            .expect("Fail parsing port number");
        let client: Client;
        if parameters.is_present("mtls") {
            let cafile = parameters.value_of("cafile").unwrap();
            let certfile = parameters.value_of("certfile").unwrap();
            let keyfile = parameters.value_of("keyfile").unwrap();
            client = Client::connect_tls(&address, port, cafile, certfile, keyfile)
                .expect("Fail to connect to Riemann server using mTLS");
        } else {
            client = Client::connect(&(address, port))
                .expect("Fail to connect to Riemann server using raw TCP");
        }
        RiemannClient { client }
    }
/// Instanciate the Riemann client either with mTLS or using raw TCP.
Instanciate the Riemann client either with mTLS or using raw TCP.
Instanciate the Riemann client either with mTLS or using raw TCP .
fn new(parameters: &ArgMatches) -> RiemannClient {
        let address = String::from(parameters.value_of("address").unwrap());
        let port = parameters
            .value_of("port")
            .unwrap()
            .parse::<u16>()
            .expect("Fail parsing port number");
        let client: Client;
        if parameters.is_present("mtls") {
            let cafile = parameters.value_of("cafile").unwrap();
            let certfile = parameters.value_of("certfile").unwrap();
            let keyfile = parameters.value_of("keyfile").unwrap();
            client = Client::connect_tls(&address, port, cafile, certfile, keyfile)
                .expect("Fail to connect to Riemann server using mTLS");
        } else {
            client = Client::connect(&(address, port))
                .expect("Fail to connect to Riemann server using raw TCP");
        }
        RiemannClient { client }
    }
fn new ( parameters : & ArgMatches ) -> RiemannClient { let address = String :: from ( parameters . value_of ( " " ) . unwrap ( ) ) ; let port = parameters . value_of ( " " ) . unwrap ( ) . parse :: < u16 > ( ) . expect ( " " ) ; let client : Client ; if parameters . is_present ( " " ) { let cafile = parameters . value_of ( " " ) . unwrap ( ) ; let certfile = parameters . value_of ( " " ) . unwrap ( ) ; let keyfile = parameters . value_of ( " " ) . unwrap ( ) ; client = Client :: connect_tls ( & address , port , cafile , certfile , keyfile ) . expect ( " " ) ; } else { client = Client :: connect ( & ( address , port ) ) . expect ( " " ) ; } RiemannClient { client } }
Instanciate the Riemann client either with mTLS or using raw TCP.
Instanciate the Riemann client either with mTLS or using raw TCP .
parameters
&ArgMatches
parameters
&ArgMatches