Esempio n. 1
0
        public EntityBuilder(
            RegistrationUrlBuilder urlBuilder,
            IOptionsSnapshot <Catalog2RegistrationConfiguration> options)
        {
            _urlBuilder = urlBuilder ?? throw new ArgumentNullException(nameof(urlBuilder));
            _options    = options ?? throw new ArgumentNullException(nameof(urlBuilder));

            var flatContainerBaseUrl = _options.Value.FlatContainerBaseUrl.TrimEnd('/');

            _flatContainerPathProvider = new FlatContainerPackagePathProvider(flatContainerBaseUrl);
            _galleryBaseUrl            = new Uri(_options.Value.GalleryBaseUrl);
        }
Esempio n. 2
0
 public HiveStorage(
     ICloudBlobClient cloudBlobClient,
     RegistrationUrlBuilder urlBuilder,
     IEntityBuilder entityBuilder,
     IThrottle throttle,
     IOptionsSnapshot <Catalog2RegistrationConfiguration> options,
     ILogger <HiveStorage> logger)
 {
     _cloudBlobClient = cloudBlobClient ?? throw new ArgumentNullException(nameof(cloudBlobClient));
     _urlBuilder      = urlBuilder ?? throw new ArgumentNullException(nameof(urlBuilder));
     _entityBuilder   = entityBuilder ?? throw new ArgumentNullException(nameof(entityBuilder));
     _throttle        = throttle ?? throw new ArgumentNullException(nameof(throttle));
     _options         = options ?? throw new ArgumentNullException(nameof(options));
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Esempio n. 3
0
        public IntegrationTests(ITestOutputHelper output)
        {
            Options = new Mock <IOptionsSnapshot <Catalog2RegistrationConfiguration> >();
            Config  = new Catalog2RegistrationConfiguration
            {
                LegacyBaseUrl                  = "https://example/v3/reg",
                LegacyStorageContainer         = "v3-reg",
                GzippedBaseUrl                 = "https://example/v3/reg-gz",
                GzippedStorageContainer        = "v3-reg-gz",
                SemVer2BaseUrl                 = "https://example/v3/reg-gz-semver2",
                SemVer2StorageContainer        = "v3-reg-gz-semver2",
                FlatContainerBaseUrl           = "https://example/v3/flatcontainer",
                GalleryBaseUrl                 = "https://example-gallery",
                MaxConcurrentHivesPerId        = 1,
                MaxConcurrentIds               = 1,
                MaxConcurrentOperationsPerHive = 1,
                MaxConcurrentStorageOperations = 1,
                EnsureSingleSnapshot           = false,
            };
            Options.Setup(x => x.Value).Returns(() => Config);

            CloudBlobClient        = new InMemoryCloudBlobClient();
            RegistrationUrlBuilder = new RegistrationUrlBuilder(Options.Object);
            EntityBuilder          = new EntityBuilder(RegistrationUrlBuilder, Options.Object);
            Throttle    = NullThrottle.Instance;
            HiveStorage = new HiveStorage(
                CloudBlobClient,
                RegistrationUrlBuilder,
                EntityBuilder,
                Throttle,
                Options.Object,
                output.GetLogger <HiveStorage>());
            HiveMerger  = new HiveMerger(Options.Object, output.GetLogger <HiveMerger>());
            HiveUpdater = new HiveUpdater(
                HiveStorage,
                HiveMerger,
                EntityBuilder,
                Options.Object,
                output.GetLogger <HiveUpdater>());
            RegistrationUpdater = new RegistrationUpdater(
                HiveUpdater,
                Options.Object,
                output.GetLogger <RegistrationUpdater>());
        }