Malloy
Toggle main menu visibility
Loading...
Searching...
No Matches
lib
malloy
mock
mocks.hpp
1
2
#pragma once
3
4
#include "../core/http/request.hpp"
5
6
namespace
malloy::mock::http
7
{
8
9
class
connection
10
{
11
public
:
12
class
request_generator
13
{
14
public
:
15
malloy::http::request_header<>
header_;
16
17
explicit
18
request_generator(
malloy::http::request_header<>
header) :
19
header_{std::move(header)}
20
{
21
}
22
23
const
malloy::http::request_header<>
&
24
header()
const
25
{
26
return
header_;
27
}
28
29
template
<
typename
Body, std::invocable<malloy::http::request<Body>&&> Callback,
typename
Setup>
30
void
31
body(Callback&& done, Setup&& s)
32
{
33
malloy::http::request<Body>
r;
34
r.base() = header_;
35
s(r.body());
36
done(r);
37
}
38
39
template
<
typename
Body, std::invocable<malloy::http::request<Body>&&> Callback>
40
void
41
body(Callback&& done)
42
{
43
return
done(
malloy::http::request<Body>
{header_});
44
}
45
};
46
47
void
48
do_write(
auto
&&)
49
{
50
}
51
};
52
53
}
// namespace malloy::mock::http
54
55
malloy::http::request
Definition
request.hpp:19
malloy::mock::http::connection
Definition
mocks.hpp:10
malloy::http::request_header
boost::beast::http::request_header< Fields > request_header
Definition
types.hpp:39
Generated by
1.18.0