#pragma once // Test-only opaque TCP relay. TLS remains end-to-end between libpq and PostgreSQL. #include #include #include namespace evo::test { class PostgresRelay { public: explicit PostgresRelay(std::uint16_t backend_port); ~PostgresRelay(); PostgresRelay(const PostgresRelay&) = delete; PostgresRelay& operator=(const PostgresRelay&) = delete; [[nodiscard]] std::string port() const; void drop_requests(bool); void drop_responses(bool); [[nodiscard]] std::uint64_t dropped_requests() const; [[nodiscard]] std::uint64_t dropped_responses() const; [[nodiscard]] bool healthy() const; private: struct Impl; std::unique_ptr impl_; }; } // namespace evo::test