mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-09-18 10:42:42 +08:00
tests passing
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
namespace Ocelot.Provider.Eureka
|
||||
{
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Ocelot.ServiceDiscovery;
|
||||
namespace Ocelot.Provider.Eureka
|
||||
{
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Ocelot.ServiceDiscovery;
|
||||
using Steeltoe.Discovery;
|
||||
|
||||
public static class EurekaProviderFactory
|
||||
{
|
||||
public static ServiceDiscoveryFinderDelegate Get = (provider, config, route) =>
|
||||
{
|
||||
var client = provider.GetService<IDiscoveryClient>();
|
||||
|
||||
if (config.Type?.ToLower() == "eureka" && client != null)
|
||||
{
|
||||
return new Eureka(route.ServiceName, client);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
}
|
||||
public static class EurekaProviderFactory
|
||||
{
|
||||
public static ServiceDiscoveryFinderDelegate Get = (provider, config, route) =>
|
||||
{
|
||||
var client = provider.GetService<IDiscoveryClient>();
|
||||
|
||||
if (config.Type?.ToLower() == "eureka" && client != null)
|
||||
{
|
||||
return new Eureka(route.ServiceName, client);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.0.1" />
|
||||
<PackageReference Include="Steeltoe.Discovery.Eureka" Version="3.0.1" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
Reference in New Issue
Block a user