示例#1
0
 private static async Task RunLighthouse(LighthouseCliOptions opts)
 {
     var hostBuilder = new HostBuilder().ConfigureServices((hostContext, services) =>
     {
         services.AddSingleton <IHostedService, LighthouseService>(
             provider => new LighthouseService(opts.ClusterNodeHostname, opts.ClusterNodePort));
     });
     await hostBuilder.RunConsoleAsync().ConfigureAwait(false);
 }
示例#2
0
        private static async Task Main(String[] args)
        {
            LighthouseCliOptions cliOptions = null;

            Parser.Default.ParseArguments <LighthouseCliOptions>(args).WithParsed(options => cliOptions = options);
            if (cliOptions == null)
            {
                return;
            }
            await RunLighthouse(cliOptions).ConfigureAwait(false);
        }