Centeva.ObjectStorage
3.1.0
Prefix Reserved
See the version list below for details.
dotnet add package Centeva.ObjectStorage --version 3.1.0
NuGet\Install-Package Centeva.ObjectStorage -Version 3.1.0
<PackageReference Include="Centeva.ObjectStorage" Version="3.1.0" />
paket add Centeva.ObjectStorage --version 3.1.0
#r "nuget: Centeva.ObjectStorage, 3.1.0"
// Install Centeva.ObjectStorage as a Cake Addin #addin nuget:?package=Centeva.ObjectStorage&version=3.1.0 // Install Centeva.ObjectStorage as a Cake Tool #tool nuget:?package=Centeva.ObjectStorage&version=3.1.0
Centeva Object Storage Library
Centeva.ObjectStorage is a .NET 6+ / .NET Standard library that provides a generic interface to local or cloud-hosted object ("blob") storage providers.
Supported providers are:
- Amazon AWS S3 (and anything compatible with its API such as MinIO
- Google Cloud Storage
- Azure Blob Storage
- Local disk
Built With
Getting Started
Import the Centeva.ObjectStorage
package to your projects where needed, along
with the desired provider sub-packages:
Centeva.ObjectStorage.GCP
Centeva.ObjectStorage.AWS
Centeva.ObjectStorage.Azure.Blob
Create an instance of StorageFactory
and register the providers you require,
then build an instance of IObjectStorage
using a connection string:
var factory = new StorageFactory()
.UseAwsS3Storage()
.UseAzureBlobStorage()
.UseGoogleCloudStorage();
var storage = factory.GetConnection("provider://key1=value1;key2=value2");
In modern .NET applications, you will likely do this as part of service registration in Program.cs, obtaining the connection string from configuration.
In some cases you may prefer to instantiate storage providers directly rather than using connection strings. Each provider's constructor allows the needed parameters to be provided.
Examples
// Local Disk
var storageFromConnectionString = factory.GetConnection("disk://path=C:\\temp\\files");
var storageFromConstructor = new DiskObjectStorage("C:\\temp\\files");
// AWS S3
var storageFromConnectionString = factory.GetConnection("aws.s3://bucket=myfiles;accessKey=mykey;secretKey=secret");
var storageFromConstructor = new AwsS3ObjectStorage("myfiles", "regionName", "endpointUrl", "accessKey", "secret");
// Azure Blob Storage
var storageFromConnectionString = factory.GetConnection("azure.blob://container=myfiles;accountName=myaccount;accountKey=myAccountKey");
var storageFromConstructor = new AzureBlobObjectStorage("accountName", "accountKey", "containerName");
// Google Cloud Storage
var storageFromConnectionString = factory.GetConnection("google.storage://bucket=myfiles;credentialsFilePath=/path/to/creds.json");
var storageFromConnectionString2 = factory.GetConnection("google.storage://bucket=myfiles;credentials=base64EncodedCredentialsJson");
var storageFromConstructor = GoogleObjectStorage.CreateFromCredentialsFile("bucketName", "/path/to/creds.json");
var storageFromConstructor2 = GoogleObjectStorage.CreateFromCredentialsJson("bucketName", "credentialsJsonString");
// MinIO (using AWS S3 provider)
var storageFromConnectionString = factory.GetConnection("aws.s3://endpoint=http://localhost:9000;region=us-east-1;bucket=myfiles;accessKey=myAccount;secretKey=myPassword");
var storageFromConstructor = new AwsS3ObjectStorage("myfiles", "us-east-1", "http://localhost:9000", "myAccount", "myPassword");
TODO: Write API documentation
Contributing
Please use a Pull Request to suggest changes to this library. As this is a shared library, strict semantic versioning rules should be followed to avoid unexpected breaking changes.
Running Tests
From Windows, use the dotnet test
command, or your Visual Studio Test
Explorer.
Deployment
This library is versioned by GitVersion. Create a Git tag for an official release (e.g., "v1.0.0"). Version numbers can be incremented via commit message using the GitVersion approaches.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Centeva.ObjectStorage:
Package | Downloads |
---|---|
Centeva.ObjectStorage.GCP
Google Cloud Storage provider for Centeva.ObjectStorage |
|
Centeva.ObjectStorage.AWS
AWS S3 compatible storage provider for Centeva.ObjectStorage |
|
Centeva.ObjectStorage.Azure.Blob
Azure Storage provider for Centeva.ObjectStorage |
|
Centeva.ObjectStorage.S3
AWS S3 compatible storage provider for Centeva.ObjectStorage |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
5.0.0-tags-v5-0-0-pre-1.1 | 39 | 11/15/2024 |
4.0.0 | 194 | 10/21/2024 |
3.1.0 | 166 | 10/9/2024 |
3.0.0 | 174 | 9/26/2024 |
3.0.0-tags-v3-0-0-pre-4.1 | 43 | 9/26/2024 |
3.0.0-tags-v3-0-0-pre-3.1 | 50 | 9/26/2024 |
3.0.0-tags-v3-0-0-pre-2.1 | 48 | 9/26/2024 |
3.0.0-tags-v3-0-0-pre-1.1 | 49 | 9/26/2024 |
2.0.1 | 337 | 1/4/2024 |
2.0.0 | 225 | 12/28/2023 |
2.0.0-pre.3 | 89 | 12/20/2023 |
2.0.0-pre.2 | 69 | 12/19/2023 |
2.0.0-pre.1 | 83 | 12/18/2023 |
1.1.0 | 276 | 10/30/2023 |
1.0.0 | 197 | 10/30/2023 |