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::CargoLib
initialization. - Structure used to define configuration parameters for the Catalog backend.
- Structure representing configuration of
super::CargoLib
. It is used to createsuper::CargoLib
instance. 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
CargoCfgProvider
to collect a configuration storing structure (CargoConfig
) which then can be passed tosuper::cargo_lib::create_cargo_lib
in order to instantiate main API object (super::CargoLib
) - Parses bytes representing JSON formatted configuration of
super::CargoLib
into an instance ofCargoConfig
Thesettings
must be a string with JSON formatted configuration.