using Salmon.Core; using Salmon.Model.Monitor; using System.Security.Cryptography.X509Certificates; namespace Salmon.Service; public class Configuration { public Uri? Url { get; set; } public int? Period { get; set; } public bool? MonitorHardware { get; set; } = true; public bool? MonitorLocalSoftware { get; set; } = true; public List Watch { get; set; } = new (); } public abstract class WatcherConfiguration { public abstract Task> ForgeElements(); } public class ExecutableInstanceWatcherConfiguration : WatcherConfiguration { public string Path { get; set; } public override async Task> ForgeElements() { List ret = new(); foreach (var el in Software.FromPath(Path)) ret.Add(el); return ret; } } public class HttpPageWatcherConfiguration : WatcherConfiguration { public string Method { get; set; } = "GET"; public string Uri { get; set; } public override async Task> ForgeElements() { throw new NotImplementedException(); } }