A helper class to parameters from “options” configuration section.
Description
The OptionsResolver class can be use to obtain all the parameters under the section “options” from a CongifParams object. It has a single method called “resolve”.
Methods
Resolve
Resolves an “options” configuration section from component configuration parameters.
(c *TOptionResolver) Resolve(config *ConfigParams) *ConfigParams
- config: *ConfigParams - configuration parameters
- returns: *ConfigParams - configuration parameters from “options” section
ResolveWithDefault
Resolves an “options” configuration section from component configuration parameters.
(c *TOptionResolver) ResolveWithDefault(config *ConfigParams) *ConfigParams
- config: *ConfigParams - default configuration parameters
- returns: *ConfigParams - configuration parameters from “options” section
Examples
config := NewConfigParamsFromTuples(
...
"options.param1", "ABC",
"options.param2", 123
);
options := OptionsResolver.resolve(config); // Result: param1=ABC;param2=123