VOOZH about

URL: https://www.nuget.org/packages/Aoxe.Extensions.Configuration.StackExchangeRedis/

⇱ NuGet Gallery | Aoxe.Extensions.Configuration.StackExchangeRedis 2025.1.0




Aoxe.Extensions.Configuration.StackExchangeRedis 2025.1.0

dotnet add package Aoxe.Extensions.Configuration.StackExchangeRedis --version 2025.1.0
 
 
NuGet\Install-Package Aoxe.Extensions.Configuration.StackExchangeRedis -Version 2025.1.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aoxe.Extensions.Configuration.StackExchangeRedis" Version="2025.1.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aoxe.Extensions.Configuration.StackExchangeRedis" Version="2025.1.0" />
 
Directory.Packages.props
<PackageReference Include="Aoxe.Extensions.Configuration.StackExchangeRedis" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aoxe.Extensions.Configuration.StackExchangeRedis --version 2025.1.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Aoxe.Extensions.Configuration.StackExchangeRedis, 2025.1.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aoxe.Extensions.Configuration.StackExchangeRedis@2025.1.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aoxe.Extensions.Configuration.StackExchangeRedis&version=2025.1.0
 
Install as a Cake Addin
#tool nuget:?package=Aoxe.Extensions.Configuration.StackExchangeRedis&version=2025.1.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Aoxe.Extensions.Configuration.Redis

English |


Let the redis as a configuration source with reload feature, include several configuration sources and several parsers (Json / Xml / Ini / Toml / Yaml).

1. Why

The Microsoft.Extensions.Configuration provide develops out of box and powerful configuration functions. It supports several formats (Json / Xml / Ini) to covers most usage scenarios. But still has some points I think it can be improved.

1.1. The parser is the core function but hasn't been defined to public, this design affects modularity and reuse

Every configuration is base on its stream version with the same format, like JsonConfigurationProvider / JsonStreamConfigurationProvider and XmlConfigurationProvider / XmlStreamConfigurationProvider etc. In the stream provider it use serializer to parse the structure stream into a Dictionary<string, string?>. But in these offical configuration providers the parser classes or functions were defined to internal or pravite.

1.2. Other serializers

Like Microsoft.Extensions.Configuration.Json was base on System.Text.Json, it is a great package but someone prefer Newtonsoft.Json or other serializers with some reasons, and the Microsoft.Extensions.Configuration.NewtonsoftJson has been set to deprecate from 2020. And then in addition to Json / Xml / Ini, we may now need other configration formats like Toml / Yaml etc.

1.3. More configuration sources

With the microservices and cloud, the Centralized Configuration will be more and more important. Microsoft has provided some Centralized Configuration sources for us, but they are usually based on azure. All the more reason to be cloud neutrality when cloud is so powerful, some projects and services prefer privately deployed key-value stores.

2. What this project does

2.1. Flantteners

For parser, Aoxe.Extensions.Configuration abstracts the concept called Flanttener to parse and flatten the stream into Dictionary<string, string?>. Then now we have the following implementations:

2.1.1. Aoxe.Extensions.Configuration.Flattener.Ini

Base on Microsoft.Extensions.Configuration.Ini and with the same behavior.

2.1.2. Aoxe.Extensions.Configuration.Flattener.IniParser

ini-parser is A .NET, Mono and Unity3d compatible(*) library for reading/writing INI data from IO streams, file streams, and strings written in C#.

Also implements merging operations, both for complete ini files, sections, or even just a subset of the keys contained by the files.

(*) This library is 100% .NET code and does not have any dependencies on Windows API calls in order to be portable.

2.1.3. Aoxe.Extensions.Configuration.Flattener.Json

Base on Microsoft.Extensions.Configuration.Json and with the same behavior.

2.1.4. Aoxe.Extensions.Configuration.Flattener.NewtonsoftJson

Newtonsoft.Json is a popular high-performance JSON framework for .NET. With this implement we can pass JsonSerializerSettings for cumstomize deserialize.

2.1.5. Aoxe.Extensions.Configuration.Flattener.SharpYaml

