Complete StorageManager package - A comprehensive .NET storage abstraction library supporting multiple cloud providers, local storage, encryption, compression, and caching. Includes all components: Core, Services, Providers, Extensions, Configuration, and Utilities.
$ dotnet add package Innovayse.StorageManagerA comprehensive .NET storage management solution with support for multiple storage providers, encryption, compression, and caching. Everything you need in one complete package.
Install the complete StorageManager package:
dotnet add package Innovayse.StorageManager
using StorageManager.Core.Interfaces;
using StorageManager.Services;
using StorageManager.Providers.Local;
// Configure local storage
var options = new LocalStorageDriverOptions
{
RootPath = @"C:\MyStorage",
IsReadOnly = false
};
// Create storage manager
var storageManager = new DefaultStorageManager();
storageManager.RegisterDriver("local", new LocalStorageDriver(options));
await storageManager.SwitchDriverAsync("local");
// Use storage
await storageManager.UploadAsync("test.txt", "Hello World!"u8.ToArray());
var content = await storageManager.GetAsync("test.txt");
var files = await storageManager.ListAsync("/");
using StorageManager.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Add StorageManager with all components
builder.Services.AddStorageManagerMinimal();
// Configure local storage
builder.Services.Configure<LocalStorageDriverOptions>(options =>
{
options.RootPath = @"C:\Storage";
options.IsReadOnly = false;
});
var app = builder.Build();
// Use in endpoints
app.MapPost("/upload", async (IFormFile file, IStorageManager storageManager) =>
{
using var stream = file.OpenReadStream();
var result = await storageManager.PutAsync(file.FileName, stream);
return Results.Ok(new { Path = result.Path, Size = result.Size });
});
app.MapGet("/files", async (IStorageManager storageManager) =>
{
var files = await storageManager.ListAsync("/");
return Results.Ok(files);
});
app.Run();
Innovayse.StorageManager contains all components in one package:
| Component | Description |
|---|---|
| 🏗️ Core | Interfaces, models, enums, and base functionality |
| ⚙️ Services | Storage manager implementation and core services |
| 🔌 Providers | All storage drivers (Local, Cloud, Database, Memory) |
| 🔧 Extensions | ASP.NET Core integration and dependency injection |
| 📋 Configuration | Settings, validation, and configuration models |
| 🛠️ Utilities | Helper classes and utility functions |
// Store encrypted content
await storageManager.PutEncryptedAsync(
"sensitive-data.txt",
contentStream,
"my-secret-key"
);
// Retrieve and decrypt
var decryptedStream = await storageManager.GetDecryptedAsync(
"sensitive-data.txt",
"my-secret-key"
);
// Store compressed content
await storageManager.PutCompressedAsync(
"large-file.json",
contentStream,
compressionLevel: 6
);
// Retrieve and decompress
var decompressedStream = await storageManager.GetDecompressedAsync(
"large-file.json"
);
// Register multiple providers
storageManager.RegisterDriver("local", new LocalStorageDriver(localOptions));
storageManager.RegisterDriver("s3", new S3StorageDriver(s3Options));
storageManager.RegisterDriver("azure", new AzureBlobStorageDriver(azureOptions));
// Switch between providers
await storageManager.SwitchDriverAsync("s3");
await storageManager.UploadAsync("file.txt", content); // Saves to S3
await storageManager.SwitchDriverAsync("azure");
await storageManager.UploadAsync("file.txt", content); // Saves to Azure
// Check storage health
var healthStatus = await storageManager.HealthCheckAsync();
foreach (var (driver, isHealthy) in healthStatus)
{
Console.WriteLine($"{driver}: {(isHealthy ? "Healthy" : "Unhealthy")}");
}
// Get detailed statistics
var stats = await storageManager.GetStatisticsAsync();
Console.WriteLine($"Total files: {stats.TotalFiles}");
Console.WriteLine($"Total size: {stats.TotalSize} bytes");
{
"StorageManager": {
"DefaultDriver": "local",
"EnableCaching": true,
"CacheExpiration": "00:30:00",
"Drivers": {
"local": {
"Type": "Local",
"RootPath": "C:\\Storage",
"IsReadOnly": false
},
"s3": {
"Type": "S3",
"AccessKey": "your-access-key",
"SecretKey": "your-secret-key",
"BucketName": "your-bucket",
"Region": "us-west-2"
},
"azure": {
"Type": "AzureBlob",
"ConnectionString": "your-connection-string",
"ContainerName": "your-container"
}
}
}
}
// Configure from appsettings.json
builder.Services.Configure<StorageManagerConfiguration>(
builder.Configuration.GetSection("StorageManager")
);
// Add StorageManager
builder.Services.AddStorageManagerComplete();
// Or minimal setup
builder.Services.AddStorageManagerMinimal();
✅ Production Ready - Complete implementation with full testing
StorageManager/
├── 📚 docs/ # Complete documentation
├── 💻 src/ # Source code
│ ├── StorageManager/ # 📦 Complete package (this)
│ ├── StorageManager.Core/ # Core interfaces and models
│ ├── StorageManager.Services/# Implementation services
│ ├── StorageManager.Providers/ # Storage drivers
│ ├── StorageManager.Extensions/ # ASP.NET Core integration
│ ├── StorageManager.Configuration/ # Configuration models
│ └── StorageManager.Utilities/ # Helper utilities
├── 📱 examples/ # Usage examples
├── 🧪 tests/ # Unit and integration tests
├── 🚀 deployment/ # Docker configurations
└── 🛠️ tools/ # Development tools
We welcome contributions! Please see our Contributing Guide for:
We thank all contributors who have helped make StorageManager better:
We welcome contributions of all kinds! Here are some ways you can help:
See our Contributing Guide for detailed instructions.
| Operation | Local | S3 | Azure | Memory |
|---|---|---|---|---|
| Upload (1MB) | ~5ms | ~150ms | ~120ms | ~1ms |
| Download (1MB) | ~3ms | ~100ms | ~90ms | ~0.5ms |
| List (1000 files) | ~10ms | ~200ms | ~180ms | ~2ms |
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Edgar Poghosyan and Hakob Vardanyan