Neuro.Service.ObjectStorage
1.0.0
dotnet add package Neuro.Service.ObjectStorage --version 1.0.0
NuGet\Install-Package Neuro.Service.ObjectStorage -Version 1.0.0
<PackageReference Include="Neuro.Service.ObjectStorage" Version="1.0.0" />
<PackageVersion Include="Neuro.Service.ObjectStorage" Version="1.0.0" />
<PackageReference Include="Neuro.Service.ObjectStorage" />
paket add Neuro.Service.ObjectStorage --version 1.0.0
#r "nuget: Neuro.Service.ObjectStorage, 1.0.0"
#:package Neuro.Service.ObjectStorage@1.0.0
#addin nuget:?package=Neuro.Service.ObjectStorage&version=1.0.0
#tool nuget:?package=Neuro.Service.ObjectStorage&version=1.0.0
Neuro.Service.ObjectStorage
Neuro.Service.ObjectStorage defines the contract surface for provider-agnostic object storage in Neuron. It does not contain a concrete storage provider. Instead, it standardizes how application code creates a scoped storage service, writes and reads objects, lists keys, and discovers optional capabilities such as conditional writes or range reads.
This package is intended to make provider implementations behave consistently at the API boundary. The repository also includes a reusable contract test project that provider-specific packages can run against.
What This Package Covers
IObjectStorageServiceProvidercreates scopedIObjectStorageServiceinstances.ObjectContainerSpecifierselects the backing container and optional logical root prefix.IObjectStorageServiceprovides object CRUD and listing operations within that scope.IObjectexposes provider-returned metadata for a stored object.- Optional interfaces add conditional operations, copy operations, range reads, and container access management.
What This Package Does Not Define
- A concrete storage implementation.
- A MIME-type whitelist or file-extension policy.
- An HTTP controller or router error contract.
- How your host application resolves a provider instance from module parameters or dependency injection.
Basic Usage
IObjectStorageServiceProvider Provider = ResolveProviderSomehow();
ObjectContainerSpecifier Scope = new ObjectContainerSpecifier(
"public-assets",
"tenant-a/uploads");
IObjectStorageService Storage = await Provider.CreateStorageServiceAsync(
Scope,
CancellationToken.None);
await using MemoryStream Data = new MemoryStream(ImageBytes);
IObject StoredObject = await Storage.PutObjectAsync(
"images/logo.png",
Data,
new ObjectWriteOptions(
Overwrite: false,
ContentType: "image/png"),
CancellationToken.None);
string Key = StoredObject.Key;
string? PublicUrl = StoredObject.PublicUrl;
Behavioral Contract
Scoped keys and root prefixes
- Object keys passed to
IObjectStorageServiceare always relative to the scoped service. ObjectContainerSpecifier.RootPrefixis prepended by the provider when addressing the backing store.- Returned object keys remain relative to the scoped service. Callers should not expect the backing prefix to be echoed back.
ObjectKeyprovides normalization helpers for keys, prefixes, and root prefixes.
Write behavior
PutObjectAsynccreates a new object when the key does not already exist.ObjectWriteOptions.Overwrite = trueallows an existing object to be replaced.ObjectWriteOptions.Overwrite = falserequires providers to fail duplicate writes withObjectAlreadyExistsException.ContentType,ContentEncoding, andMetadataare storage metadata. This package does not enforce or validate a MIME whitelist.- A provider or calling application may still reject unsupported values and surface an
ObjectStorageExceptionor a more specific provider-mapped exception.
Public URL behavior
IObject.PublicUrlis optional and nullable by design.- A non-null value means the provider could determine a publicly reachable URL for the stored object in the current container configuration.
- Callers must not assume
PublicUrlis populated for every provider, every container, or every object. - If public accessibility matters to your application, verify container access behavior separately through provider configuration and optional container-access APIs.
Delete and list behavior
DeleteObjectAsyncis idempotent. Deleting a missing object succeeds without error.ListObjectsAsyncreturns keys relative to the current scope.ObjectListOptions.ContinuationTokenis opaque and should only be reused with the same listing semantics.
Exception Model
Providers are expected to map common failure modes into the package exception types:
InvalidObjectKeyException: the supplied object key or prefix violates the contract.InvalidObjectStorageScopeException: the requested container scope is invalid.ObjectAlreadyExistsException: a write or copy would replace an object when overwrite is not allowed.ObjectPreconditionFailedException: conditional request requirements were not satisfied.ObjectStorageAccessException: the caller is not permitted to perform the requested operation.ObjectStorageException: a general provider failure that does not fit a more specific contract exception.
Optional Capabilities
Providers may implement additional interfaces beyond IObjectStorageService:
IConditionalObjectOperationsfor ETag- or version-based conditional writes and deletes.IObjectCopyOperationsfor server-side copies within a scoped container.IObjectRangeReadOperationsfor byte-range downloads.IObjectAccessLinkOperationsfor time-limited links to private objects.IContainerAccessManagementfor reading or changing container public-access settings.IObjectStorageCapabilityProviderfor capability discovery without trial-and-error casting.
Optional operations can be obtained without explicit casts:
if (Storage.TryGetAccessLinkOperations(out IObjectAccessLinkOperations? AccessLinks))
{
ObjectAccessLink Link = await AccessLinks.CreateAccessLinkAsync(
"private/document.pdf",
new ObjectAccessLinkOptions(TimeSpan.FromMinutes(15), ObjectAccessPermissions.Read),
CancellationToken.None);
}
IObjectAccessLinkOperations RequiredAccessLinks = Storage.GetRequiredAccessLinkOperations();
Contract Tests
The repository includes Neuro.Service.ObjectStorage.Test, an MSTest-based contract suite for provider implementations. It verifies the expected semantics for duplicate writes, delete idempotency, root-prefix scoping, paging, conditional operations, and exception mapping.
Use that project when building a concrete provider to keep behavior aligned with the abstractions in this package.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | 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.1
- Waher.IoTGateway (>= 3.10.0)
- Waher.Runtime.Inventory (>= 1.4.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 113 | 8/3/2026 |
Provider-agnostic object storage abstractions and service contracts for Neuron.