MemoryConfigReader class

Config reader that stores configuration in memory.

The reader supports parameterization using Handlebars template engine: https://handlebarsjs.com

Configuration parameters

The configuration parameters are the configuration template

See IConfigReader

Example

var config = ConfigParams.fromTuples([
    'connection.host', '{{SERVICE_HOST}}',
    'connection.port', '{{SERVICE_PORT}}{{^SERVICE_PORT}}8080{{/SERVICE_PORT}}'
]);

var configReader = new MemoryConfigReader();
configReader.configure(config);

var parameters = ConfigParams.fromValue(process.env);

var config = await configReader.readConfig('123', parameters)
    // Possible result: connection.host=10.1.1.100;connection.port=8080
Implemented types

Constructors

MemoryConfigReader([ConfigParams config ])
Creates a new instance of config reader. [...]

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

configure(ConfigParams config) → void
Configures component by passing configuration parameters. [...]
readConfig(String correlationId, ConfigParams parameters) → Future<ConfigParams>
Reads configuration and parameterize it with given values. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited