cc-core 0.1.1

A core library for configuration, MySQL and Redis connection management
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use cc_core::Config;

fn main() -> anyhow::Result<()> {
    let config = Config::load("config/config.toml")?;

    if let Some(mysql_config) = config.mysql("default") {
        println!("MySQL: {}:{}", mysql_config.host, mysql_config.port);
    }

    if let Some(redis_config) = config.redis("default") {
        println!("Redis: {}", redis_config.url);
    }

    Ok(())
}