wireman_config/
lib.rs

1//! Configuration module for `WireMan`.
2//!
3//! This module provides functionality for defining and reading the configuration
4//! for `WireMan`. The config file is read from a JSON file to customize `WireMan`.
5//!
6//! The config contains:
7//!
8//! - `includes`: A list of include directories for `gRPC`.
9//! - `files`: A list of .proto files to include.
10//! - `server`
11//!   - `default_address`: The default address of the `gRPC` server.
12//!   - `default_auth_header`: The default authentication header.
13//! - `history`
14//!   - `directory`: The folder path where the history should be kept
15pub mod cli;
16pub mod config;
17pub mod error;
18mod install;
19mod setup;
20pub use config::Config;
21pub use setup::init_from_env;
22
23/// This env is used to read the path for the `WireMan` config.
24/// If it is not set, the config is expected in the current
25/// directory.
26pub const ENV_CONFIG_DIR: &str = "WIREMAN_CONFIG_DIR";
27
28/// The wireman config filename
29pub const CONFIG_FNAME: &str = "wireman.toml";
30
31/// The default wireman config directory.
32/// TODO: Use the `config_dir` crate to determine the default
33/// based on the operating system
34pub const DEFAULT_CONFIG_DIR: &str = "~/.config/wireman";