public ZooKeeperConfigurationProvider(
     ZooKeeperConfigurationOptions options,
     ILogger <ZooKeeperConfigurationProvider> logger)
 {
     _options = options;
     _watcher = new ZooKeeperWatcher(logger);
 }
        /// <summary>
        /// Adds an <see cref="IConfigurationProvider"/> that reads configuration values from the ZooKeeper.
        /// </summary>
        /// <param name="configurationBuilder">The <see cref="IConfigurationBuilder"/> to add to.</param>
        /// <param name="options">The <see cref="ZooKeeperConfigurationOptions"/> to use.</param>
        /// <returns>The <see cref="IConfigurationBuilder"/>.</returns>
        public static IConfigurationBuilder AddZooKeeper(this IConfigurationBuilder configurationBuilder, ZooKeeperConfigurationOptions options)
        {
            if (configurationBuilder == null)
            {
                throw new ArgumentNullException(nameof(configurationBuilder));
            }
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (options.ConnectionString == string.Empty)
            {
                throw new ArgumentNullException(nameof(options.ConnectionString));
            }

            configurationBuilder.Add(new ZooKeeperConfigurationSource(options));

            return(configurationBuilder);
        }
Exemplo n.º 3
0
 public ZooKeeperConfigurationSource(ZooKeeperConfigurationOptions options)
 {
     _options = options;
 }