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