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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//! Tools and types used to communicate with Sōzu.
extern crate serde;
/// The floor each H2 listener knob must meet — the single list, expanded once
/// per validator that enforces it (sozu-proxy/sozu#1418).
///
/// Expands `$callback!($config, <field>, <minimum>)` once per knob, in a fixed
/// order, so the five doors into a listener configuration share one list
/// instead of five copies of it: `ListenerBuilder::validate_h2_thresholds`
/// (`crate::config`, the config file and `sozu ctl add listener`),
/// `validate_h2_flood_knobs_http`/`_https` (`crate::state`,
/// `UpdateHttp(s)Listener`) and `validate_h2_flood_knobs_http_listener`/
/// `_https_listener` (`crate::state`, a raw protobuf
/// `Add{Http,Https}Listener`). Each supplies its own one-knob callback because
/// the error types differ — `ConfigError::H2ThresholdBelowMinimum` names the
/// listener, `StateError::InvalidValue` names the field — but none supplies
/// its own list. Adding a knob to one door and forgetting another is what
/// reopens sozu#1418 one level up; with the list here it is not expressible.
///
/// `h2_graceful_shutdown_deadline_seconds` is deliberately absent: `0` there
/// means "wait forever (no forced close after GOAWAY)".
pub use for_each_h2_knob_floor;
/// custom made logging macros
/// Custom buffer used for parsing within the Sōzu codebase.
/// TLS certificates
/// channels used for communication between main process and workers
/// parse TOML config and generate requests from it
/// listener identity: socket address plus optional network interface
/// parse Requests
/// two-phase coordination of protected health-check headers
/// Contains Rust types generated by [`prost`](https://docs.rs/prost/latest/prost/)
/// using the protobuf definition in `command.proto`.
///
/// The two main types are `Request` and `Response`.
///
/// Because these types were originally defined in Rust, and later adapted for protobuf,
/// the Rust translation of the protobuf definition looks a bit weird. Instead of having
/// `Request` being a simple enum with Payload like this:
///
/// ```ignore
/// pub enum Request {
/// SaveState(String),
/// LoadState(String),
/// // ...
/// }
/// ```
///
/// It is defined with `oneof` in protobuf. and looks like this in Rust:
///
/// ```ignore
/// pub struct Request {
/// pub request_type: ::core::option::Option<request::RequestType>,
/// }
///
/// pub mod request {
/// pub enum RequestType {
/// #[prost(string, tag = "1")]
/// SaveState(::prost::alloc::string::String),
/// /// load a state file, given its path
/// #[prost(string, tag = "2")]
/// LoadState(::prost::alloc::string::String),
/// }
/// }
/// ```
///
/// but can be instantiated this way:
///
/// ```ignore
/// let load_state_request: Request = RequestType::LoadState(path).into();
/// ```
///
/// A bit cumbersome, but it is the only way to benefit from protobuf in Rust.
/// File descriptor readiness
/// Helper functions around types received by Sōzu
/// Helper functions around types sent by Sōzu
/// sockets used to pass file descriptors
/// systemd `sd_notify` integration (READY=1 / STOPPING=1 / etc.)
/// protected health-check header values and their keyed fingerprints
/// A representation of Sōzu's state
/// A writer used for logging
/// Used only when returning errors