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 pathICatalogLeafToCsvDriver.cs
More file actions
62 lines (56 loc) · 3.03 KB
/
ICatalogLeafToCsvDriver.cs
File metadata and controls
62 lines (56 loc) · 3.03 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
// 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.
namespace NuGet.Insights.Worker
{
public interface ICatalogLeafToCsvDriver
{
/// <summary>
/// Whether or not the <see cref="ICatalogLeafToCsvDriver{T}.ProcessLeafAsync(CatalogLeafScan)"/> or
/// <see cref="ICatalogLeafToCsvBatchDriver{T}.ProcessLeavesAsync(IReadOnlyList{CatalogLeafScan})"/>
/// should only be called once per package ID in the catalog scan. Returning <c>true</c> means you expect to
/// process latest data once per package ID. Returning <c>false</c> means you expect to process the latest data
/// once per package ID and version.
/// </summary>
bool SingleMessagePerId { get; }
/// <summary>
/// Initialize storage containers and dependencies prior to processing package data.
/// </summary>
Task InitializeAsync();
/// <summary>
/// Delete additional output storage aside from the storage container referenced by <see cref="ICsvResultStorage{T}.ResultContainerName"/>.
/// </summary>
Task DestroyAsync();
}
public interface ICatalogLeafToCsvDriver<T> : ICatalogLeafToCsvDriver where T : class, IAggregatedCsvRecord<T>
{
/// <summary>
/// Process each catalog leaf scan and return CSV rows to accumulate in Azure Blob storage.
/// </summary>
/// <param name="leafScan">The catalog leaf scan to process.</param>
/// <returns>The result, either try again later or a list of records that will be written to CSV.</returns>
Task<DriverResult<IReadOnlyList<T>>> ProcessLeafAsync(CatalogLeafScan leafScan);
}
public interface ICatalogLeafToCsvDriver<T1, T2> : ICatalogLeafToCsvDriver
where T1 : class, IAggregatedCsvRecord<T1>
where T2 : class, IAggregatedCsvRecord<T2>
{
/// <summary>
/// Process each catalog leaf scan and return CSV rows to accumulate in Azure Blob storage.
/// </summary>
/// <param name="leafScan">The catalog leaf scan to process.</param>
/// <returns>The result, either try again later or a list of records that will be written to CSV.</returns>
Task<DriverResult<CsvRecordSets<T1, T2>>> ProcessLeafAsync(CatalogLeafScan leafScan);
}
public interface ICatalogLeafToCsvDriver<T1, T2, T3> : ICatalogLeafToCsvDriver
where T1 : class, IAggregatedCsvRecord<T1>
where T2 : class, IAggregatedCsvRecord<T2>
where T3 : class, IAggregatedCsvRecord<T3>
{
/// <summary>
/// Process each catalog leaf scan and return CSV rows to accumulate in Azure Blob storage.
/// </summary>
/// <param name="leafScan">The catalog leaf scan to process.</param>
/// <returns>The result, either try again later or a list of records that will be written to CSV.</returns>
Task<DriverResult<CsvRecordSets<T1, T2, T3>>> ProcessLeafAsync(CatalogLeafScan leafScan);
}
}