|
Csilk 0.2.1
A lightweight, high-performance C HTTP web framework
|
Request ID middleware implementation. More...

Functions | |
| void | csilk_request_id_middleware (csilk_ctx_t *c) |
| Request ID middleware handler. | |
| void | csilk_health_check_handler (csilk_ctx_t *c) |
| Built-in Health Check handler (Liveness). | |
| void | csilk_ready_check_handler (csilk_ctx_t *c) |
| Built-in Readiness Check handler (Readiness). | |
Request ID middleware implementation.
| void csilk_health_check_handler | ( | csilk_ctx_t * | c | ) |
Built-in Health Check handler (Liveness).
Built-in Health Check handler. Returns a simple JSON response {"status": "up"}.
Provides a simple "shallow" check to verify that the server's event loop is alive and responsive. Returns a JSON response with status 200 OK.
| c | The request context. If NULL the function returns immediately. |
| void csilk_ready_check_handler | ( | csilk_ctx_t * | c | ) |
Built-in Readiness Check handler (Readiness).
Built-in Readiness Check handler. Performs deep health check (MQ, connections) and returns 200 or 503.
Performs a "deep" check of the server's health by inspecting critical subsystems. It checks:
Returns 200 OK if the server is ready to accept more traffic, or 503 Service Unavailable if any check fails.
| c | The request context. If NULL the function returns immediately. |
| void csilk_request_id_middleware | ( | csilk_ctx_t * | c | ) |
Request ID middleware handler.
Request ID middleware. Generates a unique ID for each request and sets X-Request-Id header.
Ensures every request has a unique UUID v4 identifier. If the request context does not already have an ID (c->request_id is empty), a new UUID is generated via _csilk_generate_uuid(). The identifier is then set as the "X-Request-Id" response header and propagated to the thread-local logger state for distributed tracing correlation.
| c | The request context. If NULL the function returns immediately. |