wireman_config/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//! Configuration module for `WireMan`.
//!
//! This module provides functionality for defining and reading the configuration
//! for `WireMan`. The config file is read from a JSON file to customize `WireMan`.
//!
//! The config contains:
//!
//! - `includes`: A list of include directories for `gRPC`.
//! - `files`: A list of .proto files to include.
//! - `server`
//!   - `default_address`: The default address of the `gRPC` server.
//!   - `default_auth_header`: The default authentication header.
//! - `history`
//!   - `directory`: The folder path where the history should be kept
pub mod cli;
pub mod config;
pub mod error;
mod install;
mod setup;
pub use config::Config;
pub use setup::init_from_env;

/// This env is used to read the path for the `WireMan` config.
/// If it is not set, the config is expected in the current
/// directory.
pub const ENV_CONFIG_DIR: &str = "WIREMAN_CONFIG_DIR";

/// The wireman config filename
pub const CONFIG_FNAME: &str = "wireman.toml";

/// The default wireman config directory.
/// TOOD: Use the `config_dir` crate to determine the default
/// based on the operating system
pub const DEFAULT_CONFIG_DIR: &str = "~/.config/wireman";