Lyo.FileMetadataStore
1.0.0
See the version list below for details.
dotnet add package Lyo.FileMetadataStore --version 1.0.0
NuGet\Install-Package Lyo.FileMetadataStore -Version 1.0.0
<PackageReference Include="Lyo.FileMetadataStore" Version="1.0.0" />
<PackageVersion Include="Lyo.FileMetadataStore" Version="1.0.0" />
<PackageReference Include="Lyo.FileMetadataStore" />
paket add Lyo.FileMetadataStore --version 1.0.0
#r "nuget: Lyo.FileMetadataStore, 1.0.0"
#:package Lyo.FileMetadataStore@1.0.0
#addin nuget:?package=Lyo.FileMetadataStore&version=1.0.0
#tool nuget:?package=Lyo.FileMetadataStore&version=1.0.0
Lyo.FileMetadataStore
File identity without bytes. Large systems split:
- Blob storage (
Lyo.FileStorage) — throughput, multipart uploads, scanners, CDN URLs. 2. Metadata OLTP (this abstraction) — dedupe fingerprints, encryption key ids, multipart session pointers, archival flags.
Clients depend on IFileMetadataStore only where they manipulate canonical Guid file identifiers.
Methods
| Operation | Responsibility |
|---|---|
GetMetadataAsync(Guid fileId) |
Hydrates FileStoreResult; FileNotFoundException when row missing or logically deleted (soft delete hides tombstones here). |
SaveMetadataAsync(Guid, FileStoreResult) |
Insert or overwrite row keyed by fileId. Implementations enforce uniqueness on hash/external keys (PostgresFileMetadataStore maps fields into columns). |
DeleteMetadataAsync(Guid) |
Soft-delete (sets DeletedAt, row retained): false if missing or already deleted; GetMetadataAsync / FindByHashAsync omit tombstones. |
PurgeMetadataAsync(Guid) |
Hard-delete the metadata row (or .meta JSON for the local store). Idempotent — returns false when there was no record. Used by Lyo.FileStorage.DeleteFileAsync(..., FileDeletionMode.RemoveObjectAndPurgeMetadata) for retention/governance. |
FindByHashAsync(byte[] hash) |
Duplicate detection shortcut — ignores soft-deleted rows (often combined with Lyo.Hashing). |
FindByKeyIdAndVersionAsync(string keyId, string? keyVersion) |
Key rotation audits — active (non–soft-deleted) metadata only, referencing a KMS/KEK logical key/version pair. |
FileStoreResult exposes optional DeletedAt (UTC) when present in storage; callers treat metadata without it as active. GetMetadataAsync and FindByHashAsync omit
tombstones; admin grids and workbench QueryProject surfaces may include soft-deleted rows and should gate mutating actions on DeletedAt.
Methods — FileAvailability states
FileStoreResult.Availability propagates content gating decisions from the storage pipeline:
| State | Meaning |
|---|---|
Available |
Default; reads / presigned URLs / direct downloads are permitted. |
PendingScan |
Saved but awaiting a malware/policy scan; FileNotAvailableException on read unless AllowReadQuarantinedForAdmin is set. |
PendingDirectUpload |
Direct-upload BeginDirectUploadAsync has issued a PUT URL but CompleteDirectUploadAsync has not finalized. |
Quarantined |
A scan flagged the content. Admin-only read may be allowed by storage policy. |
Rejected |
A scan or policy hard-rejected the content; reads always fail. |
Methods — DekMigrationResult
Returned by MigrateDeksAsync / RotateDeksAsync in Lyo.FileStorage. Records per-file outcomes including Updated, Skipped, and Failed counts plus the failure list, so operators can re-run a key rotation against only the failing subset.
Local file metadata store DI
Lyo.FileMetadataStore.LocalFileMetadataStore is a JSON-backed implementation for single-host scenarios. Registered through Extensions:
| Extension | Notes |
|---|---|
services.AddLocalFileMetadataStore(string rootDirectoryPath) |
Direct path. |
services.AddLocalFileMetadataStore(Func<IServiceProvider, string> resolveRoot) |
Lazy path resolution (useful for tests or DI-derived paths). |
services.AddLocalFileMetadataStoreFromConfiguration(IConfiguration, sectionName = LocalFileMetadataStoreOptions.SectionName) |
Bind LocalFileMetadataStoreOptions (RootDirectoryPath). |
services.AddLocalFileMetadataStoreKeyed(string keyName, string rootDirectoryPath) |
Keyed registration with both LocalFileMetadataStore and IFileMetadataStore exposed. |
services.AddLocalFileMetadataStoreKeyed(string keyName) |
Returns a LocalFileMetadataStoreBuilder for fluent options/section-based wiring (ConfigureLocalFileStore(...), Build()). |
Architectural guidance
Treat metadata writes as eventually consistent relative to blob existence unless you orchestrate Saga-style compensations (Save blob → Save metadata; if latter fails delete
blob).
For multi-tenant systems, prepend tenant key to logical file ids outside interface or augment models with partitioning columns inside concrete stores.
Concrete implementations:
FileMetadataStore.Postgres(production OLTP schema — includes optional audit/multipart/staged-upload adjunct stores).FileMetadataStore.Sqlite(embedded / local-dev SQLite — same adjunct services as Postgres, includingstaged_file_upload).
See also
Lyo.FileStorageconsumes metadata for duplication + encryption bridging.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Common— (direct, lyo)Lyo.Compression— (direct, lyo)Lyo.Encryption— (direct, lyo)Lyo.Hashing— (direct, lyo)Microsoft.Extensions.Configuration.Binder10.0.5— (direct, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5— (direct, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5— (direct, microsoft)Microsoft.Extensions.Options.DataAnnotations10.0.5— (direct, microsoft)System.Text.Json10.0.5— (direct, microsoft, netstandard2.0)Lyo.Exceptions— (transitive, lyo)Lyo.KeyStore— (transitive, lyo)Lyo.Metrics— (transitive, lyo)Lyo.Result— (transitive, lyo)Lyo.Streams— (transitive, lyo)BouncyCastle.Cryptography2.6.2— (transitive, third-party, netstandard2.0)EasyCompressor2.1.0— (transitive, third-party)Konscious.Security.Cryptography.Argon21.3.1— (transitive, third-party)Microsoft.Bcl.AsyncInterfaces10.0.5— (transitive, microsoft, netstandard2.0)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5— (transitive, microsoft)System.Buffers4.6.1— (transitive, microsoft, netstandard2.0)System.IO.Hashing10.0.5— (transitive, microsoft, net10.0)System.Memory4.6.3— (transitive, microsoft, netstandard2.0)System.Threading.Tasks.Extensions4.6.3— (transitive, microsoft, netstandard2.0)
| 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 is compatible. 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 | 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
- Lyo.Common (>= 1.0.0)
- Lyo.Compression (>= 1.0.0)
- Lyo.Encryption (>= 1.0.0)
- Lyo.Hashing (>= 1.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.5)
- System.Text.Json (>= 10.0.5)
-
net10.0
- Lyo.Common (>= 1.0.0)
- Lyo.Compression (>= 1.0.0)
- Lyo.Encryption (>= 1.0.0)
- Lyo.Hashing (>= 1.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options.DataAnnotations (>= 10.0.5)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on Lyo.FileMetadataStore:
| Package | Downloads |
|---|---|
|
Lyo.FileStorage
File storage service interface and base implementation for file operations. |
|
|
Lyo.FileStorage.Web.Components
Reusable Blazor components for file storage workbenches: upload/save, DEK/KEK migration and rotation, metadata/expected-storage browser grids, keystore tools. |
|
|
Lyo.FileMetadataStore.Postgres
PostgreSQL implementation of the Lyo FileMetadataStore service using Entity Framework Core. |
|
|
Lyo.FileStorage.S3
S3-compatible file storage (AWS S3, Backblaze B2, MinIO, etc.) for the Lyo FileStorage service using AWSSDK.S3. |
|
|
Lyo.FileStorage.AzureBlob
Azure Blob Storage-backed implementation of the Lyo.FileStorage IFileStorageService (package name uses the Blob abstraction; implementation uses Azure.Storage.Blobs). |
GitHub repositories
This package is not used by any popular GitHub repositories.