nuget reorganization
This commit is contained in:
@@ -4,6 +4,12 @@ namespace StellaOps.Signals.Options;
|
||||
|
||||
public sealed class SignalsAirGapOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Optional override for the reachability fact update event topic when running in air-gap mode.
|
||||
/// If not set, defaults to <c>signals.fact.updated</c>.
|
||||
/// </summary>
|
||||
public string? EventTopic { get; set; }
|
||||
|
||||
public SignalsSealedModeOptions SealedMode { get; } = new();
|
||||
|
||||
public void Validate()
|
||||
|
||||
29
src/Signals/StellaOps.Signals/Options/SignalsCacheOptions.cs
Normal file
29
src/Signals/StellaOps.Signals/Options/SignalsCacheOptions.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace StellaOps.Signals.Options;
|
||||
|
||||
public sealed class SignalsCacheOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Redis connection string (e.g., "localhost:6379").
|
||||
/// </summary>
|
||||
public string ConnectionString { get; set; } = "localhost:6379";
|
||||
|
||||
/// <summary>
|
||||
/// Default time-to-live for cached reachability facts.
|
||||
/// </summary>
|
||||
public int DefaultTtlSeconds { get; set; } = 600;
|
||||
|
||||
public void Validate()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ConnectionString))
|
||||
{
|
||||
throw new ArgumentException("Cache connection string is required.", nameof(ConnectionString));
|
||||
}
|
||||
|
||||
if (DefaultTtlSeconds <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(DefaultTtlSeconds), "Default TTL must be greater than zero.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,11 @@ public sealed class SignalsOptions
|
||||
/// Reachability scoring configuration.
|
||||
/// </summary>
|
||||
public SignalsScoringOptions Scoring { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Cache configuration.
|
||||
/// </summary>
|
||||
public SignalsCacheOptions Cache { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Validates configured options.
|
||||
@@ -45,5 +50,6 @@ public sealed class SignalsOptions
|
||||
Storage.Validate();
|
||||
AirGap.Validate();
|
||||
Scoring.Validate();
|
||||
Cache.Validate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user