Liking cljdoc? Tell your friends :D

wagoe.platform.shell.interfaces.http.common

Common HTTP utilities: error responses in the one error shape (wagoe.platform.core.http.errors) and health checks.

The pure transformations are in wagoe.platform.core.http.problem-details.

Common HTTP utilities: error responses in the one error shape
(`wagoe.platform.core.http.errors`) and health checks.

The pure transformations are in wagoe.platform.core.http.problem-details.
raw docstring

create-method-not-allowed-handlerclj

(create-method-not-allowed-handler allowed-methods)

Create a standardized 405 Method Not Allowed handler.

Args: allowed-methods: Collection of allowed HTTP methods

Returns: Ring handler function for 405 responses

Create a standardized 405 Method Not Allowed handler.

Args:
  allowed-methods: Collection of allowed HTTP methods

Returns:
  Ring handler function for 405 responses
sourceraw docstring

create-not-found-handlerclj

(create-not-found-handler)

Create a standardized 404 Not Found handler.

Returns: Ring handler function for 404 responses

Create a standardized 404 Not Found handler.

Returns:
  Ring handler function for 404 responses
sourceraw docstring

default-error-mappingsclj

Default mapping of exception types to HTTP status codes and titles.

Re-exported from core for backward compatibility.

Default mapping of exception types to HTTP status codes and titles.

Re-exported from core for backward compatibility.
sourceraw docstring

exception->problemclj

(exception->problem ex correlation-id uri)
(exception->problem ex correlation-id uri error-mappings)

Convert exception to an error response in the one error shape.

Args: ex: Exception to convert correlation-id: Request correlation ID uri: Request URI error-mappings: Optional custom error type mappings (overrides defaults)

Returns: Ring response map

Convert exception to an error response in the one error shape.

Args:
  ex: Exception to convert
  correlation-id: Request correlation ID
  uri: Request URI
  error-mappings: Optional custom error type mappings (overrides defaults)

Returns:
  Ring response map
sourceraw docstring

health-check-handlerclj

(health-check-handler service-name)
(health-check-handler service-name version)
(health-check-handler service-name version additional-checks)

Create a generic health check handler.

Args: service-name: Name of the service version: Service version (optional) additional-checks: Optional function that returns additional health data

Returns: Ring handler function for health checks

Create a generic health check handler.

Args:
  service-name: Name of the service
  version: Service version (optional)
  additional-checks: Optional function that returns additional health data

Returns:
  Ring handler function for health checks
sourceraw docstring

readiness-handlerclj

(readiness-handler db-context cache)

Create a readiness check handler that verifies dependency health.

Checks database and (optionally) cache connectivity. Returns 200 when all components are healthy, 503 when any component is down.

Args: db-context: Database context (required) cache: Cache component (optional, nil if not configured)

Returns: Ring handler function for readiness checks

Create a readiness check handler that verifies dependency health.

Checks database and (optionally) cache connectivity. Returns 200
when all components are healthy, 503 when any component is down.

Args:
  db-context: Database context (required)
  cache: Cache component (optional, nil if not configured)

Returns:
  Ring handler function for readiness checks
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close