Exemplo n.º 1
0
        public static IConfigurationRoot BuildConfiguration(OptionsBase opts)
        {
            IConfigurationBuilder builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory());

            if (opts.RuntimeMode.ToUpper() == "DOCKER")
            {
                Console.WriteLine("Docker mode.");

                if (File.Exists(_docker_base_path))
                {
                    Console.WriteLine($"Loading config file {_docker_base_path}");
                    builder = builder.AddJsonFile(_docker_base_path, false, false);
                }
                else
                {
                    Console.WriteLine($"Default docker config not found. Loading config file {_docker_appsettings}");
                    builder = builder.AddJsonFile(_docker_appsettings, false, false);
                }
            }
            else
            {
                builder = builder.AddJsonFile(_appsettings, false, false);
            }

            return(builder.Build());
        }
Exemplo n.º 2
0
        public CliApp(IServiceProvider serviceProvider, IHostApplicationLifetime applicationLifetime, IOptions <AppSettings> appSettings, OptionsBase interactiveOptions)
        {
            this.appSettings = appSettings.Value;
            this.CmdModeratorInteractiveOptions = interactiveOptions;
            this.applicationLifetime            = applicationLifetime;
            this.serviceProvider = serviceProvider;

            this.api = new API();
            this.api.Init(this.appSettings, interactiveOptions, NeuraliumApi.UseModes.SendReceive);

            this.loop = new Loop(typeof(ApiCommands));
        }
Exemplo n.º 3
0
 public void SetCmdOptions(OptionsBase cmdQueryOptions)
 {
     this.CmdQueryOptions = cmdQueryOptions;
 }