Skip to content

Commit

Permalink
ThreeMammals#529 removed consul deps and introduced delegate to find …
Browse files Browse the repository at this point in the history
…service discovery provider (ThreeMammals#538)
  • Loading branch information
TomPallister authored Aug 12, 2018
1 parent afe3226 commit a91235b
Show file tree
Hide file tree
Showing 26 changed files with 99 additions and 2,383 deletions.

This file was deleted.

3 changes: 2 additions & 1 deletion src/Ocelot/DependencyInjection/IOcelotBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Ocelot.DependencyInjection
public interface IOcelotBuilder
{
IServiceCollection Services { get; }

IConfiguration Configuration { get; }
IOcelotBuilder AddStoreOcelotConfigurationInConsul();

IOcelotAdministrationBuilder AddAdministration(string path, string secret);

Expand All @@ -22,6 +22,7 @@ IOcelotBuilder AddDelegatingHandler<T>(bool global = false)

IOcelotBuilder AddSingletonDefinedAggregator<T>()
where T : class, IDefinedAggregator;

IOcelotBuilder AddTransientDefinedAggregator<T>()
where T : class, IDefinedAggregator;
}
Expand Down
9 changes: 0 additions & 9 deletions src/Ocelot/DependencyInjection/OcelotBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ namespace Ocelot.DependencyInjection
using Microsoft.Extensions.DependencyInjection.Extensions;
using System.Net.Http;
using Ocelot.Infrastructure;
using Ocelot.Infrastructure.Consul;
using Ocelot.Middleware.Multiplexer;
using ServiceDiscovery.Providers;
using Steeltoe.Common.Discovery;
Expand Down Expand Up @@ -148,7 +147,6 @@ public OcelotBuilder(IServiceCollection services, IConfiguration configurationRo
Services.TryAddSingleton<IFileConfigurationPollerOptions, InMemoryFileConfigurationPollerOptions>();
Services.TryAddSingleton<IAddHeadersToResponse, AddHeadersToResponse>();
Services.TryAddSingleton<IPlaceholders, Placeholders>();
Services.TryAddSingleton<IConsulClientFactory, ConsulClientFactory>();
Services.TryAddSingleton<IResponseAggregatorFactory, InMemoryResponseAggregatorFactory>();
Services.TryAddSingleton<IDefinedAggregatorProvider, ServiceLocatorDefinedAggregatorProvider>();
Services.TryAddSingleton<IDownstreamRequestCreator, DownstreamRequestCreator>();
Expand Down Expand Up @@ -217,13 +215,6 @@ public IOcelotBuilder AddDelegatingHandler<THandler>(bool global = false)
return this;
}

public IOcelotBuilder AddStoreOcelotConfigurationInConsul()
{
Services.AddHostedService<FileConfigurationPoller>();
Services.AddSingleton<IFileConfigurationRepository, ConsulFileConfigurationRepository>();
return this;
}

private void AddIdentityServer(Action<IdentityServerAuthenticationOptions> configOptions)
{
Services
Expand Down
22 changes: 0 additions & 22 deletions src/Ocelot/Infrastructure/Consul/ConsulClientFactory.cs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Ocelot/Infrastructure/Consul/IConsulClientFactory.cs

This file was deleted.

3 changes: 2 additions & 1 deletion src/Ocelot/Middleware/OcelotMiddlewareExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ private static void ThrowToStopOcelotStarting(Response config)

private static bool UsingConsul(IFileConfigurationRepository fileConfigRepo)
{
return fileConfigRepo.GetType() == typeof(ConsulFileConfigurationRepository);
//todo - remove coupling by string
return fileConfigRepo.GetType().Name == "ConsulFileConfigurationRepository";
}

private static void CreateAdministrationArea(IApplicationBuilder builder, IInternalConfiguration configuration)
Expand Down
1 change: 0 additions & 1 deletion src/Ocelot/Ocelot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.0" />
<PackageReference Include="Consul" Version="0.7.2.5" />
<PackageReference Include="Polly" Version="6.0.1" />
<PackageReference Include="IdentityServer4" Version="2.2.0" />
<PackageReference Include="Pivotal.Discovery.ClientCore" Version="2.0.1" />
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit a91235b

Please sign in to comment.