Skip to content

Small helper package for Healthcheck.io

License

Notifications You must be signed in to change notification settings

FizzBuzz791/NHealthCheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NHealthCheck

CI/CD Coverage Status

.NET implementation of the APIs available at Healthchecks.io

Installation

CLI

dotnet add package NHealthCheck

NuGet

Search for NHealthCheck in your package manager of choice.

Usage

This package is built with dependency injection in mind. It's recommended to register it first (Native):

builder.Services.AddHttpClient<IHealthCheckService, HealthCheckService>();

or (Autofac):

var services = new ServiceCollection();
services.AddHttpClient<IHealthCheckService, HealthCheckService>();
builder.Populate(services);

The simplest use is to call the success method when your job finishes:

public class MyJob
{
    private IHeathCheckService HealthCheckService { get; }

    public MyJob(IHealthCheckService healthCheckService)
    {
        HealthCheckService = healthCheckService;
    } 

    public Task DoWork()
    {
        ...
        
        await HealthCheckService.SuccessAsync(new Guid(config.HealthCheckGuid));
    }
}

About

Small helper package for Healthcheck.io

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages