This repository was archived by the owner on Mar 31, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathServiceCollectionExtensions.Drivers.cs
More file actions
73 lines (61 loc) · 3.61 KB
/
ServiceCollectionExtensions.Drivers.cs
File metadata and controls
73 lines (61 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using NuGet.Insights.Worker.BuildVersionSet;
using NuGet.Insights.Worker.FindLatestCatalogLeafScan;
using NuGet.Insights.Worker.FindLatestCatalogLeafScanPerId;
using NuGet.Insights.Worker.LoadBucketedPackage;
using NuGet.Insights.Worker.LoadLatestPackageLeaf;
using NuGet.Insights.Worker.LoadPackageArchive;
using NuGet.Insights.Worker.LoadPackageManifest;
using NuGet.Insights.Worker.LoadPackageReadme;
using NuGet.Insights.Worker.LoadPackageVersion;
using NuGet.Insights.Worker.LoadSymbolPackageArchive;
using NuGetGallery.Frameworks;
namespace NuGet.Insights.Worker
{
public static partial class ServiceCollectionExtensions
{
/// <summary>
/// Invoked via reflection in <see cref="AddNuGetInsightsWorker(IServiceCollection)"/>.
/// </summary>
private static void SetupDrivers(IServiceCollection serviceCollection)
{
// Internal_FindLatestCatalogLeafScan
serviceCollection.AddSingleton<ILatestPackageLeafStorageFactory<CatalogLeafScan>, LatestCatalogLeafScanStorageFactory>();
serviceCollection.AddSingleton<FindLatestLeafDriver<CatalogLeafScan>>();
// Internal_FindLatestCatalogLeafScanPerId
serviceCollection.AddSingleton<ILatestPackageLeafStorageFactory<CatalogLeafScanPerId>, LatestCatalogLeafScanPerIdStorageFactory>();
serviceCollection.AddSingleton<FindLatestLeafDriver<CatalogLeafScanPerId>>();
// PackageCompatibilityToCsv
serviceCollection.AddSingleton<IPackageFrameworkCompatibilityFactory>(new PackageFrameworkCompatibilityFactory());
// BuildVersionSet
serviceCollection.AddSingleton<BuildVersionSetDriver>();
serviceCollection.AddSingleton<VersionSetAggregateStorageService>();
serviceCollection.AddSingleton<VersionSetService>();
serviceCollection.AddSingleton<IVersionSetProvider>(s => s.GetRequiredService<VersionSetService>());
// LoadLatestPackageLeaf
AddTableScan<LatestPackageLeaf>(serviceCollection);
serviceCollection.AddSingleton<LatestPackageLeafService>();
serviceCollection.AddSingleton<LatestPackageLeafStorageFactory>();
serviceCollection.AddSingleton<ILatestPackageLeafStorageFactory<LatestPackageLeaf>, LatestPackageLeafStorageFactory>();
serviceCollection.AddSingleton<FindLatestLeafDriver<LatestPackageLeaf>>();
// LoadBucketedPackage
AddTableScan<BucketedPackage>(serviceCollection);
serviceCollection.AddSingleton<BucketedPackageService>();
serviceCollection.AddSingleton<BucketedPackageStorageFactory>();
serviceCollection.AddSingleton<ILatestPackageLeafStorageFactory<BucketedPackage>, BucketedPackageStorageFactory>();
serviceCollection.AddSingleton<FindLatestLeafDriver<BucketedPackage>>();
// LoadPackageArchive
serviceCollection.AddSingleton<LoadPackageArchiveDriver>();
// LoadSymbolPackageArchive
serviceCollection.AddSingleton<LoadSymbolPackageArchiveDriver>();
// LoadPackageManifest
serviceCollection.AddSingleton<LoadPackageManifestDriver>();
// LoadPackageReadme
serviceCollection.AddSingleton<LoadPackageReadmeDriver>();
// LoadPackageVersion
serviceCollection.AddSingleton<LoadPackageVersionDriver>();
serviceCollection.AddSingleton<PackageVersionStorageService>();
}
}
}