public void SetUp() { client = new Client(); client.KV.DeleteTree("/"); adapter = new ConsulAdapter(client); flipper = new Flipper(adapter); rubyAdapter = new ConsulRubyAdapter(); }
public void SetUp() { _client = new ConsulClient(); var pairs = _client.KV.Keys("/", "/").Result; foreach (var key in pairs.Response) { _client.KV.DeleteTree(key).Wait(); } adapter = new ConsulAdapter(_client); flipper = new Flipper(adapter); rubyAdapter = new ConsulRubyAdapter(); }
public ConsulServicesRegistry(IConsulClient client) { _client = client; }
public SalaryDataController(IConsulClient consulClient) { this._consulClient = consulClient; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env, IApplicationLifetime lifetime, IOptions <ServiceDisvoveryOptions> options, IConsulClient consulClient) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } //启动时注册服务 lifetime.ApplicationStarted.Register(() => { RegisterService(app, options, consulClient); }); //停止的时候移除服务 lifetime.ApplicationStopped.Register(() => { DeRegisterService(app, options, consulClient); }); app.UseCap(); app.UseAuthentication(); app.UseMvc(); UserContextSeed.SeedAsync(app, loggerFactory).Wait(); }
public ConsulDiscoveryClient(IConsulClient client) { this.client = client; }
public ConsulPreparedQueryServiceSubscriber(IConsulClient client, string queryName) { _client = client; _queryName = queryName; }
public ServiceOperations(IConsulClient client) { _client = client; }
public ConsulClientWrapper(IConsulClient client) { _client = client; }
public ConsulHostedService(IConsulClient client, ConsulConfig config) { _client = client; _config = config; }
public ServiceDiscoveryHostedService(IConsulClient client, ServiceConfig config) { _client = client; _config = config; }
public ServiceDiscoveryHostedService(IConsulClient client, IOptions <ConsulConfig> config) { _client = client; _config = config.Value; }
public ConsulRegistry(IConsulClient client) { this._client = client; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime hostApplicationLifetime, IConsulClient consulClient) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); //Genera el ID de consult var serviceId = app.UseConsul(); hostApplicationLifetime.ApplicationStopped.Register(() => { consulClient.Agent.ServiceDeregister(serviceId); }); ConfigureEventBus(app); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime, IConsulClient consulClient) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseMvc(); }
public ConsulWrapper(IConsulClient consulClient) { this.consulClient = consulClient; }
public ConsulAdapter(IConsulClient client, string rootNamespace) { _client = client; _namespace = rootNamespace.TrimStart('/'); }
public ConsulPreparedQueryServiceSubscriberFactory(IConsulClient consulClient) { _consulClient = consulClient; }
public new void SetUp() { Client = new Client(); Adapter = new ConsulAdapter(Client, Namespace); Client.KV.DeleteTree("/"); }
public Sessions(IConsulClient consulClient) { _client = new HttpClient(); _consulClient = consulClient; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApiVersionDescriptionProvider provider, IHostApplicationLifetime applicationLifetime, IStartupInitializer initializer, IConsulClient consulClient) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } // app.UseHttpsRedirection(); // app.UseCors(builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); initializer.InitializeAsync(); app.UseRouting(); // app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); app.UseSwaggerBuilder(provider); var serviceId = app.UseConsul(); // Disposing container when application getting stopped. applicationLifetime.ApplicationStopped.Register(() => { // Once app becomes offline then remove it from consul. Otherwise it will remain in consul service registry // as dead service consulClient.Agent.ServiceDeregister(serviceId); Container.Dispose(); }); }
public ConsulAdapter(IConsulClient client) { _client = client; _namespace = ""; }
public ConsulHostedService(IConsulClient consulClient, ILogger <ConsulHostedService> logger, IServer server) { _consulClient = consulClient; _logger = logger; _server = server; }
public Consul(ConsulRegistryConfiguration config, IOcelotLoggerFactory factory, IConsulClientFactory clientFactory) { _logger = factory.CreateLogger <Consul>(); _config = config; _consul = clientFactory.Get(_config); }
public ServiceDiscoveryHostedService(IConsulClient client, IOptions <AbpConsulServiceDiscoveryOptions> options) { _client = client; AbpConsulServiceDiscoveryOptions = options.Value; }