FlowStorage 1.5.0
dotnet add package FlowStorage --version 1.5.0
NuGet\Install-Package FlowStorage -Version 1.5.0
<PackageReference Include="FlowStorage" Version="1.5.0" />
<PackageVersion Include="FlowStorage" Version="1.5.0" />
<PackageReference Include="FlowStorage" />
paket add FlowStorage --version 1.5.0
#r "nuget: FlowStorage, 1.5.0"
#:package FlowStorage@1.5.0
#addin nuget:?package=FlowStorage&version=1.5.0
#tool nuget:?package=FlowStorage&version=1.5.0
FlowStorage
FlowStorage is free, but powered by your donations
FlowStorage is a library developed in .NET 8 that provides an abstraction for managing data storage. The library supports both local storage (file system) and Azure Blob Storage, offering a flexible and scalable solution for distributed applications.
Supported platforms (adding more soon)
- In Memory Storage (Just for test purpose, produces high memory fragmentation)
- Local File System
- Azure Blob Storage
Requirements
- .NET 8 or higher
Installation
The library is available on NuGet.org. To install it, simply add the package to your project using the following command:
In CLI:
dotnet add package FlowStorage
Or, if you prefer to use the NuGet Package Manager in Visual Studio, search for "FlowStorage" and select the latest version available.
Configuration
Use appsettings.json or environment variables to configure the storage.
FlowStorage:type or environment variable FLOWSTORAGE_TYPE
Defines the type of storage to use. Possible values:LocalStorageAzureBlobStorageInMemoryStorage
FlowStorage:connectionString or environment variable FLOWSTORAGE_CONNECTION_STRING
- For LocalStorage: Base path for files.
- For AzureBlobStorage: Azure Storage connection string
- For InMemoryStorage: ignored
Example of appsettings.json:
{
"FlowStorage": {
"type": "AzureBlobStorage",
"connectionString": "AccountName={your_account_name};AccountKey={your_account_key};EndpointSuffix={your_endpoint_suffix}"
}
}
Quick start
DI configuration
To register the library in the dependency container, use the AddFlowStorage extension method.
builder.Services.AddFlowStorage(builder.Configuration);
Example of use
public class MyStorageService
{
private readonly IFlowStorage _flowStorage;
public MyStorageService(IFlowStorage flowStorage)
{
_flowStorage = flowStorage;
}
public async Task UploadAndDownloadFile(string container, string fileName, string content)
{
await _flowStorage.CreateContainerIfNotExistsAsync(container);
await _flowStorage.UploadFileAsync(container, fileName, content);
var downloadedContent = await _flowStorage.ReadFileAsync(container, fileName);
Console.WriteLine($"Downloaded content: {downloadedContent}");
}
}
Contributions
Contributions are welcome. Please follow the repository's contribution guidelines and ensure all tests pass before submitting a pull request.
License
Thank you for using FlowStorage! If you have any questions or suggestions, please feel free to open an issue or contact me.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Azure.Storage.Blobs (>= 12.24.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.3)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.3)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.3)
- Newtonsoft.Json (>= 13.0.3)
- System.IO.Abstractions (>= 22.0.12)
- System.IO.Abstractions.TestingHelpers (>= 22.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.