public void Setup()
        {
            var memStream = new MemoryStream(Encoding.UTF8.GetBytes(_json));

            var parser = new EnvConfigParser();
            _config = parser.GetTypedEnvConfig(memStream, null);
        }
Esempio n. 2
0
        public static ConDepConfig GetEnvConfig(string environment, bool bypassLb, Assembly assembly)
        {
            var envFileName = string.Format("{0}.Env.json", environment);
            var envFilePath = Path.Combine(Path.GetDirectoryName(assembly.Location), envFileName);

            var jsonConfigParser = new EnvConfigParser();
            var envConfig = jsonConfigParser.GetEnvConfig(envFilePath);
            envConfig.EnvironmentName = environment;

            if (bypassLb)
            {
                envConfig.LoadBalancer = null;
            }
            return envConfig;
        }
Esempio n. 3
0
        public static ConDepEnvConfig GetEnvConfig(ConDepSettings settings)
        {
            string envFilePath;
            var    jsonConfigParser = new EnvConfigParser(ResolveConfigParser(settings, out envFilePath));

            var envConfig = jsonConfigParser.GetTypedEnvConfig(envFilePath, settings.Options.CryptoKey);

            envConfig.EnvironmentName = settings.Options.Environment;

            if (settings.Options.BypassLB)
            {
                envConfig.LoadBalancer = null;
            }
            return(envConfig);
        }
Esempio n. 4
0
        public static ConDepEnvConfig GetEnvConfig(ConDepSettings settings)
        {
            var envFileName = string.Format("{0}.Env.json", settings.Options.Environment);
            var envFilePath = Path.Combine(Path.GetDirectoryName(settings.Options.Assembly.Location), envFileName);

            var jsonConfigParser = new EnvConfigParser();
            var envConfig        = jsonConfigParser.GetTypedEnvConfig(envFilePath, settings.Options.CryptoKey);

            envConfig.EnvironmentName = settings.Options.Environment;

            if (settings.Options.BypassLB)
            {
                envConfig.LoadBalancer = null;
            }
            return(envConfig);
        }
Esempio n. 5
0
        public static ConDepConfig GetEnvConfig(string environment, bool bypassLb, Assembly assembly)
        {
            var envFileName = string.Format("{0}.Env.json", environment);
            var envFilePath = Path.Combine(Path.GetDirectoryName(assembly.Location), envFileName);

            var jsonConfigParser = new EnvConfigParser();
            var envConfig        = jsonConfigParser.GetEnvConfig(envFilePath);

            envConfig.EnvironmentName = environment;

            if (bypassLb)
            {
                envConfig.LoadBalancer = null;
            }
            return(envConfig);
        }
Esempio n. 6
0
        private static ConDepConfig GetEnvConfig(CommandLineParams cmdParams, Assembly assembly)
        {
            var envFileName = string.Format("{0}.Env.json", cmdParams.Environment);
            var envFilePath = Path.Combine(Path.GetDirectoryName(assembly.Location), envFileName);

            var jsonConfigParser = new EnvConfigParser();
            var envConfig = jsonConfigParser.GetEnvConfig(envFilePath);
            envConfig.EnvironmentName = cmdParams.Environment;

            //todo: add unit tests for these conditions
            if (!string.IsNullOrWhiteSpace(cmdParams.Server))
            {
                envConfig.Servers.RemoveAllExcept(cmdParams.Server);
            }

            if (cmdParams.BypassLB)
            {
                envConfig.LoadBalancer = null;
            }
            return envConfig;
        }
Esempio n. 7
0
        public void Setup()
        {
            var memStream = new MemoryStream(Encoding.UTF8.GetBytes(_json));
            var tiersMemStream = new MemoryStream(Encoding.UTF8.GetBytes(_tiersJson));

            var parser = new EnvConfigParser();
            _config = parser.GetEnvConfig(memStream);
            _tiersConfig = parser.GetEnvConfig(tiersMemStream);
        }