Пример #1
0
        public static ConfigContainer Init(ConsulRegistryConfiguration config)
        {
            Current = new ConfigContainer(
                new FileConfigRepository(),
                new ConsulConfigRepository(config));


            return(Current);
        }
Пример #2
0
        public ConsulConfigRepository(ConsulRegistryConfiguration config)
        {
            prefix       = config.PreInConsul;
            consulClient = new ConsulClient(c =>
            {
                c.Address = new Uri($"http://{config.Host}:{config.Port}");

                if (!string.IsNullOrEmpty(config?.Token))
                {
                    c.Token = config.Token;
                }
            });
        }