|
NeuralPlus 0.2.0
A small C++17 SDK for AI clients, sessions, tools, and tracing
|
Deterministic callback transport that also records requests for tests. More...
#include <transport.hpp>
Public Types | |
| using | Handler = std::function< HttpResponse(const HttpRequest &)> |
Public Member Functions | |
| MockHttpTransport (Handler handler) | |
Creates a recording transport backed by handler. | |
| HttpResponse | send (const HttpRequest &request) override |
| Records the request and delegates response creation to the handler. | |
| std::vector< HttpRequest > | requests () const |
| Returns a thread-safe snapshot of recorded requests. | |
| void | clear_requests () |
| Removes all recorded requests. | |
Deterministic callback transport that also records requests for tests.
| using neuralplus::MockHttpTransport::Handler = std::function<HttpResponse(const HttpRequest&)> |
Callback signature used to produce a deterministic HTTP response.
The callback may be invoked concurrently and must be thread-safe.
|
overridevirtual |
Records the request and delegates response creation to the handler.
Implements neuralplus::HttpTransport.