SquidStd.Core
0.23.0
dotnet add package SquidStd.Core --version 0.23.0
NuGet\Install-Package SquidStd.Core -Version 0.23.0
<PackageReference Include="SquidStd.Core" Version="0.23.0" />
<PackageVersion Include="SquidStd.Core" Version="0.23.0" />
<PackageReference Include="SquidStd.Core" />
paket add SquidStd.Core --version 0.23.0
#r "nuget: SquidStd.Core, 0.23.0"
#:package SquidStd.Core@0.23.0
#addin nuget:?package=SquidStd.Core&version=0.23.0
#tool nuget:?package=SquidStd.Core&version=0.23.0
<h1 align="center">SquidStd.Core</h1>
Foundational contracts and utilities for the SquidStd stack. It defines the core service interfaces
(configuration, event bus, jobs, timing, metrics, storage) and ships dependency-free helpers - YAML/JSON
serialization, a Serilog event sink, string/environment/directory extensions, pooled buffers
(STArrayPool, ValueStringBuilder), and ordinal/case-insensitive string helpers - that the other
SquidStd packages build on.
Install
dotnet add package SquidStd.Core
Usage
using SquidStd.Core.Extensions.Env;
using SquidStd.Core.Yaml;
// Expand "$VAR" tokens against the environment (unknown vars are left untouched).
var path = "$HOME/squidstd/data".ReplaceEnv();
// Serialize / deserialize YAML.
var yaml = YamlUtils.Serialize(new { name = "squid", port = 9000 });
using SquidStd.Core.Files;
using SquidStd.Core.Data.Files;
using SquidStd.Core.Pool;
// Watch several directories (each with its own glob) and react via the event bus.
// Via DI: container.RegisterFileWatcherService(); then resolve IFileWatcherService.
var watcher = new FileWatcherService(eventBus);
watcher.Watch("data/scripts", "*.lua");
watcher.Watch("data/templates", "*.json");
eventBus.Subscribe<FileChangedEvent>((change, _) =>
{
Console.WriteLine($"{change.Kind}: {change.FullPath}");
return Task.CompletedTask;
});
// Reuse short-lived buffers instead of allocating per call.
using var pool = new ObjectPool<StringBuilder>(() => new StringBuilder(), onReturn: sb => sb.Clear());
var builder = pool.Get();
// ... use builder ...
pool.Return(builder);
using SquidStd.Core.Extensions.Strings;
"hello world".StartsWithOrdinal("hello"); // true, no culture lookup
"Hello".InsensitiveEquals("hELLO"); // true
Key types
| Type | Purpose |
|---|---|
IConfigEntry |
A registrable YAML configuration section. |
IConfigManagerService |
Loads YAML config and exposes typed sections. |
IEventBus |
Publish/subscribe in-process event bus. |
IJobSystem |
Background job scheduling/execution. |
ITimerService |
Timer-wheel based scheduling. |
IMetricProvider |
Source of metric samples for collection. |
IStorageService |
File/object storage abstraction. |
IFileWatcherService |
Recursive, debounced file watcher publishing to the event bus. |
ObjectPool<T> |
Thread-safe, non-blocking object pool. |
ICommandDispatcher<TContext> |
Typed protocol command dispatch with context. |
Related
- Tutorial: Events, jobs & scheduling
- Concept: Buffers and pooled strings
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)
- Serilog (>= 4.3.1)
- YamlDotNet (>= 18.1.0)
NuGet packages (23)
Showing the top 5 NuGet packages that depend on SquidStd.Core:
| Package | Downloads |
|---|---|
|
SquidStd.Abstractions
Package Description |
|
|
SquidStd.Storage.Abstractions
Package Description |
|
|
SquidStd.Messaging.Abstractions
Package Description |
|
|
SquidStd.Services.Core
Package Description |
|
|
SquidStd.Storage
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.23.0 | 67 | 7/4/2026 |
| 0.22.0 | 66 | 7/4/2026 |
| 0.21.0 | 116 | 7/3/2026 |
| 0.20.0 | 112 | 7/3/2026 |
| 0.19.0 | 114 | 7/3/2026 |
| 0.18.0 | 125 | 7/3/2026 |
| 0.17.0 | 123 | 7/3/2026 |
| 0.16.0 | 129 | 7/3/2026 |
| 0.15.0 | 226 | 7/2/2026 |
| 0.14.1 | 253 | 7/2/2026 |
| 0.14.0 | 245 | 7/2/2026 |
| 0.13.0 | 253 | 7/2/2026 |
| 0.12.0 | 251 | 7/2/2026 |
| 0.11.0 | 260 | 7/2/2026 |
| 0.10.0 | 370 | 6/30/2026 |
| 0.9.0 | 435 | 6/29/2026 |
| 0.8.0 | 435 | 6/28/2026 |
| 0.7.0 | 427 | 6/26/2026 |
| 0.6.0 | 388 | 6/25/2026 |
| 0.5.1 | 357 | 6/25/2026 |