#include #include /* The state of a healthcheck. */ enum sk_health_state { /* The check is in an unknown state, probably due to an internal error. */ SK_HEALTH_STATE_UNKNOWN = 0, /* The check is healthy. */ SK_HEALTH_STATE_OK = 1, /* The check is healthy but will soon reach unhealthy level; preventive * action should be taken. */ SK_HEALTH_STATE_WARN = 2, /* The check is unhealthy; action needs to be taken immediately. */ SK_HEALTH_STATE_CRITICAL = 3, }; /* Healthcheck interface. */ typedef enum sk_health_state (*sk_healthcheck_cb_t)( const void* opaque, sk_buf_t* err_msg); enum { SK_HEALTHCHECK_ENABLED = 1, }; typedef struct sk_healtcheck { /* The name of the healthcheck. */ const char* name; /* A brief description of the healthcheck. */ const char* description; uint64_t flags; /* User provided callback that implements the healthcheck. */ sk_healthcheck_cb_t callback; /* User provided data given to the callback. */ void* opaque; } sk_healthcheck_t;