|
|
|
@ -7,6 +7,8 @@ pub const HOST: &str = "127.0.0.1"; |
|
|
|
pub const PORT: u16 = 8080; |
|
|
|
pub const PORT: u16 = 8080; |
|
|
|
pub const LOG_LEVEL: &str = "info"; |
|
|
|
pub const LOG_LEVEL: &str = "info"; |
|
|
|
pub const SYSTEM_NAME: &str = "major_pl"; |
|
|
|
pub const SYSTEM_NAME: &str = "major_pl"; |
|
|
|
|
|
|
|
pub const IMPORT_DICT_NAME: &str = ""; |
|
|
|
|
|
|
|
pub const IMPORT_DICT_PATH: &str = ""; |
|
|
|
|
|
|
|
|
|
|
|
pub const HELP_PORT: &str = formatcp!("Override Port [default: {}]", PORT); |
|
|
|
pub const HELP_PORT: &str = formatcp!("Override Port [default: {}]", PORT); |
|
|
|
pub const HELP_LOG: &str = formatcp!("Override Log Level [default: {}]", LOG_LEVEL); |
|
|
|
pub const HELP_LOG: &str = formatcp!("Override Log Level [default: {}]", LOG_LEVEL); |
|
|
|
@ -27,7 +29,13 @@ pub fn set_defaults( |
|
|
|
.set_default("server.port", PORT)? |
|
|
|
.set_default("server.port", PORT)? |
|
|
|
// Decoder
|
|
|
|
// Decoder
|
|
|
|
.set_default("decoder.system", SYSTEM_NAME)? |
|
|
|
.set_default("decoder.system", SYSTEM_NAME)? |
|
|
|
.set_default("decoder.input", "") |
|
|
|
.set_default("decoder.input", "")? |
|
|
|
|
|
|
|
// Encoder
|
|
|
|
|
|
|
|
.set_default("encoder.system", SYSTEM_NAME)? |
|
|
|
|
|
|
|
.set_default("encoder.input", "")? |
|
|
|
|
|
|
|
// Import Dict
|
|
|
|
|
|
|
|
.set_default("import_dict.name", IMPORT_DICT_NAME)? |
|
|
|
|
|
|
|
.set_default("import_dict.path", IMPORT_DICT_PATH) |
|
|
|
// Wrapping in Result
|
|
|
|
// Wrapping in Result
|
|
|
|
.map_err(|e| e.into()) |
|
|
|
.map_err(|e| e.into()) |
|
|
|
} |
|
|
|
} |
|
|
|
|