2.1 Configuration POCOs (Mqtt, Storage, UrlFetch, ApiKey)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 14:15:34 +02:00
parent 79039623e8
commit 20e6aafaa1
6 changed files with 112 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations;
namespace FrameProcessor.Configuration;
/// <summary>
/// Bound from the <c>Mqtt</c> section of <c>appsettings.json</c>. See SPEC.md §6.1.
/// </summary>
public sealed class MqttOptions
{
public const string SectionName = "Mqtt";
[Required(AllowEmptyStrings = false)]
public string Host { get; set; } = string.Empty;
[Range(1, 65535)]
public int Port { get; set; } = 1883;
[Required(AllowEmptyStrings = false)]
public string ClientId { get; set; } = string.Empty;
public string? Username { get; set; }
public string? Password { get; set; }
public bool UseTls { get; set; }
[Required(AllowEmptyStrings = false)]
public string BaseTopic { get; set; } = "frames";
[Range(0, 2)]
public int PublishQos { get; set; } = 1;
[MinLength(1)]
public int[] RetryBackoffSeconds { get; set; } = Array.Empty<int>();
}