mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-26 08:22:51 +08:00

* copied everything from repos back to ocelot repo * added src projects to sln * removed all test projects that have no tests * added all test projects to sln * removed test not on master * merged unit tests * merged acceptance tests * merged integration tests * fixed namepaces * build script creates packages for all projects * updated docs to make sure no references to external repos that we will remove * +semver: breaking
22 lines
532 B
C#
22 lines
532 B
C#
namespace Ocelot.Provider.Consul
|
|
{
|
|
using System;
|
|
using global::Consul;
|
|
|
|
public class ConsulClientFactory : IConsulClientFactory
|
|
{
|
|
public IConsulClient Get(ConsulRegistryConfiguration config)
|
|
{
|
|
return new ConsulClient(c =>
|
|
{
|
|
c.Address = new Uri($"http://{config.Host}:{config.Port}");
|
|
|
|
if (!string.IsNullOrEmpty(config?.Token))
|
|
{
|
|
c.Token = config.Token;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|