Esempio n. 1
0
        public static IConfigurationBuilder AddConsul(this IConfigurationBuilder builder, Action <ConsulOptions> options)
        {
            ConsulOptions consulOptions = new ConsulOptions();

            options.Invoke(consulOptions);
            return(builder.Add(new ConsulConfigurationSource {
                ConsulOptions = consulOptions
            }));
        }
Esempio n. 2
0
 public ConsulConfigurationProvider(ConsulOptions options)
 {
     _consulClient = new ConsulClient(x =>
     {
         // consul 服务地址
         x.Address = new Uri(options.Address);
     });
     _path            = options.Path;
     _waitMillisecond = options.WaitMillisecond;
     _reloadOnChange  = options.ReloadOnChange;
 }