Exemplo n.º 1
0
 public ConsulServiceFinder(ConsulHostConfiguration configuration)
 {
     _client = new ConsulClient(config =>
     {
         config.Address    = configuration.Address;
         config.Datacenter = configuration.DataCenter;
         config.Token      = configuration.Token;
         config.WaitTime   = configuration.WaitTime;
     });
 }
        public static IServiceCollection AddServiceFinder(this IServiceCollection services, ConsulHostConfiguration configuration)
        {
            services.AddSingleton(configuration);
            services.AddTransient <IServiceFinder <ConsulService>, ConsulServiceFinder>();

            return(services);
        }