Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
71 lines
2.2 KiB
C#
71 lines
2.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace StellaOps.Scheduler.WebService.Options;
|
|
|
|
/// <summary>
|
|
/// Scheduler host configuration defaults consumed at startup for cross-cutting concerns
|
|
/// such as plug-in discovery.
|
|
/// </summary>
|
|
public sealed class SchedulerOptions
|
|
{
|
|
public PluginOptions Plugins { get; set; } = new();
|
|
|
|
public void Validate()
|
|
{
|
|
Plugins.Validate();
|
|
}
|
|
|
|
public sealed class PluginOptions
|
|
{
|
|
/// <summary>
|
|
/// Base directory resolving relative plug-in paths. Defaults to solution root.
|
|
/// </summary>
|
|
public string? BaseDirectory { get; set; }
|
|
|
|
/// <summary>
|
|
/// Directory containing plug-in binaries. Defaults to <c>plugins/scheduler</c>.
|
|
/// </summary>
|
|
public string? Directory { get; set; }
|
|
|
|
/// <summary>
|
|
/// Controls whether sub-directories are scanned for plug-ins.
|
|
/// </summary>
|
|
public bool RecursiveSearch { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Ensures the plug-in directory exists on startup.
|
|
/// </summary>
|
|
public bool EnsureDirectoryExists { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Explicit plug-in discovery patterns (supports globbing).
|
|
/// </summary>
|
|
public IList<string> SearchPatterns { get; } = new List<string>();
|
|
|
|
/// <summary>
|
|
/// Optional ordered plug-in assembly names (without extension).
|
|
/// </summary>
|
|
public IList<string> OrderedPlugins { get; } = new List<string>();
|
|
|
|
public void Validate()
|
|
{
|
|
foreach (var pattern in SearchPatterns)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(pattern))
|
|
{
|
|
throw new InvalidOperationException("Scheduler plug-in search patterns cannot contain null or whitespace entries.");
|
|
}
|
|
}
|
|
|
|
foreach (var assemblyName in OrderedPlugins)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(assemblyName))
|
|
{
|
|
throw new InvalidOperationException("Scheduler ordered plug-in entries cannot contain null or whitespace values.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|