Module wildland_cargo_lib::api::config
source · Expand description
This module consists of types and functions for creating configuration of super::CargoLib.
Configuration may be represented by a JSON like:
let config_json = r#"{
"log_level": "trace",
"log_use_ansi": false,
"log_file_enabled": true,
"log_file_path": "cargo_lib_log",
"log_file_rotate_directory": ".",
"evs_url": "some_url",
"redis_connection_string": "redis://127.0.0.1/0",
"gql_url": "http://localhost:8000/graphql/"
}"#;
let _ = parse_config(config_json.as_bytes().to_vec()).unwrap();It can be also provided via type implementing CargoCfgProvider.
Structs
- Structure representing configuration for
super::CargoLibinitialization. - Structure used to define configuration parameters for the Catalog backend.
- Structure representing configuration of
super::CargoLib. It is used to createsuper::CargoLibinstance. It is created from JSON or from type implementingCargoCfgProvider. This structure provides default values for all fields and can be constructed by either LoggerConfig::new() or LoggerConfig::default(). Those two calls are equivalent to each other. - Redis backend configuration struct.
Enums
Traits
Functions
- Uses an implementation of
CargoCfgProviderto collect a configuration storing structure (CargoConfig) which then can be passed tosuper::cargo_lib::create_cargo_libin order to instantiate main API object (super::CargoLib) - Parses bytes representing JSON formatted configuration of
super::CargoLibinto an instance ofCargoConfigThesettingsmust be a string with JSON formatted configuration.