1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/// The path of the static route.
pub const ROUTE_ROOT: &str = "/";
/// The path of the dynamic route.
pub const ROUTE_USER: &str = "/api/user/{id}";
/// The path of the query route.
pub const ROUTE_SEARCH: &str = "/api/search";
/// The path of the header route.
pub const ROUTE_HEADERS: &str = "/api/headers";
/// The path of the body route.
pub const ROUTE_ECHO: &str = "/api/echo";
/// The body the static route answers with.
pub const BODY_ROOT: & = b"hello hyperlane benchmark";
/// The body the dynamic route answers with, before the path parameter.
pub const BODY_USER: & = b"user ";
/// The name of the path parameter the dynamic route extracts.
pub const PARAM_ID: &str = "id";
/// The name of the query parameter the query route reads.
pub const PARAM_QUERY: &str = "q";
/// The name of the header the header route reads.
pub const HEADER_TAG: &str = "x-bench-tag";
/// The environment variable that names the address to bind.
pub const ENV_ADDRESS: &str = "BENCH_ADDR";
/// The address the server binds when the environment names none.
pub const DEFAULT_ADDRESS: &str = "0.0.0.0:8080";
/// The status code every route answers with.
pub const STATUS_OK: usize = 200;
/// The environment variable that names the wire protocol.
pub const ENV_PROTOCOL: &str = "BENCH_PROTOCOL";
/// The environment variable that names the certificate chain.
pub const ENV_TLS_CERTIFICATE: &str = "BENCH_TLS_CERT";
/// The environment variable that names the private key.
pub const ENV_TLS_KEY: &str = "BENCH_TLS_KEY";
/// The protocol name that selects HTTP/1 over a plain socket.
pub const PROTOCOL_HTTP1: &str = "http1";
/// The protocol name that selects HTTP/1 over TLS.
pub const PROTOCOL_HTTP1_TLS: &str = "http1-tls";
/// The protocol name that selects HTTP/2 over a plain socket.
pub const PROTOCOL_HTTP2: &str = "http2";
/// The protocol name that selects HTTP/2 over TLS.
pub const PROTOCOL_HTTP2_TLS: &str = "http2-tls";
/// The protocol name that selects HTTP/3 over QUIC.
pub const PROTOCOL_HTTP3: &str = "http3";