SquidStd.Storage
0.8.0
dotnet add package SquidStd.Storage --version 0.8.0
NuGet\Install-Package SquidStd.Storage -Version 0.8.0
<PackageReference Include="SquidStd.Storage" Version="0.8.0" />
<PackageVersion Include="SquidStd.Storage" Version="0.8.0" />
<PackageReference Include="SquidStd.Storage" />
paket add SquidStd.Storage --version 0.8.0
#r "nuget: SquidStd.Storage, 0.8.0"
#:package SquidStd.Storage@0.8.0
#addin nuget:?package=SquidStd.Storage&version=0.8.0
#tool nuget:?package=SquidStd.Storage&version=0.8.0
<p align="center"> <img src="https://raw.githubusercontent.com/tgiachi/squid-std/main/assets/icon.png" alt="SquidStd" width="120" height="120" /> </p>
<h1 align="center">SquidStd.Storage</h1>
<p align="center"> <a href="https://www.nuget.org/packages/SquidStd.Storage/"><img src="https://img.shields.io/nuget/v/SquidStd.Storage.svg" alt="NuGet" /></a> <img src="https://img.shields.io/nuget/dt/SquidStd.Storage.svg" alt="Downloads" /> <a href="https://tgiachi.github.io/squid-std/articles/storage.html"><img src="https://img.shields.io/badge/docs-DocFX-1390A3.svg" alt="docs" /></a> <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license" /> </p>
Local file storage for SquidStd. Provides a filesystem-backed IStorageService (atomic writes,
path-safe keys) and a YAML-backed IObjectStorageService that layers typed objects on top of it —
registered with a single AddFileStorage() call. Storage is opt-in: it is not registered by RegisterCoreServices.
Install
dotnet add package SquidStd.Storage
Features
- One-line registration:
container.AddFileStorage()(fileIStorageService+ YAMLIObjectStorageService). - Atomic saves (temp file + move) and keys constrained to the storage root.
YamlObjectStorageServicedecoratesIStorageService, serializing typed objects to YAML.ListKeysAsync(prefix?)enumerates stored keys (/-separated), excluding in-flight temp files.
Usage
using DryIoc;
using SquidStd.Storage.Abstractions.Data.Config;
using SquidStd.Storage.Abstractions.Interfaces;
using SquidStd.Storage.Extensions;
var container = new Container();
container.AddFileStorage(new StorageConfig { RootDirectory = "data" });
var storage = container.Resolve<IStorageService>();
await storage.SaveAsync("profiles/main.bin", new byte[] { 1, 2, 3 });
Key types
| Type | Purpose |
|---|---|
StorageRegistrationExtensions |
AddFileStorage(...) registration. |
FileStorageService |
Filesystem-backed IStorageService. |
YamlObjectStorageService |
YAML-backed IObjectStorageService over a blob store. |
License
MIT — part of SquidStd.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- DryIoc.dll (>= 5.4.3)
- SquidStd.Core (>= 0.8.0)
- SquidStd.Storage.Abstractions (>= 0.8.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on SquidStd.Storage:
| Package | Downloads |
|---|---|
|
SquidStd.Services.Core
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.