SharpYaml is a .NET library that provides a YAML parser and serialization engine for .NET objects, compatible with CoreCLR.

2.1.6. Aoxe.Extensions.Configuration.Flattener.Tomlet

Tomlet is a Zero-Dependency, model-based TOML De/Serializer for .NET.

2.1.7. Aoxe.Extensions.Configuration.Flattener.Tomlyn

Tomlyn is a TOML parser, validator and authoring library for .NET Framework and .NET Core.

2.1.8. Aoxe.Extensions.Configuration.Flattener.Xml

Base on Microsoft.Extensions.Configuration.Xml and with the same behavior.

2.1.9. Aoxe.Extensions.Configuration.Flattener.YamlDotNet

YamlDotNet is a .NET library for YAML. YamlDotNet provides low level parsing and emitting of YAML as well as a high level object model similar to XmlDocument. A serialization library is also included that allows to read and write objects from and to YAML streams.

2.2. More Configuration sources

In addition to configuration files, modern services increasingly rely on centralized configuration. For this purpose there are these configuration sources:

2.2.1. Aoxe.Extensions.Configuration

Because the abstractions of Flantten, Aoxe.Extensions.Configuration support difference configuration files, like Json, Xml, Ini, Toml and Yaml.

2.2.2. Aoxe.Extensions.Configuration.Consul

Consul is a service networking solution that provides a full-featured control plane with service discovery, configuration, and segmentation functionality. It is designed to make it easy to manage and secure service-to-service communication across distributed infrastructure.

2.2.3. Aoxe.Extensions.Configuration.Etcd

Etcd is a distributed key-value store that provides a reliable way to store data across a cluster of machines. It is used to store configuration data, metadata, and other critical information that needs to be accessed by distributed systems.

2.2.4. Aoxe.Extensions.Configuration.Redis

Redis (Remote Dictionary Server) is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It supports various data structures such as strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, and geospatial indexes.

3. How to use

Taking Json format configuration as an example, we now have a json content which its key is 'test-json' like below:

{
 "stringKey": "stringValue",
 "numberKey": 123,
 "booleanKey": true,
 "nullKey": null,
 "nestedObject": {
 "nestedStringKey": "nestedStringValue",
 "nestedNumberKey": 456,
 "nestedBooleanKey": false,
 "nestedNullKey": null
 },
 "arrayKey": [
 "arrayStringValue",
 789,
 false,
 null,
 {
 "arrayNestedObjectKey": "arrayNestedObjectValue"
 }
 ]
}

And then can get this package via nuget.

PM> Install-Package Aoxe.Extensions.Configuration.StackExchangeRedis.Json

Now we can use it like this:

var configBuilder = new ConfigurationBuilder().AddRedisJson(
 new RedisClientOptions("localhost:6379"),
 "test-json"
);
var configuration = configBuilder.Build();
var value = configuration["nestedObject:nestedStringKey"]; // the value is "nestedStringValue"

Thank`s for JetBrains for the great support in providing assistance and user-friendly environment for my open source projects.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Aoxe.Extensions.Configuration.StackExchangeRedis:

Package Downloads
Aoxe.Extensions.Configuration.StackExchangeRedis.Json

Let the redis as a configuration source.

Aoxe.Extensions.Configuration.StackExchangeRedis.Xml

Let the redis as a configuration source.

Aoxe.Extensions.Configuration.StackExchangeRedis.YamlDotNet

Let the redis as a configuration source.

Aoxe.Extensions.Configuration.StackExchangeRedis.NewtonsoftJson

Let the redis as a configuration source.

Aoxe.Extensions.Configuration.StackExchangeRedis.Tomlyn

Let the redis as a configuration source.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.1.0 670 11/18/2024
2024.2.4 1,047 10/3/2024
2024.2.2 222 9/30/2024
2024.2.1 205 9/30/2024
2024.2.0 225 9/30/2024
2024.1.5 708 9/9/2024
2024.1.4 199 9/9/2024
2024.1.3 728 9/6/2024
2024.1.2 709 8/23/2024
2024.1.1 752 8/19/2024
2024.1.0 234 8/19/2024