NeuralPlus 0.2.0
A small C++17 SDK for AI clients, sessions, tools, and tracing
Loading...
Searching...
No Matches
neuralplus::MockHttpTransport Class Referencefinal

Deterministic callback transport that also records requests for tests. More...

#include <transport.hpp>

Inheritance diagram for neuralplus::MockHttpTransport:
neuralplus::HttpTransport

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< HttpRequestrequests () const
 Returns a thread-safe snapshot of recorded requests.
 
void clear_requests ()
 Removes all recorded requests.
 

Detailed Description

Deterministic callback transport that also records requests for tests.

Member Typedef Documentation

◆ Handler

Callback signature used to produce a deterministic HTTP response.

The callback may be invoked concurrently and must be thread-safe.

Member Function Documentation

◆ send()

HttpResponse neuralplus::MockHttpTransport::send ( const HttpRequest request)
overridevirtual

Records the request and delegates response creation to the handler.

Implements neuralplus::HttpTransport.


The documentation for this class was generated from the following file: