Exemplo n.º 1
0
        public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
        .ConfigureServices((hostContext, services) =>
        {
            // services.AddHostedService<Worker>();

            services.AddHostedService <ApiTrackerConsumer>();
            services.AddSingleton <IConfiguration>(Program.Configuration);

            services.AddDbContext <CvContext>(cfg =>
            {
                cfg.UseSqlServer(hostContext.Configuration.GetConnectionString("cvConnectionString"));
            });

            var cvCfg = new cvConfig(Program.Configuration);
            services.AddSingleton <cvConfig>(cvCfg);

            var cvp = new cvParsers(cvCfg);
            services.AddSingleton <cvParsers>(cvp);

            // rabbitmq
            var ctxCloudAmqp = new RabbitContext().Create("cv.scraper.json");
            var ctxLocal     = new RabbitContext().Create("cv.localhost.json");
            services.AddSingleton(ctxCloudAmqp);
            services.AddSingleton(ctxLocal);
        });
 public ConsoleApplication(CvContext ctx,
                           IConfiguration cfg,
                           cvParsers parsers,
                           cvConfig cvConfiguration)
 {
     this.ctx             = ctx;
     this.cfg             = cfg;
     this.parsers         = parsers;
     this.cvConfiguration = cvConfiguration;
 }
 public ScrapeRunsTest(CvContext ctx,
                       IConfiguration cfg,
                       cvParsers parsers,
                       cvConfig cvConfiguration)
 {
     this.ctx             = ctx;
     this.cfg             = cfg;
     this.parsers         = parsers;
     this.cvConfiguration = cvConfiguration;
 }
Exemplo n.º 4
0
 public FileWatcherConsole(CvContext ctx,
                           IConfiguration cfg,
                           ImportScrapeData importData,
                           cvParsers cvParsers,
                           cvConfig cvConfiguration)
 {
     this.ctx             = ctx;
     this.cfg             = cfg;
     this.importData      = importData;
     this.cvParsers       = cvParsers;
     this.cvConfiguration = cvConfiguration;
 }
Exemplo n.º 5
0
        public ScrapeFileImport(CvContext ctx,
                                IConfiguration cfg,
                                cvParsers parsers,
                                ImportScrapeData importer,
                                cvConfig cvConfiguration)
        {
            this.ctx             = ctx;
            this.cfg             = cfg;
            this.parsers         = parsers;
            this.importer        = importer;
            this.cvConfiguration = cvConfiguration;

            runtest = new ScrapeRunsTest(ctx, cfg, parsers, cvConfiguration);
        }
 public ImportScrapeData(CvContext dbCtx, cvParsers parsers, cvConfig cvConfiguration)
 {
     this.ctx             = dbCtx;
     this.parsers         = parsers;
     this.cvConfiguration = cvConfiguration;
 }