sozu_command_lib/proto/
command.rs

1// This file is @generated by prost-build.
2/// A message received by Sōzu to change its state or query information
3#[derive(::serde::Serialize, ::serde::Deserialize)]
4#[derive(Ord, PartialOrd)]
5#[derive(Eq)]
6#[derive(Hash)]
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct Request {
9    #[prost(
10        oneof = "request::RequestType",
11        tags = "1, 2, 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, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46"
12    )]
13    pub request_type: ::core::option::Option<request::RequestType>,
14}
15/// Nested message and enum types in `Request`.
16pub mod request {
17    #[derive(::serde::Serialize, ::serde::Deserialize)]
18    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
19    #[derive(Hash, Eq, Ord, PartialOrd)]
20    #[derive(Clone, PartialEq, ::prost::Oneof)]
21    pub enum RequestType {
22        /// This message tells Sōzu to dump the current proxy state (backends,
23        /// front domains, certificates, etc) as a list of JSON-serialized Requests,
24        /// separated by a 0 byte, to a file. This file can be used later
25        /// to bootstrap the proxy. This message is not forwarded to workers.
26        /// If the specified path is relative, it will be calculated relative to the current
27        /// working directory of the proxy.
28        #[prost(string, tag = "1")]
29        SaveState(::prost::alloc::string::String),
30        /// load a state file, given its path
31        #[prost(string, tag = "2")]
32        LoadState(::prost::alloc::string::String),
33        /// list the workers and their status
34        #[prost(message, tag = "4")]
35        ListWorkers(super::ListWorkers),
36        /// list the frontends, filtered by protocol and/or domain
37        #[prost(message, tag = "5")]
38        ListFrontends(super::FrontendFilters),
39        /// list all listeners
40        #[prost(message, tag = "6")]
41        ListListeners(super::ListListeners),
42        /// launch a new worker
43        /// never implemented, the tag is unused and probably not needed
44        /// we may still implement it later with no paramater
45        /// the main process will automatically assign a new id to a new worker
46        #[prost(string, tag = "7")]
47        LaunchWorker(::prost::alloc::string::String),
48        /// upgrade the main process
49        #[prost(message, tag = "8")]
50        UpgradeMain(super::UpgradeMain),
51        /// upgrade an existing worker, giving its id
52        #[prost(uint32, tag = "9")]
53        UpgradeWorker(u32),
54        /// subscribe to proxy events
55        #[prost(message, tag = "10")]
56        SubscribeEvents(super::SubscribeEvents),
57        /// reload the configuration from the config file, or a new file
58        /// CHECK: this used to be an option. None => use the config file, Some(string) => path_to_file
59        /// make sure it works using "" and "path_to_file"
60        #[prost(string, tag = "11")]
61        ReloadConfiguration(::prost::alloc::string::String),
62        /// give status of main process and all workers
63        #[prost(message, tag = "12")]
64        Status(super::Status),
65        /// add a cluster
66        #[prost(message, tag = "13")]
67        AddCluster(super::Cluster),
68        /// remove a cluster giving its id
69        #[prost(string, tag = "14")]
70        RemoveCluster(::prost::alloc::string::String),
71        /// add an HTTP frontend
72        #[prost(message, tag = "15")]
73        AddHttpFrontend(super::RequestHttpFrontend),
74        /// remove an HTTP frontend
75        #[prost(message, tag = "16")]
76        RemoveHttpFrontend(super::RequestHttpFrontend),
77        /// add an HTTPS frontend
78        #[prost(message, tag = "17")]
79        AddHttpsFrontend(super::RequestHttpFrontend),
80        /// remove an HTTPS frontend
81        #[prost(message, tag = "18")]
82        RemoveHttpsFrontend(super::RequestHttpFrontend),
83        /// add a certificate
84        #[prost(message, tag = "19")]
85        AddCertificate(super::AddCertificate),
86        /// replace a certificate
87        #[prost(message, tag = "20")]
88        ReplaceCertificate(super::ReplaceCertificate),
89        /// remove a certificate
90        #[prost(message, tag = "21")]
91        RemoveCertificate(super::RemoveCertificate),
92        /// add a TCP frontend
93        #[prost(message, tag = "22")]
94        AddTcpFrontend(super::RequestTcpFrontend),
95        /// remove a TCP frontend
96        #[prost(message, tag = "23")]
97        RemoveTcpFrontend(super::RequestTcpFrontend),
98        /// add a backend
99        #[prost(message, tag = "24")]
100        AddBackend(super::AddBackend),
101        /// remove a backend
102        #[prost(message, tag = "25")]
103        RemoveBackend(super::RemoveBackend),
104        /// add an HTTP listener
105        #[prost(message, tag = "26")]
106        AddHttpListener(super::HttpListenerConfig),
107        /// add an HTTPS listener
108        #[prost(message, tag = "27")]
109        AddHttpsListener(super::HttpsListenerConfig),
110        /// add a TCP listener
111        #[prost(message, tag = "28")]
112        AddTcpListener(super::TcpListenerConfig),
113        /// remove a listener
114        #[prost(message, tag = "29")]
115        RemoveListener(super::RemoveListener),
116        /// activate a listener
117        #[prost(message, tag = "30")]
118        ActivateListener(super::ActivateListener),
119        /// deactivate a listener
120        #[prost(message, tag = "31")]
121        DeactivateListener(super::DeactivateListener),
122        /// query a cluster by id
123        #[prost(string, tag = "35")]
124        QueryClusterById(::prost::alloc::string::String),
125        /// query clusters with a hostname and optional path
126        #[prost(message, tag = "36")]
127        QueryClustersByDomain(super::QueryClusterByDomain),
128        /// query clusters hashes
129        #[prost(message, tag = "37")]
130        QueryClustersHashes(super::QueryClustersHashes),
131        /// query metrics
132        #[prost(message, tag = "38")]
133        QueryMetrics(super::QueryMetricsOptions),
134        /// soft stop
135        #[prost(message, tag = "39")]
136        SoftStop(super::SoftStop),
137        /// hard stop
138        #[prost(message, tag = "40")]
139        HardStop(super::HardStop),
140        /// enable, disable or clear the metrics
141        #[prost(enumeration = "super::MetricsConfiguration", tag = "41")]
142        ConfigureMetrics(i32),
143        /// Change the logging level
144        #[prost(string, tag = "42")]
145        Logging(::prost::alloc::string::String),
146        /// Return the listen sockets
147        #[prost(message, tag = "43")]
148        ReturnListenSockets(super::ReturnListenSockets),
149        /// Get certificates from the state (rather than from the workers)
150        #[prost(message, tag = "44")]
151        QueryCertificatesFromTheState(super::QueryCertificatesFilters),
152        /// Get certificates from the workers (rather than from the state)
153        #[prost(message, tag = "45")]
154        QueryCertificatesFromWorkers(super::QueryCertificatesFilters),
155        /// query the state about how many requests of each type has been received
156        /// since startup
157        #[prost(message, tag = "46")]
158        CountRequests(super::CountRequests),
159    }
160}
161#[derive(::serde::Serialize, ::serde::Deserialize)]
162#[derive(Ord, PartialOrd)]
163#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
164pub struct ListWorkers {}
165#[derive(::serde::Serialize, ::serde::Deserialize)]
166#[derive(Ord, PartialOrd)]
167#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
168pub struct ListListeners {}
169#[derive(::serde::Serialize, ::serde::Deserialize)]
170#[derive(Ord, PartialOrd)]
171#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
172pub struct UpgradeMain {}
173#[derive(::serde::Serialize, ::serde::Deserialize)]
174#[derive(Ord, PartialOrd)]
175#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
176pub struct SubscribeEvents {}
177#[derive(::serde::Serialize, ::serde::Deserialize)]
178#[derive(Ord, PartialOrd)]
179#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
180pub struct Status {}
181#[derive(::serde::Serialize, ::serde::Deserialize)]
182#[derive(Ord, PartialOrd)]
183#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
184pub struct QueryClustersHashes {}
185#[derive(::serde::Serialize, ::serde::Deserialize)]
186#[derive(Ord, PartialOrd)]
187#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
188pub struct SoftStop {}
189#[derive(::serde::Serialize, ::serde::Deserialize)]
190#[derive(Ord, PartialOrd)]
191#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
192pub struct HardStop {}
193#[derive(::serde::Serialize, ::serde::Deserialize)]
194#[derive(Ord, PartialOrd)]
195#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
196pub struct ReturnListenSockets {}
197#[derive(::serde::Serialize, ::serde::Deserialize)]
198#[derive(Ord, PartialOrd)]
199#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
200pub struct CountRequests {}
201/// details of an HTTP listener
202#[derive(::serde::Serialize, ::serde::Deserialize)]
203#[derive(Ord, PartialOrd)]
204#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
205pub struct HttpListenerConfig {
206    #[prost(message, required, tag = "1")]
207    pub address: SocketAddress,
208    #[prost(message, optional, tag = "2")]
209    pub public_address: ::core::option::Option<SocketAddress>,
210    #[prost(bool, required, tag = "5", default = "false")]
211    pub expect_proxy: bool,
212    #[prost(string, required, tag = "6")]
213    pub sticky_name: ::prost::alloc::string::String,
214    /// client inactive time, in seconds
215    #[prost(uint32, required, tag = "7", default = "60")]
216    pub front_timeout: u32,
217    /// backend server inactive time, in seconds
218    #[prost(uint32, required, tag = "8", default = "30")]
219    pub back_timeout: u32,
220    /// time to connect to the backend, in seconds
221    #[prost(uint32, required, tag = "9", default = "3")]
222    pub connect_timeout: u32,
223    /// max time to send a complete request, in seconds
224    #[prost(uint32, required, tag = "10", default = "10")]
225    pub request_timeout: u32,
226    /// wether the listener is actively listening on its socket
227    #[prost(bool, required, tag = "11", default = "false")]
228    pub active: bool,
229    #[prost(message, optional, tag = "12")]
230    pub http_answers: ::core::option::Option<CustomHttpAnswers>,
231}
232/// details of an HTTPS listener
233#[derive(::serde::Serialize, ::serde::Deserialize)]
234#[derive(Ord, PartialOrd)]
235#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
236pub struct HttpsListenerConfig {
237    #[prost(message, required, tag = "1")]
238    pub address: SocketAddress,
239    #[prost(message, optional, tag = "2")]
240    pub public_address: ::core::option::Option<SocketAddress>,
241    #[prost(bool, required, tag = "5", default = "false")]
242    pub expect_proxy: bool,
243    #[prost(string, required, tag = "6")]
244    pub sticky_name: ::prost::alloc::string::String,
245    /// client inactive time, in seconds
246    #[prost(uint32, required, tag = "7", default = "60")]
247    pub front_timeout: u32,
248    /// backend server inactive time, in seconds
249    #[prost(uint32, required, tag = "8", default = "30")]
250    pub back_timeout: u32,
251    /// time to connect to the backend, in seconds
252    #[prost(uint32, required, tag = "9", default = "3")]
253    pub connect_timeout: u32,
254    /// max time to send a complete request, in seconds
255    #[prost(uint32, required, tag = "10", default = "10")]
256    pub request_timeout: u32,
257    /// wether the listener is actively listening on its socket
258    #[prost(bool, required, tag = "11", default = "false")]
259    pub active: bool,
260    /// TLS versions
261    #[prost(enumeration = "TlsVersion", repeated, packed = "false", tag = "12")]
262    pub versions: ::prost::alloc::vec::Vec<i32>,
263    #[prost(string, repeated, tag = "13")]
264    pub cipher_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
265    #[prost(string, repeated, tag = "14")]
266    pub cipher_suites: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
267    #[prost(string, repeated, tag = "15")]
268    pub signature_algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
269    #[prost(string, repeated, tag = "16")]
270    pub groups_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
271    #[prost(string, optional, tag = "17")]
272    pub certificate: ::core::option::Option<::prost::alloc::string::String>,
273    #[prost(string, repeated, tag = "18")]
274    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
275    #[prost(string, optional, tag = "19")]
276    pub key: ::core::option::Option<::prost::alloc::string::String>,
277    /// Number of TLS 1.3 tickets to send to a client when establishing a connection.
278    /// The tickets allow the client to resume a session. This protects the client
279    /// agains session tracking. Defaults to 4.
280    #[prost(uint64, required, tag = "20")]
281    pub send_tls13_tickets: u64,
282    #[prost(message, optional, tag = "21")]
283    pub http_answers: ::core::option::Option<CustomHttpAnswers>,
284}
285/// details of an TCP listener
286#[derive(::serde::Serialize, ::serde::Deserialize)]
287#[derive(Ord, PartialOrd)]
288#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
289pub struct TcpListenerConfig {
290    #[prost(message, required, tag = "1")]
291    pub address: SocketAddress,
292    #[prost(message, optional, tag = "2")]
293    pub public_address: ::core::option::Option<SocketAddress>,
294    #[prost(bool, required, tag = "3", default = "false")]
295    pub expect_proxy: bool,
296    /// client inactive time, in seconds
297    #[prost(uint32, required, tag = "4", default = "60")]
298    pub front_timeout: u32,
299    /// backend server inactive time, in seconds
300    #[prost(uint32, required, tag = "5", default = "30")]
301    pub back_timeout: u32,
302    /// time to connect to the backend, in seconds
303    #[prost(uint32, required, tag = "6", default = "3")]
304    pub connect_timeout: u32,
305    /// wether the listener is actively listening on its socket
306    #[prost(bool, required, tag = "7", default = "false")]
307    pub active: bool,
308}
309/// custom HTTP answers, useful for 404, 503 pages
310#[derive(::serde::Serialize, ::serde::Deserialize)]
311#[derive(Ord, PartialOrd)]
312#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
313pub struct CustomHttpAnswers {
314    /// MovedPermanently
315    #[prost(string, optional, tag = "1")]
316    pub answer_301: ::core::option::Option<::prost::alloc::string::String>,
317    /// BadRequest
318    #[prost(string, optional, tag = "2")]
319    pub answer_400: ::core::option::Option<::prost::alloc::string::String>,
320    /// Unauthorized
321    #[prost(string, optional, tag = "3")]
322    pub answer_401: ::core::option::Option<::prost::alloc::string::String>,
323    /// NotFound
324    #[prost(string, optional, tag = "4")]
325    pub answer_404: ::core::option::Option<::prost::alloc::string::String>,
326    /// RequestTimeout
327    #[prost(string, optional, tag = "5")]
328    pub answer_408: ::core::option::Option<::prost::alloc::string::String>,
329    /// PayloadTooLarge
330    #[prost(string, optional, tag = "6")]
331    pub answer_413: ::core::option::Option<::prost::alloc::string::String>,
332    /// BadGateway
333    #[prost(string, optional, tag = "7")]
334    pub answer_502: ::core::option::Option<::prost::alloc::string::String>,
335    /// ServiceUnavailable
336    #[prost(string, optional, tag = "8")]
337    pub answer_503: ::core::option::Option<::prost::alloc::string::String>,
338    /// GatewayTimeout
339    #[prost(string, optional, tag = "9")]
340    pub answer_504: ::core::option::Option<::prost::alloc::string::String>,
341    /// InsufficientStorage
342    #[prost(string, optional, tag = "10")]
343    pub answer_507: ::core::option::Option<::prost::alloc::string::String>,
344}
345#[derive(::serde::Serialize, ::serde::Deserialize)]
346#[derive(Ord, PartialOrd)]
347#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
348pub struct ActivateListener {
349    #[prost(message, required, tag = "1")]
350    pub address: SocketAddress,
351    #[prost(enumeration = "ListenerType", required, tag = "2")]
352    pub proxy: i32,
353    #[prost(bool, required, tag = "3")]
354    pub from_scm: bool,
355}
356#[derive(::serde::Serialize, ::serde::Deserialize)]
357#[derive(Ord, PartialOrd)]
358#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
359pub struct DeactivateListener {
360    #[prost(message, required, tag = "1")]
361    pub address: SocketAddress,
362    #[prost(enumeration = "ListenerType", required, tag = "2")]
363    pub proxy: i32,
364    #[prost(bool, required, tag = "3")]
365    pub to_scm: bool,
366}
367#[derive(::serde::Serialize, ::serde::Deserialize)]
368#[derive(Ord, PartialOrd)]
369#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
370pub struct RemoveListener {
371    #[prost(message, required, tag = "1")]
372    pub address: SocketAddress,
373    #[prost(enumeration = "ListenerType", required, tag = "2")]
374    pub proxy: i32,
375}
376/// All listeners, listed
377#[derive(::serde::Serialize, ::serde::Deserialize)]
378#[derive(Ord, PartialOrd)]
379#[derive(Hash, Eq)]
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct ListenersList {
382    /// address -> http listener config
383    #[prost(btree_map = "string, message", tag = "1")]
384    pub http_listeners: ::prost::alloc::collections::BTreeMap<
385        ::prost::alloc::string::String,
386        HttpListenerConfig,
387    >,
388    /// address -> https listener config
389    #[prost(btree_map = "string, message", tag = "2")]
390    pub https_listeners: ::prost::alloc::collections::BTreeMap<
391        ::prost::alloc::string::String,
392        HttpsListenerConfig,
393    >,
394    /// address -> tcp listener config
395    #[prost(btree_map = "string, message", tag = "3")]
396    pub tcp_listeners: ::prost::alloc::collections::BTreeMap<
397        ::prost::alloc::string::String,
398        TcpListenerConfig,
399    >,
400}
401/// An HTTP or HTTPS frontend, as order to, or received from, Sōzu
402#[derive(::serde::Serialize, ::serde::Deserialize)]
403#[derive(Ord, PartialOrd)]
404#[derive(Hash, Eq)]
405#[derive(Clone, PartialEq, ::prost::Message)]
406pub struct RequestHttpFrontend {
407    #[prost(string, optional, tag = "1")]
408    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
409    #[prost(message, required, tag = "2")]
410    pub address: SocketAddress,
411    #[prost(string, required, tag = "3")]
412    pub hostname: ::prost::alloc::string::String,
413    #[prost(message, required, tag = "4")]
414    pub path: PathRule,
415    #[prost(string, optional, tag = "5")]
416    pub method: ::core::option::Option<::prost::alloc::string::String>,
417    #[prost(enumeration = "RulePosition", required, tag = "6", default = "Tree")]
418    pub position: i32,
419    /// custom tags to identify the frontend in the access logs
420    #[prost(btree_map = "string, string", tag = "7")]
421    pub tags: ::prost::alloc::collections::BTreeMap<
422        ::prost::alloc::string::String,
423        ::prost::alloc::string::String,
424    >,
425}
426#[derive(::serde::Serialize, ::serde::Deserialize)]
427#[derive(Ord, PartialOrd)]
428#[derive(Hash, Eq)]
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct RequestTcpFrontend {
431    #[prost(string, required, tag = "1")]
432    pub cluster_id: ::prost::alloc::string::String,
433    /// the socket address on which to listen for incoming traffic
434    #[prost(message, required, tag = "2")]
435    pub address: SocketAddress,
436    /// custom tags to identify the frontend in the access logs
437    #[prost(btree_map = "string, string", tag = "3")]
438    pub tags: ::prost::alloc::collections::BTreeMap<
439        ::prost::alloc::string::String,
440        ::prost::alloc::string::String,
441    >,
442}
443/// list the frontends, filtered by protocol and/or domain
444#[derive(::serde::Serialize, ::serde::Deserialize)]
445#[derive(Ord, PartialOrd)]
446#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
447pub struct FrontendFilters {
448    #[prost(bool, required, tag = "1")]
449    pub http: bool,
450    #[prost(bool, required, tag = "2")]
451    pub https: bool,
452    #[prost(bool, required, tag = "3")]
453    pub tcp: bool,
454    #[prost(string, optional, tag = "4")]
455    pub domain: ::core::option::Option<::prost::alloc::string::String>,
456}
457/// A filter for the path of incoming requests
458#[derive(::serde::Serialize, ::serde::Deserialize)]
459#[derive(Ord, PartialOrd)]
460#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
461pub struct PathRule {
462    /// The kind of filter used for path rules
463    #[prost(enumeration = "PathRuleKind", required, tag = "1")]
464    pub kind: i32,
465    /// the value of the given prefix, regex or equal pathrule
466    #[prost(string, required, tag = "2")]
467    pub value: ::prost::alloc::string::String,
468}
469/// Add a new TLS certificate to an HTTPs listener
470#[derive(::serde::Serialize, ::serde::Deserialize)]
471#[derive(Ord, PartialOrd)]
472#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
473pub struct AddCertificate {
474    #[prost(message, required, tag = "1")]
475    pub address: SocketAddress,
476    #[prost(message, required, tag = "2")]
477    pub certificate: CertificateAndKey,
478    /// A unix timestamp. Overrides certificate expiration.
479    #[prost(int64, optional, tag = "3")]
480    pub expired_at: ::core::option::Option<i64>,
481}
482#[derive(::serde::Serialize, ::serde::Deserialize)]
483#[derive(Ord, PartialOrd)]
484#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
485pub struct RemoveCertificate {
486    #[prost(message, required, tag = "1")]
487    pub address: SocketAddress,
488    /// a hex-encoded TLS fingerprint to identify the certificate to remove
489    #[prost(string, required, tag = "2")]
490    pub fingerprint: ::prost::alloc::string::String,
491}
492#[derive(::serde::Serialize, ::serde::Deserialize)]
493#[derive(Ord, PartialOrd)]
494#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
495pub struct ReplaceCertificate {
496    #[prost(message, required, tag = "1")]
497    pub address: SocketAddress,
498    #[prost(message, required, tag = "2")]
499    pub new_certificate: CertificateAndKey,
500    /// a hex-encoded TLS fingerprint to identify the old certificate
501    #[prost(string, required, tag = "3")]
502    pub old_fingerprint: ::prost::alloc::string::String,
503    /// A unix timestamp. Overrides certificate expiration.
504    #[prost(int64, optional, tag = "4")]
505    pub new_expired_at: ::core::option::Option<i64>,
506}
507#[derive(::serde::Serialize, ::serde::Deserialize)]
508#[derive(Ord, PartialOrd)]
509#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
510pub struct CertificateAndKey {
511    #[prost(string, required, tag = "1")]
512    pub certificate: ::prost::alloc::string::String,
513    #[prost(string, repeated, tag = "2")]
514    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
515    #[prost(string, required, tag = "3")]
516    pub key: ::prost::alloc::string::String,
517    #[prost(enumeration = "TlsVersion", repeated, packed = "false", tag = "4")]
518    pub versions: ::prost::alloc::vec::Vec<i32>,
519    /// a list of domain names. Override certificate names
520    /// if empty, the names of the certificate will be used
521    #[prost(string, repeated, tag = "5")]
522    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
523}
524/// Should be either a domain name or a fingerprint.
525/// These filter do not compound, use either one but not both.
526/// If none of them is specified, all certificates will be returned.
527#[derive(::serde::Serialize, ::serde::Deserialize)]
528#[derive(Ord, PartialOrd)]
529#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
530pub struct QueryCertificatesFilters {
531    /// a domain name to filter certificate results
532    #[prost(string, optional, tag = "1")]
533    pub domain: ::core::option::Option<::prost::alloc::string::String>,
534    /// a hex-encoded fingerprint of the TLS certificate to find
535    #[prost(string, optional, tag = "2")]
536    pub fingerprint: ::core::option::Option<::prost::alloc::string::String>,
537}
538/// domain name and fingerprint of a certificate
539#[derive(::serde::Serialize, ::serde::Deserialize)]
540#[derive(Ord, PartialOrd)]
541#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
542pub struct CertificateSummary {
543    #[prost(string, required, tag = "1")]
544    pub domain: ::prost::alloc::string::String,
545    /// a hex-encoded TLS fingerprint
546    #[prost(string, required, tag = "2")]
547    pub fingerprint: ::prost::alloc::string::String,
548}
549/// Used by workers to reply to some certificate queries
550#[derive(::serde::Serialize, ::serde::Deserialize)]
551#[derive(Ord, PartialOrd)]
552#[derive(Hash, Eq)]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct ListOfCertificatesByAddress {
555    #[prost(message, repeated, tag = "1")]
556    pub certificates: ::prost::alloc::vec::Vec<CertificatesByAddress>,
557}
558/// Summaries of certificates for a given address
559#[derive(::serde::Serialize, ::serde::Deserialize)]
560#[derive(Ord, PartialOrd)]
561#[derive(Hash, Eq)]
562#[derive(Clone, PartialEq, ::prost::Message)]
563pub struct CertificatesByAddress {
564    #[prost(message, required, tag = "1")]
565    pub address: SocketAddress,
566    #[prost(message, repeated, tag = "2")]
567    pub certificate_summaries: ::prost::alloc::vec::Vec<CertificateSummary>,
568}
569/// to reply to several certificate queries
570#[derive(::serde::Serialize, ::serde::Deserialize)]
571#[derive(Ord, PartialOrd)]
572#[derive(Hash, Eq)]
573#[derive(Clone, PartialEq, ::prost::Message)]
574pub struct CertificatesWithFingerprints {
575    /// a map of fingerprint -> certificate_and_key
576    #[prost(btree_map = "string, message", tag = "1")]
577    pub certs: ::prost::alloc::collections::BTreeMap<
578        ::prost::alloc::string::String,
579        CertificateAndKey,
580    >,
581}
582/// A cluster is what binds a frontend to backends with routing rules
583#[derive(::serde::Serialize, ::serde::Deserialize)]
584#[derive(Ord, PartialOrd)]
585#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
586pub struct Cluster {
587    #[prost(string, required, tag = "1")]
588    pub cluster_id: ::prost::alloc::string::String,
589    /// wether a connection from a client shall be always redirected to the same backend
590    #[prost(bool, required, tag = "2")]
591    pub sticky_session: bool,
592    #[prost(bool, required, tag = "3")]
593    pub https_redirect: bool,
594    #[prost(enumeration = "ProxyProtocolConfig", optional, tag = "4")]
595    pub proxy_protocol: ::core::option::Option<i32>,
596    #[prost(
597        enumeration = "LoadBalancingAlgorithms",
598        required,
599        tag = "5",
600        default = "RoundRobin"
601    )]
602    pub load_balancing: i32,
603    #[prost(string, optional, tag = "6")]
604    pub answer_503: ::core::option::Option<::prost::alloc::string::String>,
605    #[prost(enumeration = "LoadMetric", optional, tag = "7")]
606    pub load_metric: ::core::option::Option<i32>,
607}
608/// add a backend
609#[derive(::serde::Serialize, ::serde::Deserialize)]
610#[derive(Ord, PartialOrd)]
611#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
612pub struct AddBackend {
613    #[prost(string, required, tag = "1")]
614    pub cluster_id: ::prost::alloc::string::String,
615    #[prost(string, required, tag = "2")]
616    pub backend_id: ::prost::alloc::string::String,
617    /// the socket address of the backend
618    #[prost(message, required, tag = "3")]
619    pub address: SocketAddress,
620    #[prost(string, optional, tag = "4")]
621    pub sticky_id: ::core::option::Option<::prost::alloc::string::String>,
622    #[prost(message, optional, tag = "5")]
623    pub load_balancing_parameters: ::core::option::Option<LoadBalancingParams>,
624    #[prost(bool, optional, tag = "6")]
625    pub backup: ::core::option::Option<bool>,
626}
627/// remove an existing backend
628#[derive(::serde::Serialize, ::serde::Deserialize)]
629#[derive(Ord, PartialOrd)]
630#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
631pub struct RemoveBackend {
632    #[prost(string, required, tag = "1")]
633    pub cluster_id: ::prost::alloc::string::String,
634    #[prost(string, required, tag = "2")]
635    pub backend_id: ::prost::alloc::string::String,
636    /// the socket address of the backend
637    #[prost(message, required, tag = "3")]
638    pub address: SocketAddress,
639}
640#[derive(::serde::Serialize, ::serde::Deserialize)]
641#[derive(Ord, PartialOrd)]
642#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
643pub struct LoadBalancingParams {
644    #[prost(int32, required, tag = "1")]
645    pub weight: i32,
646}
647#[derive(::serde::Serialize, ::serde::Deserialize)]
648#[derive(Ord, PartialOrd)]
649#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
650pub struct QueryClusterByDomain {
651    #[prost(string, required, tag = "1")]
652    pub hostname: ::prost::alloc::string::String,
653    #[prost(string, optional, tag = "2")]
654    pub path: ::core::option::Option<::prost::alloc::string::String>,
655}
656/// Options when querying metrics
657#[derive(::serde::Serialize, ::serde::Deserialize)]
658#[derive(Ord, PartialOrd)]
659#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
660pub struct QueryMetricsOptions {
661    /// query a list of available metrics
662    #[prost(bool, required, tag = "1")]
663    pub list: bool,
664    /// query metrics for these clusters
665    #[prost(string, repeated, tag = "2")]
666    pub cluster_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
667    /// query metrics for these backends
668    #[prost(string, repeated, tag = "3")]
669    pub backend_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
670    /// query only these metrics
671    #[prost(string, repeated, tag = "4")]
672    pub metric_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
673    /// query only worker and main process metrics (no cluster metrics)
674    #[prost(bool, required, tag = "5")]
675    pub no_clusters: bool,
676    /// display metrics of each worker, without flattening (takes more space)
677    #[prost(bool, required, tag = "6")]
678    pub workers: bool,
679}
680/// Response to a request
681#[derive(::serde::Serialize, ::serde::Deserialize)]
682#[derive(Ord, PartialOrd)]
683#[derive(Hash, Eq)]
684#[derive(Clone, PartialEq, ::prost::Message)]
685pub struct Response {
686    /// wether the request was a success, a failure, or is processing
687    #[prost(enumeration = "ResponseStatus", required, tag = "1", default = "Failure")]
688    pub status: i32,
689    /// a success or error message
690    #[prost(string, required, tag = "2")]
691    pub message: ::prost::alloc::string::String,
692    /// response data, if any
693    #[prost(message, optional, tag = "3")]
694    pub content: ::core::option::Option<ResponseContent>,
695}
696/// content of a response
697#[derive(::serde::Serialize, ::serde::Deserialize)]
698#[derive(Ord, PartialOrd)]
699#[derive(Hash, Eq)]
700#[derive(Clone, PartialEq, ::prost::Message)]
701pub struct ResponseContent {
702    #[prost(
703        oneof = "response_content::ContentType",
704        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13"
705    )]
706    pub content_type: ::core::option::Option<response_content::ContentType>,
707}
708/// Nested message and enum types in `ResponseContent`.
709pub mod response_content {
710    #[derive(::serde::Serialize, ::serde::Deserialize)]
711    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
712    #[derive(Hash, Eq, Ord, PartialOrd)]
713    #[derive(Clone, PartialEq, ::prost::Oneof)]
714    pub enum ContentType {
715        /// a list of workers, with ids, pids, statuses
716        #[prost(message, tag = "1")]
717        Workers(super::WorkerInfos),
718        /// aggregated metrics of main process and workers
719        #[prost(message, tag = "2")]
720        Metrics(super::AggregatedMetrics),
721        /// a collection of worker responses to the same request
722        #[prost(message, tag = "3")]
723        WorkerResponses(super::WorkerResponses),
724        /// a proxy event
725        #[prost(message, tag = "4")]
726        Event(super::Event),
727        /// a filtered list of frontend
728        #[prost(message, tag = "5")]
729        FrontendList(super::ListedFrontends),
730        /// all listeners
731        #[prost(message, tag = "6")]
732        ListenersList(super::ListenersList),
733        /// contains proxy & cluster metrics
734        #[prost(message, tag = "7")]
735        WorkerMetrics(super::WorkerMetrics),
736        /// Lists of metrics that are available
737        #[prost(message, tag = "8")]
738        AvailableMetrics(super::AvailableMetrics),
739        /// a list of cluster informations
740        #[prost(message, tag = "9")]
741        Clusters(super::ClusterInformations),
742        /// collection of hashes of cluster information,
743        #[prost(message, tag = "10")]
744        ClusterHashes(super::ClusterHashes),
745        /// a list of certificates summaries, grouped by socket address
746        #[prost(message, tag = "11")]
747        CertificatesByAddress(super::ListOfCertificatesByAddress),
748        /// a map of complete certificates using fingerprints as key
749        #[prost(message, tag = "12")]
750        CertificatesWithFingerprints(super::CertificatesWithFingerprints),
751        /// a census of the types of requests received since startup,
752        #[prost(message, tag = "13")]
753        RequestCounts(super::RequestCounts),
754    }
755}
756/// a map of worker_id -> ResponseContent
757#[derive(::serde::Serialize, ::serde::Deserialize)]
758#[derive(Ord, PartialOrd)]
759#[derive(Hash, Eq)]
760#[derive(Clone, PartialEq, ::prost::Message)]
761pub struct WorkerResponses {
762    #[prost(btree_map = "string, message", tag = "1")]
763    pub map: ::prost::alloc::collections::BTreeMap<
764        ::prost::alloc::string::String,
765        ResponseContent,
766    >,
767}
768/// lists of frontends present in the state
769#[derive(::serde::Serialize, ::serde::Deserialize)]
770#[derive(Ord, PartialOrd)]
771#[derive(Hash, Eq)]
772#[derive(Clone, PartialEq, ::prost::Message)]
773pub struct ListedFrontends {
774    #[prost(message, repeated, tag = "1")]
775    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
776    #[prost(message, repeated, tag = "2")]
777    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
778    #[prost(message, repeated, tag = "3")]
779    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
780}
781#[derive(::serde::Serialize, ::serde::Deserialize)]
782#[derive(Ord, PartialOrd)]
783#[derive(Hash, Eq)]
784#[derive(Clone, PartialEq, ::prost::Message)]
785pub struct ClusterInformations {
786    #[prost(message, repeated, tag = "1")]
787    pub vec: ::prost::alloc::vec::Vec<ClusterInformation>,
788}
789/// Information about a given cluster
790/// Contains types usually used in requests, because they are readily available in protobuf
791#[derive(::serde::Serialize, ::serde::Deserialize)]
792#[derive(Ord, PartialOrd)]
793#[derive(Hash, Eq)]
794#[derive(Clone, PartialEq, ::prost::Message)]
795pub struct ClusterInformation {
796    #[prost(message, optional, tag = "1")]
797    pub configuration: ::core::option::Option<Cluster>,
798    #[prost(message, repeated, tag = "2")]
799    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
800    #[prost(message, repeated, tag = "3")]
801    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
802    #[prost(message, repeated, tag = "4")]
803    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
804    #[prost(message, repeated, tag = "5")]
805    pub backends: ::prost::alloc::vec::Vec<AddBackend>,
806}
807/// an event produced by a worker to notify about backends status
808#[derive(::serde::Serialize, ::serde::Deserialize)]
809#[derive(Ord, PartialOrd)]
810#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
811pub struct Event {
812    #[prost(enumeration = "EventKind", required, tag = "1")]
813    pub kind: i32,
814    #[prost(string, optional, tag = "2")]
815    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
816    #[prost(string, optional, tag = "3")]
817    pub backend_id: ::core::option::Option<::prost::alloc::string::String>,
818    #[prost(message, optional, tag = "4")]
819    pub address: ::core::option::Option<SocketAddress>,
820}
821#[derive(::serde::Serialize, ::serde::Deserialize)]
822#[derive(Ord, PartialOrd)]
823#[derive(Hash, Eq)]
824#[derive(Clone, PartialEq, ::prost::Message)]
825pub struct ClusterHashes {
826    /// cluster id -> hash of cluster information
827    #[prost(btree_map = "string, uint64", tag = "1")]
828    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, u64>,
829}
830/// A list of worker infos
831#[derive(::serde::Serialize, ::serde::Deserialize)]
832#[derive(Ord, PartialOrd)]
833#[derive(Hash, Eq)]
834#[derive(Clone, PartialEq, ::prost::Message)]
835pub struct WorkerInfos {
836    #[prost(message, repeated, tag = "1")]
837    pub vec: ::prost::alloc::vec::Vec<WorkerInfo>,
838}
839/// Information about a worker with id, pid, runstate
840#[derive(::serde::Serialize, ::serde::Deserialize)]
841#[derive(Ord, PartialOrd)]
842#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
843pub struct WorkerInfo {
844    #[prost(uint32, required, tag = "1")]
845    pub id: u32,
846    #[prost(int32, required, tag = "2")]
847    pub pid: i32,
848    #[prost(enumeration = "RunState", required, tag = "3")]
849    pub run_state: i32,
850}
851/// lists of available metrics in a worker, or in the main process (in which case there are no cluster metrics)
852#[derive(::serde::Serialize, ::serde::Deserialize)]
853#[derive(Ord, PartialOrd)]
854#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
855pub struct AvailableMetrics {
856    #[prost(string, repeated, tag = "1")]
857    pub proxy_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
858    #[prost(string, repeated, tag = "2")]
859    pub cluster_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
860}
861/// Aggregated metrics of main process & workers
862#[derive(::serde::Serialize, ::serde::Deserialize)]
863#[derive(Ord, PartialOrd)]
864#[derive(Hash, Eq)]
865#[derive(Clone, PartialEq, ::prost::Message)]
866pub struct AggregatedMetrics {
867    /// metrics about the main process.
868    /// metric_name -> metric_value
869    #[prost(btree_map = "string, message", tag = "1")]
870    pub main: ::prost::alloc::collections::BTreeMap<
871        ::prost::alloc::string::String,
872        FilteredMetrics,
873    >,
874    /// details of worker metrics, with clusters and backends.
875    /// worker_id -> worker_metrics
876    #[prost(btree_map = "string, message", tag = "2")]
877    pub workers: ::prost::alloc::collections::BTreeMap<
878        ::prost::alloc::string::String,
879        WorkerMetrics,
880    >,
881    /// if present, contains metrics of clusters and their backends, merged across all workers.
882    /// cluster_id -> cluster_metrics
883    #[prost(btree_map = "string, message", tag = "3")]
884    pub clusters: ::prost::alloc::collections::BTreeMap<
885        ::prost::alloc::string::String,
886        ClusterMetrics,
887    >,
888    /// if present, proxying metrics, merged accross all workers.
889    /// metric_name -> metric_value
890    #[prost(btree_map = "string, message", tag = "4")]
891    pub proxying: ::prost::alloc::collections::BTreeMap<
892        ::prost::alloc::string::String,
893        FilteredMetrics,
894    >,
895}
896/// All metrics of a worker: proxy and clusters
897/// Populated by Options so partial results can be sent
898#[derive(::serde::Serialize, ::serde::Deserialize)]
899#[derive(Ord, PartialOrd)]
900#[derive(Hash, Eq)]
901#[derive(Clone, PartialEq, ::prost::Message)]
902pub struct WorkerMetrics {
903    /// Metrics of the worker process, key -> value
904    #[prost(btree_map = "string, message", tag = "1")]
905    pub proxy: ::prost::alloc::collections::BTreeMap<
906        ::prost::alloc::string::String,
907        FilteredMetrics,
908    >,
909    /// cluster_id -> cluster_metrics
910    #[prost(btree_map = "string, message", tag = "2")]
911    pub clusters: ::prost::alloc::collections::BTreeMap<
912        ::prost::alloc::string::String,
913        ClusterMetrics,
914    >,
915}
916/// the metrics of a given cluster, with several backends
917#[derive(::serde::Serialize, ::serde::Deserialize)]
918#[derive(Ord, PartialOrd)]
919#[derive(Hash, Eq)]
920#[derive(Clone, PartialEq, ::prost::Message)]
921pub struct ClusterMetrics {
922    /// metric name -> metric value
923    #[prost(btree_map = "string, message", tag = "1")]
924    pub cluster: ::prost::alloc::collections::BTreeMap<
925        ::prost::alloc::string::String,
926        FilteredMetrics,
927    >,
928    /// list of backends with their metrics
929    #[prost(message, repeated, tag = "2")]
930    pub backends: ::prost::alloc::vec::Vec<BackendMetrics>,
931}
932#[derive(::serde::Serialize, ::serde::Deserialize)]
933#[derive(Ord, PartialOrd)]
934#[derive(Hash, Eq)]
935#[derive(Clone, PartialEq, ::prost::Message)]
936pub struct BackendMetrics {
937    #[prost(string, required, tag = "1")]
938    pub backend_id: ::prost::alloc::string::String,
939    #[prost(btree_map = "string, message", tag = "2")]
940    pub metrics: ::prost::alloc::collections::BTreeMap<
941        ::prost::alloc::string::String,
942        FilteredMetrics,
943    >,
944}
945/// A metric, in a "filtered" format, which means: sendable to outside programs.
946#[derive(::serde::Serialize, ::serde::Deserialize)]
947#[derive(Ord, PartialOrd)]
948#[derive(Hash, Eq)]
949#[derive(Clone, PartialEq, ::prost::Message)]
950pub struct FilteredMetrics {
951    #[prost(oneof = "filtered_metrics::Inner", tags = "1, 2, 3, 4, 5, 6")]
952    pub inner: ::core::option::Option<filtered_metrics::Inner>,
953}
954/// Nested message and enum types in `FilteredMetrics`.
955pub mod filtered_metrics {
956    #[derive(::serde::Serialize, ::serde::Deserialize)]
957    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
958    #[derive(Hash, Eq, Ord, PartialOrd)]
959    #[derive(Clone, PartialEq, ::prost::Oneof)]
960    pub enum Inner {
961        /// increases or decrease depending on the state
962        #[prost(uint64, tag = "1")]
963        Gauge(u64),
964        /// increases only
965        #[prost(int64, tag = "2")]
966        Count(i64),
967        /// milliseconds
968        #[prost(uint64, tag = "3")]
969        Time(u64),
970        #[prost(message, tag = "4")]
971        Percentiles(super::Percentiles),
972        #[prost(message, tag = "5")]
973        TimeSerie(super::FilteredTimeSerie),
974        #[prost(message, tag = "6")]
975        Histogram(super::FilteredHistogram),
976    }
977}
978#[derive(::serde::Serialize, ::serde::Deserialize)]
979#[derive(Ord, PartialOrd)]
980#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
981pub struct FilteredTimeSerie {
982    #[prost(uint32, required, tag = "1")]
983    pub last_second: u32,
984    #[prost(uint32, repeated, packed = "false", tag = "2")]
985    pub last_minute: ::prost::alloc::vec::Vec<u32>,
986    #[prost(uint32, repeated, packed = "false", tag = "3")]
987    pub last_hour: ::prost::alloc::vec::Vec<u32>,
988}
989#[derive(::serde::Serialize, ::serde::Deserialize)]
990#[derive(Ord, PartialOrd)]
991#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
992pub struct Percentiles {
993    #[prost(uint64, required, tag = "1")]
994    pub samples: u64,
995    #[prost(uint64, required, tag = "2")]
996    pub p_50: u64,
997    #[prost(uint64, required, tag = "3")]
998    pub p_90: u64,
999    #[prost(uint64, required, tag = "4")]
1000    pub p_99: u64,
1001    #[prost(uint64, required, tag = "5")]
1002    pub p_99_9: u64,
1003    #[prost(uint64, required, tag = "6")]
1004    pub p_99_99: u64,
1005    #[prost(uint64, required, tag = "7")]
1006    pub p_99_999: u64,
1007    #[prost(uint64, required, tag = "8")]
1008    pub p_100: u64,
1009    #[prost(uint64, required, tag = "9")]
1010    pub sum: u64,
1011}
1012/// a histogram meant to be translated to prometheus
1013#[derive(::serde::Serialize, ::serde::Deserialize)]
1014#[derive(Ord, PartialOrd)]
1015#[derive(Hash, Eq)]
1016#[derive(Clone, PartialEq, ::prost::Message)]
1017pub struct FilteredHistogram {
1018    #[prost(uint64, required, tag = "1")]
1019    pub sum: u64,
1020    #[prost(uint64, required, tag = "2")]
1021    pub count: u64,
1022    #[prost(message, repeated, tag = "3")]
1023    pub buckets: ::prost::alloc::vec::Vec<Bucket>,
1024}
1025/// a prometheus histogram bucket
1026#[derive(::serde::Serialize, ::serde::Deserialize)]
1027#[derive(Ord, PartialOrd)]
1028#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1029pub struct Bucket {
1030    #[prost(uint64, required, tag = "1")]
1031    pub count: u64,
1032    /// upper range of the bucket (le = less or equal)
1033    #[prost(uint64, required, tag = "2")]
1034    pub le: u64,
1035}
1036#[derive(::serde::Serialize, ::serde::Deserialize)]
1037#[derive(Ord, PartialOrd)]
1038#[derive(Hash, Eq)]
1039#[derive(Clone, PartialEq, ::prost::Message)]
1040pub struct RequestCounts {
1041    #[prost(btree_map = "string, int32", tag = "1")]
1042    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, i32>,
1043}
1044/// matches std::net::SocketAddr in the Rust library
1045/// beware that the ports are expressed with uint32 here,
1046/// but they should NOT exceed uint16 value
1047#[derive(::serde::Serialize, ::serde::Deserialize)]
1048#[derive(Ord, PartialOrd)]
1049#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1050pub struct SocketAddress {
1051    #[prost(message, required, tag = "1")]
1052    pub ip: IpAddress,
1053    #[prost(uint32, required, tag = "2")]
1054    pub port: u32,
1055}
1056#[derive(::serde::Serialize, ::serde::Deserialize)]
1057#[derive(Ord, PartialOrd)]
1058#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1059pub struct IpAddress {
1060    #[prost(oneof = "ip_address::Inner", tags = "1, 2")]
1061    pub inner: ::core::option::Option<ip_address::Inner>,
1062}
1063/// Nested message and enum types in `IpAddress`.
1064pub mod ip_address {
1065    #[derive(::serde::Serialize, ::serde::Deserialize)]
1066    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1067    #[derive(Ord, PartialOrd)]
1068    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
1069    pub enum Inner {
1070        #[prost(fixed32, tag = "1")]
1071        V4(u32),
1072        #[prost(message, tag = "2")]
1073        V6(super::Uint128),
1074    }
1075}
1076/// used to represent the 128 bits of an IPv6 address
1077#[derive(::serde::Serialize, ::serde::Deserialize)]
1078#[derive(Ord, PartialOrd)]
1079#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1080pub struct Uint128 {
1081    /// higher value, first 8 bytes of the ip
1082    #[prost(uint64, required, tag = "1")]
1083    pub low: u64,
1084    /// lower value, last 8 bytes of the ip
1085    #[prost(uint64, required, tag = "2")]
1086    pub high: u64,
1087}
1088/// This is sent only from Sōzu to Sōzu
1089#[derive(::serde::Serialize, ::serde::Deserialize)]
1090#[derive(Ord, PartialOrd)]
1091#[derive(Hash, Eq)]
1092#[derive(Clone, PartialEq, ::prost::Message)]
1093pub struct WorkerRequest {
1094    #[prost(string, required, tag = "1")]
1095    pub id: ::prost::alloc::string::String,
1096    #[prost(message, required, tag = "2")]
1097    pub content: Request,
1098}
1099/// A response as sent by a worker
1100#[derive(::serde::Serialize, ::serde::Deserialize)]
1101#[derive(Ord, PartialOrd)]
1102#[derive(Hash, Eq)]
1103#[derive(Clone, PartialEq, ::prost::Message)]
1104pub struct WorkerResponse {
1105    #[prost(string, required, tag = "1")]
1106    pub id: ::prost::alloc::string::String,
1107    #[prost(enumeration = "ResponseStatus", required, tag = "2")]
1108    pub status: i32,
1109    /// an associated message to detail failure, success or processing
1110    #[prost(string, required, tag = "3")]
1111    pub message: ::prost::alloc::string::String,
1112    #[prost(message, optional, tag = "4")]
1113    pub content: ::core::option::Option<ResponseContent>,
1114}
1115/// intended to workers
1116#[derive(::serde::Serialize, ::serde::Deserialize)]
1117#[derive(Ord, PartialOrd)]
1118#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1119pub struct ServerMetricsConfig {
1120    #[prost(string, required, tag = "1")]
1121    pub address: ::prost::alloc::string::String,
1122    #[prost(bool, required, tag = "2")]
1123    pub tagged_metrics: bool,
1124    #[prost(string, optional, tag = "3")]
1125    pub prefix: ::core::option::Option<::prost::alloc::string::String>,
1126}
1127/// Used by a worker to start its server loop.
1128/// The defaults should match those of the config module
1129#[derive(::serde::Serialize, ::serde::Deserialize)]
1130#[derive(Ord, PartialOrd)]
1131#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1132pub struct ServerConfig {
1133    #[prost(uint64, required, tag = "1", default = "10000")]
1134    pub max_connections: u64,
1135    #[prost(uint32, required, tag = "2", default = "60")]
1136    pub front_timeout: u32,
1137    #[prost(uint32, required, tag = "3", default = "30")]
1138    pub back_timeout: u32,
1139    #[prost(uint32, required, tag = "4", default = "3")]
1140    pub connect_timeout: u32,
1141    #[prost(uint32, required, tag = "5", default = "1800")]
1142    pub zombie_check_interval: u32,
1143    #[prost(uint32, required, tag = "6", default = "60")]
1144    pub accept_queue_timeout: u32,
1145    #[prost(uint64, required, tag = "7", default = "1")]
1146    pub min_buffers: u64,
1147    #[prost(uint64, required, tag = "8", default = "1000")]
1148    pub max_buffers: u64,
1149    #[prost(uint64, required, tag = "9", default = "16393")]
1150    pub buffer_size: u64,
1151    #[prost(string, required, tag = "10", default = "info")]
1152    pub log_level: ::prost::alloc::string::String,
1153    #[prost(string, required, tag = "11", default = "stdout")]
1154    pub log_target: ::prost::alloc::string::String,
1155    #[prost(string, optional, tag = "12")]
1156    pub access_logs_target: ::core::option::Option<::prost::alloc::string::String>,
1157    #[prost(uint64, required, tag = "13", default = "1000000")]
1158    pub command_buffer_size: u64,
1159    #[prost(uint64, required, tag = "14", default = "2000000")]
1160    pub max_command_buffer_size: u64,
1161    #[prost(message, optional, tag = "15")]
1162    pub metrics: ::core::option::Option<ServerMetricsConfig>,
1163    #[prost(enumeration = "ProtobufAccessLogFormat", required, tag = "16")]
1164    pub access_log_format: i32,
1165    #[prost(bool, required, tag = "17")]
1166    pub log_colored: bool,
1167}
1168/// Addresses of listeners, passed to new workers
1169#[derive(::serde::Serialize, ::serde::Deserialize)]
1170#[derive(Ord, PartialOrd)]
1171#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1172pub struct ListenersCount {
1173    /// socket addresses of HTTP listeners
1174    #[prost(string, repeated, tag = "1")]
1175    pub http: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1176    /// socket addresses of HTTPS listeners
1177    #[prost(string, repeated, tag = "2")]
1178    pub tls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1179    /// socket addresses of TCP listeners
1180    #[prost(string, repeated, tag = "3")]
1181    pub tcp: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1182}
1183/// the Sōzu state, passed to a new worker.
1184/// Consists in a collection of worker requests
1185#[derive(::serde::Serialize, ::serde::Deserialize)]
1186#[derive(Ord, PartialOrd)]
1187#[derive(Hash, Eq)]
1188#[derive(Clone, PartialEq, ::prost::Message)]
1189pub struct InitialState {
1190    #[prost(message, repeated, tag = "1")]
1191    pub requests: ::prost::alloc::vec::Vec<WorkerRequest>,
1192}
1193#[derive(::serde::Serialize, ::serde::Deserialize)]
1194#[derive(Ord, PartialOrd)]
1195#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1196pub struct OpenTelemetry {
1197    #[prost(string, required, tag = "1")]
1198    pub trace_id: ::prost::alloc::string::String,
1199    #[prost(string, required, tag = "2")]
1200    pub span_id: ::prost::alloc::string::String,
1201    #[prost(string, optional, tag = "3")]
1202    pub parent_span_id: ::core::option::Option<::prost::alloc::string::String>,
1203}
1204/// An access log, meant to be passed to another agent
1205#[derive(::serde::Serialize, ::serde::Deserialize)]
1206#[derive(Ord, PartialOrd)]
1207#[derive(Hash, Eq)]
1208#[derive(Clone, PartialEq, ::prost::Message)]
1209pub struct ProtobufAccessLog {
1210    /// error message if any
1211    #[prost(string, optional, tag = "1")]
1212    pub message: ::core::option::Option<::prost::alloc::string::String>,
1213    /// LogContext = request_id + cluster_id + backend_id
1214    #[prost(message, required, tag = "2")]
1215    pub request_id: Uint128,
1216    /// id of the cluster (set of frontend, backend, routing rules)
1217    #[prost(string, optional, tag = "3")]
1218    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
1219    /// id of the backend (the server to which the traffic is redirected)
1220    #[prost(string, optional, tag = "4")]
1221    pub backend_id: ::core::option::Option<::prost::alloc::string::String>,
1222    /// ip and port of the client
1223    #[prost(message, optional, tag = "5")]
1224    pub session_address: ::core::option::Option<SocketAddress>,
1225    /// socket address of the backend server
1226    #[prost(message, optional, tag = "6")]
1227    pub backend_address: ::core::option::Option<SocketAddress>,
1228    /// the protocol, with SSL/TLS version, for instance "HTTPS-TLS1.1"
1229    #[prost(string, required, tag = "7")]
1230    pub protocol: ::prost::alloc::string::String,
1231    /// TCP or HTTP endpoint (method, path, context...)
1232    #[prost(message, required, tag = "8")]
1233    pub endpoint: ProtobufEndpoint,
1234    /// round trip time for the client (microseconds)
1235    #[prost(uint64, optional, tag = "9")]
1236    pub client_rtt: ::core::option::Option<u64>,
1237    /// round trip time for the backend (microseconds)
1238    #[prost(uint64, optional, tag = "10")]
1239    pub server_rtt: ::core::option::Option<u64>,
1240    /// time spent on a session (microseconds)
1241    #[prost(uint64, required, tag = "13")]
1242    pub service_time: u64,
1243    /// number of bytes received from the client
1244    #[prost(uint64, required, tag = "14")]
1245    pub bytes_in: u64,
1246    /// number of bytes written to the client
1247    #[prost(uint64, required, tag = "15")]
1248    pub bytes_out: u64,
1249    /// value of the User-Agent header, if any
1250    #[prost(string, optional, tag = "16")]
1251    pub user_agent: ::core::option::Option<::prost::alloc::string::String>,
1252    /// custom tags as key-values, for instance owner_id: MyOrganisation
1253    #[prost(btree_map = "string, string", tag = "17")]
1254    pub tags: ::prost::alloc::collections::BTreeMap<
1255        ::prost::alloc::string::String,
1256        ::prost::alloc::string::String,
1257    >,
1258    /// short description of which process sends the log, for instance: "WRK-02"
1259    #[prost(string, required, tag = "18")]
1260    pub tag: ::prost::alloc::string::String,
1261    /// POSIX timestamp, nanoseconds
1262    #[prost(message, required, tag = "19")]
1263    pub time: Uint128,
1264    /// Entire time between first byte received and last byte of the response.
1265    /// If a request ends abruptly before the last byte is transmitted,
1266    /// the `request_time` produced is the time elapsed since the first byte received.
1267    #[prost(uint64, optional, tag = "20")]
1268    pub request_time: ::core::option::Option<u64>,
1269    /// time for the backend to respond (microseconds)
1270    #[prost(uint64, optional, tag = "21")]
1271    pub response_time: ::core::option::Option<u64>,
1272    /// OpenTelemetry tracing information
1273    #[prost(message, optional, tag = "22")]
1274    pub otel: ::core::option::Option<OpenTelemetry>,
1275}
1276#[derive(::serde::Serialize, ::serde::Deserialize)]
1277#[derive(Ord, PartialOrd)]
1278#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1279pub struct ProtobufEndpoint {
1280    #[prost(oneof = "protobuf_endpoint::Inner", tags = "1, 2")]
1281    pub inner: ::core::option::Option<protobuf_endpoint::Inner>,
1282}
1283/// Nested message and enum types in `ProtobufEndpoint`.
1284pub mod protobuf_endpoint {
1285    #[derive(::serde::Serialize, ::serde::Deserialize)]
1286    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1287    #[derive(Ord, PartialOrd)]
1288    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1289    pub enum Inner {
1290        #[prost(message, tag = "1")]
1291        Http(super::HttpEndpoint),
1292        #[prost(message, tag = "2")]
1293        Tcp(super::TcpEndpoint),
1294    }
1295}
1296#[derive(::serde::Serialize, ::serde::Deserialize)]
1297#[derive(Ord, PartialOrd)]
1298#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1299pub struct HttpEndpoint {
1300    #[prost(string, optional, tag = "1")]
1301    pub method: ::core::option::Option<::prost::alloc::string::String>,
1302    #[prost(string, optional, tag = "2")]
1303    pub authority: ::core::option::Option<::prost::alloc::string::String>,
1304    #[prost(string, optional, tag = "3")]
1305    pub path: ::core::option::Option<::prost::alloc::string::String>,
1306    /// warning: this should be a u16 but protobuf only has uint32.
1307    /// Make sure the value never exceeds u16 bounds.
1308    #[prost(uint32, optional, tag = "4")]
1309    pub status: ::core::option::Option<u32>,
1310    #[prost(string, optional, tag = "5")]
1311    pub reason: ::core::option::Option<::prost::alloc::string::String>,
1312}
1313#[derive(::serde::Serialize, ::serde::Deserialize)]
1314#[derive(Ord, PartialOrd)]
1315#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1316pub struct TcpEndpoint {}
1317#[derive(::serde::Serialize, ::serde::Deserialize)]
1318#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1319#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1320#[repr(i32)]
1321pub enum ListenerType {
1322    Http = 0,
1323    Https = 1,
1324    Tcp = 2,
1325}
1326impl ListenerType {
1327    /// String value of the enum field names used in the ProtoBuf definition.
1328    ///
1329    /// The values are not transformed in any way and thus are considered stable
1330    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1331    pub fn as_str_name(&self) -> &'static str {
1332        match self {
1333            Self::Http => "HTTP",
1334            Self::Https => "HTTPS",
1335            Self::Tcp => "TCP",
1336        }
1337    }
1338    /// Creates an enum from field names used in the ProtoBuf definition.
1339    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1340        match value {
1341            "HTTP" => Some(Self::Http),
1342            "HTTPS" => Some(Self::Https),
1343            "TCP" => Some(Self::Tcp),
1344            _ => None,
1345        }
1346    }
1347}
1348/// The kind of filter used for path rules
1349#[derive(::serde::Serialize, ::serde::Deserialize)]
1350#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1351#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1352#[repr(i32)]
1353pub enum PathRuleKind {
1354    /// filters paths that start with a pattern, typically "/api"
1355    Prefix = 0,
1356    /// filters paths that match a regex pattern
1357    Regex = 1,
1358    /// filters paths that exactly match a pattern, no more, no less
1359    Equals = 2,
1360}
1361impl PathRuleKind {
1362    /// String value of the enum field names used in the ProtoBuf definition.
1363    ///
1364    /// The values are not transformed in any way and thus are considered stable
1365    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1366    pub fn as_str_name(&self) -> &'static str {
1367        match self {
1368            Self::Prefix => "PREFIX",
1369            Self::Regex => "REGEX",
1370            Self::Equals => "EQUALS",
1371        }
1372    }
1373    /// Creates an enum from field names used in the ProtoBuf definition.
1374    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1375        match value {
1376            "PREFIX" => Some(Self::Prefix),
1377            "REGEX" => Some(Self::Regex),
1378            "EQUALS" => Some(Self::Equals),
1379            _ => None,
1380        }
1381    }
1382}
1383/// TODO: find a proper definition for this
1384#[derive(::serde::Serialize, ::serde::Deserialize)]
1385#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1386#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1387#[repr(i32)]
1388pub enum RulePosition {
1389    Pre = 0,
1390    Post = 1,
1391    Tree = 2,
1392}
1393impl RulePosition {
1394    /// String value of the enum field names used in the ProtoBuf definition.
1395    ///
1396    /// The values are not transformed in any way and thus are considered stable
1397    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1398    pub fn as_str_name(&self) -> &'static str {
1399        match self {
1400            Self::Pre => "PRE",
1401            Self::Post => "POST",
1402            Self::Tree => "TREE",
1403        }
1404    }
1405    /// Creates an enum from field names used in the ProtoBuf definition.
1406    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1407        match value {
1408            "PRE" => Some(Self::Pre),
1409            "POST" => Some(Self::Post),
1410            "TREE" => Some(Self::Tree),
1411            _ => None,
1412        }
1413    }
1414}
1415#[derive(::serde::Serialize, ::serde::Deserialize)]
1416#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1417#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1418#[repr(i32)]
1419pub enum TlsVersion {
1420    SslV2 = 0,
1421    SslV3 = 1,
1422    TlsV10 = 2,
1423    TlsV11 = 3,
1424    TlsV12 = 4,
1425    TlsV13 = 5,
1426}
1427impl TlsVersion {
1428    /// String value of the enum field names used in the ProtoBuf definition.
1429    ///
1430    /// The values are not transformed in any way and thus are considered stable
1431    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1432    pub fn as_str_name(&self) -> &'static str {
1433        match self {
1434            Self::SslV2 => "SSL_V2",
1435            Self::SslV3 => "SSL_V3",
1436            Self::TlsV10 => "TLS_V1_0",
1437            Self::TlsV11 => "TLS_V1_1",
1438            Self::TlsV12 => "TLS_V1_2",
1439            Self::TlsV13 => "TLS_V1_3",
1440        }
1441    }
1442    /// Creates an enum from field names used in the ProtoBuf definition.
1443    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1444        match value {
1445            "SSL_V2" => Some(Self::SslV2),
1446            "SSL_V3" => Some(Self::SslV3),
1447            "TLS_V1_0" => Some(Self::TlsV10),
1448            "TLS_V1_1" => Some(Self::TlsV11),
1449            "TLS_V1_2" => Some(Self::TlsV12),
1450            "TLS_V1_3" => Some(Self::TlsV13),
1451            _ => None,
1452        }
1453    }
1454}
1455#[derive(::serde::Serialize, ::serde::Deserialize)]
1456#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1457#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1458#[repr(i32)]
1459pub enum LoadBalancingAlgorithms {
1460    RoundRobin = 0,
1461    Random = 1,
1462    LeastLoaded = 2,
1463    PowerOfTwo = 3,
1464}
1465impl LoadBalancingAlgorithms {
1466    /// String value of the enum field names used in the ProtoBuf definition.
1467    ///
1468    /// The values are not transformed in any way and thus are considered stable
1469    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1470    pub fn as_str_name(&self) -> &'static str {
1471        match self {
1472            Self::RoundRobin => "ROUND_ROBIN",
1473            Self::Random => "RANDOM",
1474            Self::LeastLoaded => "LEAST_LOADED",
1475            Self::PowerOfTwo => "POWER_OF_TWO",
1476        }
1477    }
1478    /// Creates an enum from field names used in the ProtoBuf definition.
1479    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1480        match value {
1481            "ROUND_ROBIN" => Some(Self::RoundRobin),
1482            "RANDOM" => Some(Self::Random),
1483            "LEAST_LOADED" => Some(Self::LeastLoaded),
1484            "POWER_OF_TWO" => Some(Self::PowerOfTwo),
1485            _ => None,
1486        }
1487    }
1488}
1489#[derive(::serde::Serialize, ::serde::Deserialize)]
1490#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1491#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1492#[repr(i32)]
1493pub enum ProxyProtocolConfig {
1494    ExpectHeader = 0,
1495    SendHeader = 1,
1496    RelayHeader = 2,
1497}
1498impl ProxyProtocolConfig {
1499    /// String value of the enum field names used in the ProtoBuf definition.
1500    ///
1501    /// The values are not transformed in any way and thus are considered stable
1502    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1503    pub fn as_str_name(&self) -> &'static str {
1504        match self {
1505            Self::ExpectHeader => "EXPECT_HEADER",
1506            Self::SendHeader => "SEND_HEADER",
1507            Self::RelayHeader => "RELAY_HEADER",
1508        }
1509    }
1510    /// Creates an enum from field names used in the ProtoBuf definition.
1511    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1512        match value {
1513            "EXPECT_HEADER" => Some(Self::ExpectHeader),
1514            "SEND_HEADER" => Some(Self::SendHeader),
1515            "RELAY_HEADER" => Some(Self::RelayHeader),
1516            _ => None,
1517        }
1518    }
1519}
1520/// how sozu measures which backend is less loaded
1521#[derive(::serde::Serialize, ::serde::Deserialize)]
1522#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1523#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1524#[repr(i32)]
1525pub enum LoadMetric {
1526    /// number of TCP connections
1527    Connections = 0,
1528    /// number of active HTTP requests
1529    Requests = 1,
1530    /// time to connect to the backend, weighted by the number of active connections (peak EWMA)
1531    ConnectionTime = 2,
1532}
1533impl LoadMetric {
1534    /// String value of the enum field names used in the ProtoBuf definition.
1535    ///
1536    /// The values are not transformed in any way and thus are considered stable
1537    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1538    pub fn as_str_name(&self) -> &'static str {
1539        match self {
1540            Self::Connections => "CONNECTIONS",
1541            Self::Requests => "REQUESTS",
1542            Self::ConnectionTime => "CONNECTION_TIME",
1543        }
1544    }
1545    /// Creates an enum from field names used in the ProtoBuf definition.
1546    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1547        match value {
1548            "CONNECTIONS" => Some(Self::Connections),
1549            "REQUESTS" => Some(Self::Requests),
1550            "CONNECTION_TIME" => Some(Self::ConnectionTime),
1551            _ => None,
1552        }
1553    }
1554}
1555/// options to configure metrics collection
1556#[derive(::serde::Serialize, ::serde::Deserialize)]
1557#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1558#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1559#[repr(i32)]
1560pub enum MetricsConfiguration {
1561    /// enable metrics collection
1562    Enabled = 0,
1563    /// disable metrics collection
1564    Disabled = 1,
1565    /// wipe the metrics memory
1566    Clear = 2,
1567}
1568impl MetricsConfiguration {
1569    /// String value of the enum field names used in the ProtoBuf definition.
1570    ///
1571    /// The values are not transformed in any way and thus are considered stable
1572    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1573    pub fn as_str_name(&self) -> &'static str {
1574        match self {
1575            Self::Enabled => "ENABLED",
1576            Self::Disabled => "DISABLED",
1577            Self::Clear => "CLEAR",
1578        }
1579    }
1580    /// Creates an enum from field names used in the ProtoBuf definition.
1581    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1582        match value {
1583            "ENABLED" => Some(Self::Enabled),
1584            "DISABLED" => Some(Self::Disabled),
1585            "CLEAR" => Some(Self::Clear),
1586            _ => None,
1587        }
1588    }
1589}
1590#[derive(::serde::Serialize, ::serde::Deserialize)]
1591#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1592#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1593#[repr(i32)]
1594pub enum EventKind {
1595    BackendDown = 0,
1596    BackendUp = 1,
1597    NoAvailableBackends = 2,
1598    RemovedBackendHasNoConnections = 3,
1599}
1600impl EventKind {
1601    /// String value of the enum field names used in the ProtoBuf definition.
1602    ///
1603    /// The values are not transformed in any way and thus are considered stable
1604    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1605    pub fn as_str_name(&self) -> &'static str {
1606        match self {
1607            Self::BackendDown => "BACKEND_DOWN",
1608            Self::BackendUp => "BACKEND_UP",
1609            Self::NoAvailableBackends => "NO_AVAILABLE_BACKENDS",
1610            Self::RemovedBackendHasNoConnections => "REMOVED_BACKEND_HAS_NO_CONNECTIONS",
1611        }
1612    }
1613    /// Creates an enum from field names used in the ProtoBuf definition.
1614    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1615        match value {
1616            "BACKEND_DOWN" => Some(Self::BackendDown),
1617            "BACKEND_UP" => Some(Self::BackendUp),
1618            "NO_AVAILABLE_BACKENDS" => Some(Self::NoAvailableBackends),
1619            "REMOVED_BACKEND_HAS_NO_CONNECTIONS" => {
1620                Some(Self::RemovedBackendHasNoConnections)
1621            }
1622            _ => None,
1623        }
1624    }
1625}
1626#[derive(::serde::Serialize, ::serde::Deserialize)]
1627#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1628#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1629#[repr(i32)]
1630pub enum ResponseStatus {
1631    Ok = 0,
1632    Processing = 1,
1633    Failure = 2,
1634}
1635impl ResponseStatus {
1636    /// String value of the enum field names used in the ProtoBuf definition.
1637    ///
1638    /// The values are not transformed in any way and thus are considered stable
1639    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1640    pub fn as_str_name(&self) -> &'static str {
1641        match self {
1642            Self::Ok => "OK",
1643            Self::Processing => "PROCESSING",
1644            Self::Failure => "FAILURE",
1645        }
1646    }
1647    /// Creates an enum from field names used in the ProtoBuf definition.
1648    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1649        match value {
1650            "OK" => Some(Self::Ok),
1651            "PROCESSING" => Some(Self::Processing),
1652            "FAILURE" => Some(Self::Failure),
1653            _ => None,
1654        }
1655    }
1656}
1657/// Runstate of a worker
1658#[derive(::serde::Serialize, ::serde::Deserialize)]
1659#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1660#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1661#[repr(i32)]
1662pub enum RunState {
1663    Running = 0,
1664    Stopping = 1,
1665    Stopped = 2,
1666    NotAnswering = 3,
1667}
1668impl RunState {
1669    /// String value of the enum field names used in the ProtoBuf definition.
1670    ///
1671    /// The values are not transformed in any way and thus are considered stable
1672    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1673    pub fn as_str_name(&self) -> &'static str {
1674        match self {
1675            Self::Running => "RUNNING",
1676            Self::Stopping => "STOPPING",
1677            Self::Stopped => "STOPPED",
1678            Self::NotAnswering => "NOT_ANSWERING",
1679        }
1680    }
1681    /// Creates an enum from field names used in the ProtoBuf definition.
1682    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1683        match value {
1684            "RUNNING" => Some(Self::Running),
1685            "STOPPING" => Some(Self::Stopping),
1686            "STOPPED" => Some(Self::Stopped),
1687            "NOT_ANSWERING" => Some(Self::NotAnswering),
1688            _ => None,
1689        }
1690    }
1691}
1692#[derive(::serde::Serialize, ::serde::Deserialize)]
1693#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1694#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1695#[repr(i32)]
1696pub enum ProtobufAccessLogFormat {
1697    Ascii = 1,
1698    Protobuf = 2,
1699}
1700impl ProtobufAccessLogFormat {
1701    /// String value of the enum field names used in the ProtoBuf definition.
1702    ///
1703    /// The values are not transformed in any way and thus are considered stable
1704    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1705    pub fn as_str_name(&self) -> &'static str {
1706        match self {
1707            Self::Ascii => "Ascii",
1708            Self::Protobuf => "Protobuf",
1709        }
1710    }
1711    /// Creates an enum from field names used in the ProtoBuf definition.
1712    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1713        match value {
1714            "Ascii" => Some(Self::Ascii),
1715            "Protobuf" => Some(Self::Protobuf),
1716            _ => None,
1717        }
1718    }
1719}