internal HealthConfigurationBuilder( IHealthBuilder healthBuilder, HealthOptions currentOptions, Action <HealthOptions> setupAction) { Builder = healthBuilder ?? throw new ArgumentNullException(nameof(healthBuilder)); _setupAction = setupAction ?? throw new ArgumentNullException(nameof(setupAction)); _options = currentOptions ?? new HealthOptions(); }
/// <inheritdoc /> public IHealthBuilder Configure(HealthOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } _setupAction(options); _options = options; return(Builder); }
public HealthRoot( IHealth health, HealthOptions options, HealthFormatterCollection metricsOutputFormatters, IHealthOutputFormatter defaultMetricsOutputFormatter, IRunHealthChecks healthCheckRunner) { Options = options ?? throw new ArgumentNullException(nameof(options)); _health = health ?? throw new ArgumentNullException(nameof(health)); OutputHealthFormatters = metricsOutputFormatters ?? new HealthFormatterCollection(); DefaultOutputHealthFormatter = defaultMetricsOutputFormatter; HealthCheckRunner = healthCheckRunner; }
/// <inheritdoc /> public IHealthBuilder Configure(IEnumerable <KeyValuePair <string, string> > optionValues) { if (optionValues == null) { throw new ArgumentNullException(nameof(optionValues)); } var mergedOptions = new KeyValuePairHealthOptions(_options, optionValues).AsOptions(); _setupAction(mergedOptions); _options = mergedOptions; return(Builder); }
/// <inheritdoc /> public IHealthBuilder Extend(HealthOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } var optionsValuesToExtend = options.ToKeyValue(); var extendedOptions = new KeyValuePairHealthOptions(_options, optionsValuesToExtend).AsOptions(); _setupAction(extendedOptions); _options = extendedOptions; return(Builder); }