cat_gateway::service::utilities::middleware

Module schema_validation

source
Expand description

Middleware to verify the status of the last DB schema version validation.

If a mismatch is detected, the middleware returns an error with ServiceUnavailable status code (503). Otherwise, the middleware calls and returns the wrapped endpoint’s response.

This middleware checks the State.schema_version_status value, if it is Ok, the wrapped endpoint is called and its response is returned.

Structs§

  • A middleware that raises an error with ServiceUnavailable and 503 status code if a DB schema version mismatch is found the existing State.
  • The new endpoint type generated by the SchemaVersionValidation.

Functions§