Function influent::create_client [] [src]

pub fn create_client<'a>(credentials: Credentials<'a>,
                         hosts: Vec<&'a str>)
                         -> HttpClient<'a>

Simple factory of HttpClient with LineSerializer

Takes two parameters, where first is Credentials struct, and second - Vec<&str>, where each item is a InfluxDB host url.

Examples

use influent::create_client;
use influent::client::Credentials;

let credentials = Credentials {
    username: "gobwas",
    password: "xxx",
    database: "mydb"
};

let client = create_client(credentials, vec!["http://localhost:8086"]);