示例#1
0
 public UrlReplacementsProvider(ICachingProxyConfig config)
 {
     //TODO This implementation is too simple, actually we should make a request to index.json and
     // then look through all service endpoints.
     // Currently it works by accident that all URLs are starting with v3
     v3baseAddress   = config.V3NugetIndexSource.Replace("/index.json", "");
     v3flatcontainer = config.V3NugetIndexSource.Replace("v3/index.json", "v3-flatcontainer");
 }
示例#2
0
        public CatalogInvalidator(
            ICachingProxyConfig config, ICatalogScanStore store, ICatalogReader reader)
        {
            this.store = store;
            var period = TimeSpan.FromSeconds(config.InvalidationCheckSeconds);

            _scanTimer  = new Timer(state => Run(), null, period, period);
            this.reader = reader;
        }
示例#3
0
        public NuGetCatalogReader(ICachingProxyConfig config)
        {
            var indexUrl = new System.Uri(config.V3NugetIndexSource);
            var cache    = new SourceCacheContext()
            {
                NoCache        = true,
                DirectDownload = true
            };

            reader = new CatalogReader(indexUrl, null, cache, TimeSpan.Zero, new Log4NetLoggerAdapter(_log));
        }
示例#4
0
 public CatalogInvalidatorTest()
 {
     config = new LiGetEnvironmentConfig();
     store  = new Mock <ICatalogScanStore>(MockBehavior.Strict);
     reader = new Mock <ICatalogReader>(MockBehavior.Strict);
 }
示例#5
0
 public CachingProxyAutofacModule(ICachingProxyConfig cacheConfig)
 {
     this.cacheConfig = cacheConfig ?? throw new System.ArgumentNullException(nameof(cacheConfig));
 }