Cimfu.Suave.Healthcheck


Healthcheck

Namespace: Cimfu.Suave

A module providing service healthcheck functions for a Suave application.

Nested types and modules

TypeDescription
Health

Represents the health of a service.

HealthEvaluator

The function signature for a health evaluator: unit -> Async<HealthStatus>. Conversion of a HealthEvaluator to a Healthcheck can be done by using the evaluateToHealthcheck function.

HealthStatus

Represents a health status without any timing context.

HealthSwitch

A switch associated with a healthcheck which can be set to return Healthy when enabled and Unhealthy when disabled.

Healthcheck

The function signature for a healthcheck: unit -> Async<HealthcheckResult>.

HealthcheckResult

The result of running a healthcheck; combines a Health with an optional status message.

ModuleDescription
Checks

A set of core healthchecks.

Internal

Several internal functions that are not commonly used by consumers of this library.

Timing

Timing module. Used to provide values for test duration and time of tests.

Functions and values

Function or valueDescription
DefaultHealthcheckRoot
Signature: string

The default healthcheck root path for handlers whose path isn't specified: /healthcheck.

doHealthcheck hcMap
Signature: hcMap:Map<string,Healthcheck> -> WebPart

Evaluates a specified set of healthchecks and returns a new HttpContext representing the serialized result.

evaluateHealthchecks hcMap
Signature: hcMap:Map<string,Healthcheck> -> Async<AggregateHealthcheckResult>

Asynchronously evaluates a set of healthchecks.

evaluateToHealthcheck he
Signature: he:HealthEvaluator -> Healthcheck

Asynchronously maps a HealthEvaluator and to a HealthcheckResult.

handleHealthcheck hcMap
Signature: hcMap:Map<string,Healthcheck> -> WebPart

Handles healthcheck requests

handleHealthcheckAt (...)
Signature: healthcheckRoot:string -> hcMap:Map<string,Healthcheck> -> WebPart

Handles healthcheck requests at healthcheckRoot

prefixWithHealthcheck hcMap app
Signature: hcMap:Map<string,Healthcheck> -> app:WebPart<HttpContext> -> WebPart<HttpContext>

Attaches a healthcheck endpoint as a prefix to a Suave WebPart handling all requests for paths starting with "/healthcheck".

An app may be fluently pipelined into this function.

prefixWithHealthcheckAt (...)
Signature: healthcheckRoot:string -> hcMap:Map<string,Healthcheck> -> app:WebPart<HttpContext> -> WebPart<HttpContext>

Attaches a healthcheck endpoint as a prefix to a Suave WebPart handling all requests for paths starting with rootPath.

An app may be fluently pipelined into this function.

F# Project
Fork me on GitHub