-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathIStorage.cs
More file actions
56 lines (51 loc) · 2.84 KB
/
Copy pathIStorage.cs
File metadata and controls
56 lines (51 loc) · 2.84 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
using System;
using System.Threading;
using System.Threading.Tasks;
using ManagedCode.Communication;
namespace ManagedCode.Storage.Core
{
/// <summary>
/// Represents a generic storage interface with a specific client and options.
/// </summary>
/// <typeparam name="T">The type of the storage client.</typeparam>
/// <typeparam name="TOptions">The type of the storage options.</typeparam>
public interface IStorage<out T, TOptions> : IStorage where TOptions : IStorageOptions
{
/// <summary>
/// Gets the storage client.
/// </summary>
T StorageClient { get; }
/// <summary>
/// Sets the storage options asynchronously.
/// </summary>
/// <param name="options">The options to set.</param>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the result of the operation.</returns>
Task<Result> SetStorageOptions(TOptions options, CancellationToken cancellationToken = default);
/// <summary>
/// Sets the storage options asynchronously with the specified action to configure the options.
/// </summary>
/// <param name="options">An action to configure the options.</param>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the result of the operation.</returns>
Task<Result> SetStorageOptions(Action<TOptions> options, CancellationToken cancellationToken = default);
}
/// <summary>
/// Represents a storage interface that includes uploader, downloader, streamer, and storage operations.
/// </summary>
public interface IStorage : IUploader, IDownloader, IStreamer, IStorageOperations, IDisposable
{
/// <summary>
/// Creates a container asynchronously if it does not already exist.
/// </summary>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the result of the operation.</returns>
Task<Result> CreateContainerAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Removes a container asynchronously if it exists.
/// </summary>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the operation.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the result of the operation.</returns>
Task<Result> RemoveContainerAsync(CancellationToken cancellationToken = default);
}
}