north-config 0.0.3

North config is a multi source configuration crate designed as part of the North Microservice Framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::path::Path;
use notify::{ RecursiveMode, Watcher };

pub fn watch_file_path(path: Box<Path>) -> Result<(), crate::Error> {
    // Automatically select the best implementation for your platform.
    let mut watcher = notify::recommended_watcher(|res| {
        match res {
            Ok(event) => println!("event: {:?}", event),
            Err(e) => println!("watch error: {:?}", e),
        }
    }).unwrap();

    watcher.watch(&*path, RecursiveMode::Recursive).unwrap();

    Ok(())
}