Ejemplo n.º 1
0
 internal EurekaAppCache(IEurekaDiscovery eurekaClient, EurekaDiscovery.ILogger logger, TimeSpan?cacheExpiration)
 {
     Discovery       = eurekaClient;
     Log             = logger ?? new NoopLogger();
     Cache           = new Dictionary <string, CachedApp>();
     CacheExpiration = cacheExpiration.GetValueOrDefault(DEFAULT_CACHE_EXPIRATION);
 }
Ejemplo n.º 2
0
        internal EurekaRestClient(String host, EurekaDiscovery.ILogger logger)
        {
            if (string.IsNullOrEmpty(host))
            {
                throw new ArgumentNullException(nameof(host));
            }

            var parts = host.Split(":");

            if (parts.Length > 1)
            {
                eurekaHost = parts[0];
                eurekaPort = int.Parse(parts[1]);
            }
            else
            {
                eurekaHost = host;
                eurekaPort = 80;
            }

            Log = logger ?? new NoopLogger();
        }