df-cache 0.1.6

This is an Cache
Documentation
use std::{fs, thread};
use std::path::{PathBuf};
use std::time::Duration;
use df_cache::Cache;

fn main() {
    let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
    let dir = dir.join("config");
    let config_path = dir.join("cache.json");

    let conf = fs::read_to_string(config_path.to_str().unwrap()).unwrap();
    let conf = json::parse(conf.as_str().clone()).unwrap();
    let mut cache = Cache::connect(conf);
    // let _ = cache.db(0).set("tests", 1111.into(),0);
    // let data = cache.db(0).get("tests");
    // println!("{}", data);
    // let data = cache.db(1).get("tests");
    // println!("{}", data);
    let data = cache.db(0).set("t", "1".into(), 2);
    println!(">>>{}", data);
    thread::sleep(Duration::from_secs(1));
    let data = cache.db(0).get("t");
    println!(">>>{}", data);
}