Files
Cleanuparr/code/Infrastructure/Health/IHealthCheckService.cs
Flaminel f2027f77a9 #12
2025-05-16 19:16:32 +03:00

39 lines
1.3 KiB
C#

namespace Infrastructure.Health;
/// <summary>
/// Service for checking the health of download clients
/// </summary>
public interface IHealthCheckService
{
/// <summary>
/// Occurs when a client's health status changes
/// </summary>
event EventHandler<ClientHealthChangedEventArgs> ClientHealthChanged;
/// <summary>
/// Checks the health of a specific client
/// </summary>
/// <param name="clientId">The client ID to check</param>
/// <returns>The health status of the client</returns>
Task<HealthStatus> CheckClientHealthAsync(string clientId);
/// <summary>
/// Checks the health of all enabled clients
/// </summary>
/// <returns>A dictionary of client IDs to health statuses</returns>
Task<IDictionary<string, HealthStatus>> CheckAllClientsHealthAsync();
/// <summary>
/// Gets the current health status of a client
/// </summary>
/// <param name="clientId">The client ID</param>
/// <returns>The current health status, or null if the client hasn't been checked</returns>
HealthStatus? GetClientHealth(string clientId);
/// <summary>
/// Gets the current health status of all clients that have been checked
/// </summary>
/// <returns>A dictionary of client IDs to health statuses</returns>
IDictionary<string, HealthStatus> GetAllClientHealth();
}