ConfigReader

Abstract config reader that supports configuration parameterization.

Implements: IConfigurable

Description

The ConfigReader class allows you to create config readers that support configuration parameterization.

Configuration parameters

  • parameters: this entire section is used as template parameters

Instance methods

configure

Configures component by passing configuration parameters.

public configure(config: ConfigParams): void

  • config: ConfigParams - configuration parameters to be set.

parameterize

Parameterized configuration template given as string with dynamic parameters.

protected parameterize(config: string, parameters: ConfigParams): string

  • config: string - a string with configuration template to be parameterized
  • parameters: ConfigParams - dynamic parameters to inject into the template
  • returns: string - a parameterized configuration string.

Abstract methods

readConfig

Reads configuration and parameterizes it with given values.

public abstract readConfig(correlationId: string, parameters: ConfigParams) Promise<ConfigParams>

  • correlationId: string - (optional) transaction id to trace execution through call chain.
  • parameters: ConfigParams - values to parameters of the configuration or null to skip parameterization.
  • returns: Promise<ConfigParams> - ConfigParams configuration.

See also