Esempio n. 1
0
        private ConfigCatClient(ConfigurationBase configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            configuration.Validate();

            this.log = configuration.Logger;
            this.configDeserializer = new ConfigDeserializer(this.log, JsonSerializer.Create());
            this.configEvaluator    = new RolloutEvaluator(this.log, this.configDeserializer);
            this.cacheParameters    = new CacheParameters
            {
                ConfigCache = configuration.ConfigCache ?? new InMemoryConfigCache(),
                CacheKey    = GetCacheKey(configuration)
            };
        }
Esempio n. 2
0
        private static string GetCacheKey(ConfigurationBase configuration)
        {
            var key = $"dotnet_{ConfigurationBase.ConfigFileName}_{configuration.SdkKey}";

            return(HashUtils.HashString(key));
        }
        private void InitializeClient(ConfigurationBase configuration)
        {
            this.log = configuration.LoggerFactory.GetLogger(nameof(ConfigCatClient));

            this.configEvaluator = new RolloutEvaluator(this.log);
        }