linkerd2_proxy_api/gen/
io.linkerd.proxy.outbound.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct TrafficSpec {
4    /// Uniquely identifies the source proxy workload (e.g., pod name) to the
5    /// control plane.
6    #[prost(string, tag = "1")]
7    pub source_workload: ::prost::alloc::string::String,
8    /// Describes a target address, as observed by the proxy.
9    #[prost(oneof = "traffic_spec::Target", tags = "2, 3")]
10    pub target: ::core::option::Option<traffic_spec::Target>,
11}
12/// Nested message and enum types in `TrafficSpec`.
13pub mod traffic_spec {
14    /// Describes a target address, as observed by the proxy.
15    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
16    pub enum Target {
17        /// Indicates the proxy is connecting to a specific IP:port.
18        #[prost(message, tag = "2")]
19        Addr(super::super::net::TcpAddress),
20        /// Indicates the proxy is connecting to a named address (like an HTTP
21        /// authority).
22        #[prost(string, tag = "3")]
23        Authority(::prost::alloc::string::String),
24    }
25}
26/// Outbound policy for a given traffic spec.
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct OutboundPolicy {
29    /// Indicates the protocol to use for this target. This will be set to Opaque
30    /// if the target has been marked as opaque and will be Discover otherwise.
31    #[prost(message, optional, tag = "1")]
32    pub protocol: ::core::option::Option<ProxyProtocol>,
33    /// Describes the resource for which outbound policy has been discovered.
34    #[prost(message, optional, tag = "2")]
35    pub metadata: ::core::option::Option<super::meta::Metadata>,
36}
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct ProxyProtocol {
39    #[prost(oneof = "proxy_protocol::Kind", tags = "1, 2, 3, 4, 5, 6")]
40    pub kind: ::core::option::Option<proxy_protocol::Kind>,
41}
42/// Nested message and enum types in `ProxyProtocol`.
43pub mod proxy_protocol {
44    #[derive(Clone, PartialEq, ::prost::Message)]
45    pub struct Detect {
46        /// Protocol detection timeout.
47        #[prost(message, optional, tag = "1")]
48        pub timeout: ::core::option::Option<::prost_types::Duration>,
49        #[prost(message, optional, tag = "2")]
50        pub opaque: ::core::option::Option<Opaque>,
51        /// HTTP/1 policy configuration.
52        #[prost(message, optional, tag = "3")]
53        pub http1: ::core::option::Option<Http1>,
54        /// HTTP/2 policy configuration.
55        #[prost(message, optional, tag = "4")]
56        pub http2: ::core::option::Option<Http2>,
57    }
58    #[derive(Clone, PartialEq, ::prost::Message)]
59    pub struct Opaque {
60        #[prost(message, repeated, tag = "1")]
61        pub routes: ::prost::alloc::vec::Vec<super::OpaqueRoute>,
62    }
63    #[derive(Clone, PartialEq, ::prost::Message)]
64    pub struct Http1 {
65        #[prost(message, repeated, tag = "1")]
66        pub routes: ::prost::alloc::vec::Vec<super::HttpRoute>,
67        /// If empty, circuit breaking is not performed.
68        #[prost(message, optional, tag = "2")]
69        pub failure_accrual: ::core::option::Option<super::FailureAccrual>,
70    }
71    #[derive(Clone, PartialEq, ::prost::Message)]
72    pub struct Http2 {
73        #[prost(message, repeated, tag = "1")]
74        pub routes: ::prost::alloc::vec::Vec<super::HttpRoute>,
75        /// If empty, circuit breaking is not performed.
76        #[prost(message, optional, tag = "2")]
77        pub failure_accrual: ::core::option::Option<super::FailureAccrual>,
78    }
79    #[derive(Clone, PartialEq, ::prost::Message)]
80    pub struct Grpc {
81        #[prost(message, repeated, tag = "1")]
82        pub routes: ::prost::alloc::vec::Vec<super::GrpcRoute>,
83        /// If empty, circuit breaking is not performed.
84        #[prost(message, optional, tag = "2")]
85        pub failure_accrual: ::core::option::Option<super::FailureAccrual>,
86    }
87    #[derive(Clone, PartialEq, ::prost::Message)]
88    pub struct Tls {
89        #[prost(message, repeated, tag = "1")]
90        pub routes: ::prost::alloc::vec::Vec<super::TlsRoute>,
91    }
92    #[derive(Clone, PartialEq, ::prost::Oneof)]
93    pub enum Kind {
94        #[prost(message, tag = "1")]
95        Detect(Detect),
96        #[prost(message, tag = "2")]
97        Opaque(Opaque),
98        /// HTTP/1 policy configuration.
99        #[prost(message, tag = "3")]
100        Http1(Http1),
101        /// HTTP/2 policy configuration.
102        #[prost(message, tag = "4")]
103        Http2(Http2),
104        /// gRPC policy configuration.
105        #[prost(message, tag = "5")]
106        Grpc(Grpc),
107        /// TLS policy configuration.
108        #[prost(message, tag = "6")]
109        Tls(Tls),
110    }
111}
112/// Outbound-specific HTTP route configuration (based on the
113/// [Gateway API](<https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.HTTPRoute>)).
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct HttpRoute {
116    #[prost(message, optional, tag = "1")]
117    pub metadata: ::core::option::Option<super::meta::Metadata>,
118    /// If empty, the host value is ignored.
119    #[prost(message, repeated, tag = "2")]
120    pub hosts: ::prost::alloc::vec::Vec<super::http_route::HostMatch>,
121    /// Must have at least one rule.
122    #[prost(message, repeated, tag = "3")]
123    pub rules: ::prost::alloc::vec::Vec<http_route::Rule>,
124}
125/// Nested message and enum types in `HttpRoute`.
126pub mod http_route {
127    #[derive(Clone, PartialEq, ::prost::Message)]
128    pub struct Rule {
129        #[prost(message, repeated, tag = "1")]
130        pub matches: ::prost::alloc::vec::Vec<super::super::http_route::HttpRouteMatch>,
131        #[prost(message, repeated, tag = "2")]
132        pub filters: ::prost::alloc::vec::Vec<Filter>,
133        #[prost(message, optional, tag = "3")]
134        pub backends: ::core::option::Option<Distribution>,
135        /// DEPRECATED: use `timeouts` instead. Servers should continue to set this
136        /// value to the same value as `timeouts.response`.
137        #[deprecated]
138        #[prost(message, optional, tag = "4")]
139        pub request_timeout: ::core::option::Option<::prost_types::Duration>,
140        #[prost(message, optional, tag = "5")]
141        pub timeouts: ::core::option::Option<super::super::http_route::Timeouts>,
142        #[prost(message, optional, tag = "6")]
143        pub retry: ::core::option::Option<Retry>,
144        /// If true, the proxy will allow headers to control retry and timeout
145        /// behavior.
146        #[prost(bool, tag = "7")]
147        pub allow_l5d_request_headers: bool,
148    }
149    #[derive(Clone, PartialEq, ::prost::Message)]
150    pub struct Filter {
151        #[prost(oneof = "filter::Kind", tags = "1, 2, 3, 4")]
152        pub kind: ::core::option::Option<filter::Kind>,
153    }
154    /// Nested message and enum types in `Filter`.
155    pub mod filter {
156        #[derive(Clone, PartialEq, ::prost::Oneof)]
157        pub enum Kind {
158            #[prost(message, tag = "1")]
159            FailureInjector(super::super::super::http_route::HttpFailureInjector),
160            #[prost(message, tag = "2")]
161            RequestHeaderModifier(
162                super::super::super::http_route::RequestHeaderModifier,
163            ),
164            #[prost(message, tag = "3")]
165            Redirect(super::super::super::http_route::RequestRedirect),
166            #[prost(message, tag = "4")]
167            ResponseHeaderModifier(
168                super::super::super::http_route::ResponseHeaderModifier,
169            ),
170        }
171    }
172    #[derive(Clone, PartialEq, ::prost::Message)]
173    pub struct Distribution {
174        #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
175        pub kind: ::core::option::Option<distribution::Kind>,
176    }
177    /// Nested message and enum types in `Distribution`.
178    pub mod distribution {
179        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
180        pub struct Empty {}
181        #[derive(Clone, PartialEq, ::prost::Message)]
182        pub struct FirstAvailable {
183            #[prost(message, repeated, tag = "1")]
184            pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
185        }
186        #[derive(Clone, PartialEq, ::prost::Message)]
187        pub struct RandomAvailable {
188            #[prost(message, repeated, tag = "1")]
189            pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
190        }
191        #[derive(Clone, PartialEq, ::prost::Oneof)]
192        pub enum Kind {
193            #[prost(message, tag = "1")]
194            Empty(Empty),
195            /// Use the first available backend in the list.
196            #[prost(message, tag = "2")]
197            FirstAvailable(FirstAvailable),
198            #[prost(message, tag = "3")]
199            RandomAvailable(RandomAvailable),
200        }
201    }
202    #[derive(Clone, PartialEq, ::prost::Message)]
203    pub struct Retry {
204        #[prost(uint32, tag = "1")]
205        pub max_retries: u32,
206        #[prost(uint32, tag = "2")]
207        pub max_request_bytes: u32,
208        /// Must be set, even if there are no internal conditions.
209        #[prost(message, optional, tag = "3")]
210        pub conditions: ::core::option::Option<retry::Conditions>,
211        #[prost(message, optional, tag = "4")]
212        pub timeout: ::core::option::Option<::prost_types::Duration>,
213        #[prost(message, optional, tag = "5")]
214        pub backoff: ::core::option::Option<super::ExponentialBackoff>,
215    }
216    /// Nested message and enum types in `Retry`.
217    pub mod retry {
218        /// Retryable conditions.
219        #[derive(Clone, PartialEq, ::prost::Message)]
220        pub struct Conditions {
221            /// Specifies the status code ranges that should trigger a retry.
222            #[prost(message, repeated, tag = "1")]
223            pub status_ranges: ::prost::alloc::vec::Vec<conditions::StatusRange>,
224        }
225        /// Nested message and enum types in `Conditions`.
226        pub mod conditions {
227            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
228            pub struct StatusRange {
229                #[prost(uint32, tag = "1")]
230                pub start: u32,
231                #[prost(uint32, tag = "2")]
232                pub end: u32,
233            }
234        }
235    }
236    #[derive(Clone, PartialEq, ::prost::Message)]
237    pub struct RouteBackend {
238        #[prost(message, optional, tag = "1")]
239        pub backend: ::core::option::Option<super::Backend>,
240        #[prost(message, repeated, tag = "3")]
241        pub filters: ::prost::alloc::vec::Vec<Filter>,
242        /// DEPRECATED: proxies ignore this. Use Retry timeouts instead.
243        #[deprecated]
244        #[prost(message, optional, tag = "4")]
245        pub request_timeout: ::core::option::Option<::prost_types::Duration>,
246    }
247    #[derive(Clone, PartialEq, ::prost::Message)]
248    pub struct WeightedRouteBackend {
249        #[prost(message, optional, tag = "1")]
250        pub backend: ::core::option::Option<RouteBackend>,
251        #[prost(uint32, tag = "2")]
252        pub weight: u32,
253    }
254}
255#[derive(Clone, PartialEq, ::prost::Message)]
256pub struct GrpcRoute {
257    #[prost(message, optional, tag = "1")]
258    pub metadata: ::core::option::Option<super::meta::Metadata>,
259    /// If empty, the host value is ignored.
260    #[prost(message, repeated, tag = "2")]
261    pub hosts: ::prost::alloc::vec::Vec<super::http_route::HostMatch>,
262    /// Must have at least one rule.
263    #[prost(message, repeated, tag = "3")]
264    pub rules: ::prost::alloc::vec::Vec<grpc_route::Rule>,
265}
266/// Nested message and enum types in `GrpcRoute`.
267pub mod grpc_route {
268    #[derive(Clone, PartialEq, ::prost::Message)]
269    pub struct Rule {
270        #[prost(message, repeated, tag = "1")]
271        pub matches: ::prost::alloc::vec::Vec<super::super::grpc_route::GrpcRouteMatch>,
272        #[prost(message, repeated, tag = "2")]
273        pub filters: ::prost::alloc::vec::Vec<Filter>,
274        #[prost(message, optional, tag = "3")]
275        pub backends: ::core::option::Option<Distribution>,
276        /// DEPRECATED: use `timeouts` instead. Servers should continue to set this
277        /// value to the same value as `timeouts.response`.
278        #[deprecated]
279        #[prost(message, optional, tag = "4")]
280        pub request_timeout: ::core::option::Option<::prost_types::Duration>,
281        #[prost(message, optional, tag = "5")]
282        pub timeouts: ::core::option::Option<super::super::http_route::Timeouts>,
283        #[prost(message, optional, tag = "6")]
284        pub retry: ::core::option::Option<Retry>,
285        /// If true, the proxy will allow headers to control retry and timeout
286        /// behavior.
287        #[prost(bool, tag = "7")]
288        pub allow_l5d_request_headers: bool,
289    }
290    #[derive(Clone, PartialEq, ::prost::Message)]
291    pub struct Filter {
292        #[prost(oneof = "filter::Kind", tags = "1, 2")]
293        pub kind: ::core::option::Option<filter::Kind>,
294    }
295    /// Nested message and enum types in `Filter`.
296    pub mod filter {
297        #[derive(Clone, PartialEq, ::prost::Oneof)]
298        pub enum Kind {
299            #[prost(message, tag = "1")]
300            FailureInjector(super::super::super::grpc_route::GrpcFailureInjector),
301            #[prost(message, tag = "2")]
302            RequestHeaderModifier(
303                super::super::super::http_route::RequestHeaderModifier,
304            ),
305        }
306    }
307    #[derive(Clone, PartialEq, ::prost::Message)]
308    pub struct Distribution {
309        #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
310        pub kind: ::core::option::Option<distribution::Kind>,
311    }
312    /// Nested message and enum types in `Distribution`.
313    pub mod distribution {
314        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
315        pub struct Empty {}
316        #[derive(Clone, PartialEq, ::prost::Message)]
317        pub struct FirstAvailable {
318            #[prost(message, repeated, tag = "1")]
319            pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
320        }
321        #[derive(Clone, PartialEq, ::prost::Message)]
322        pub struct RandomAvailable {
323            #[prost(message, repeated, tag = "1")]
324            pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
325        }
326        #[derive(Clone, PartialEq, ::prost::Oneof)]
327        pub enum Kind {
328            #[prost(message, tag = "1")]
329            Empty(Empty),
330            /// Use the first available backend in the list.
331            #[prost(message, tag = "2")]
332            FirstAvailable(FirstAvailable),
333            #[prost(message, tag = "3")]
334            RandomAvailable(RandomAvailable),
335        }
336    }
337    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
338    pub struct Retry {
339        #[prost(uint32, tag = "1")]
340        pub max_retries: u32,
341        #[prost(uint32, tag = "2")]
342        pub max_request_bytes: u32,
343        /// Must be set, even if there are no internal conditions.
344        #[prost(message, optional, tag = "3")]
345        pub conditions: ::core::option::Option<retry::Conditions>,
346        #[prost(message, optional, tag = "4")]
347        pub timeout: ::core::option::Option<::prost_types::Duration>,
348        #[prost(message, optional, tag = "5")]
349        pub backoff: ::core::option::Option<super::ExponentialBackoff>,
350    }
351    /// Nested message and enum types in `Retry`.
352    pub mod retry {
353        /// Retryable gRPC status codes.
354        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
355        pub struct Conditions {
356            #[prost(bool, tag = "1")]
357            pub cancelled: bool,
358            #[prost(bool, tag = "4")]
359            pub deadine_exceeded: bool,
360            #[prost(bool, tag = "8")]
361            pub resource_exhausted: bool,
362            #[prost(bool, tag = "13")]
363            pub internal: bool,
364            #[prost(bool, tag = "14")]
365            pub unavailable: bool,
366        }
367    }
368    #[derive(Clone, PartialEq, ::prost::Message)]
369    pub struct RouteBackend {
370        #[prost(message, optional, tag = "1")]
371        pub backend: ::core::option::Option<super::Backend>,
372        #[prost(message, repeated, tag = "3")]
373        pub filters: ::prost::alloc::vec::Vec<Filter>,
374        /// DEPRECATED: proxies ignore this. Retry timeouts are used instead of this.
375        #[deprecated]
376        #[prost(message, optional, tag = "4")]
377        pub request_timeout: ::core::option::Option<::prost_types::Duration>,
378    }
379    #[derive(Clone, PartialEq, ::prost::Message)]
380    pub struct WeightedRouteBackend {
381        #[prost(message, optional, tag = "1")]
382        pub backend: ::core::option::Option<RouteBackend>,
383        #[prost(uint32, tag = "2")]
384        pub weight: u32,
385    }
386}
387#[derive(Clone, PartialEq, ::prost::Message)]
388pub struct OpaqueRoute {
389    #[prost(message, optional, tag = "1")]
390    pub metadata: ::core::option::Option<super::meta::Metadata>,
391    /// Must have at least one rule.
392    #[prost(message, repeated, tag = "3")]
393    pub rules: ::prost::alloc::vec::Vec<opaque_route::Rule>,
394}
395/// Nested message and enum types in `OpaqueRoute`.
396pub mod opaque_route {
397    #[derive(Clone, PartialEq, ::prost::Message)]
398    pub struct Rule {
399        #[prost(message, optional, tag = "1")]
400        pub backends: ::core::option::Option<Distribution>,
401        #[prost(message, repeated, tag = "2")]
402        pub filters: ::prost::alloc::vec::Vec<Filter>,
403    }
404    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
405    pub struct Filter {
406        #[prost(oneof = "filter::Kind", tags = "1, 2")]
407        pub kind: ::core::option::Option<filter::Kind>,
408    }
409    /// Nested message and enum types in `Filter`.
410    pub mod filter {
411        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
412        pub enum Kind {
413            #[prost(message, tag = "1")]
414            Invalid(super::super::super::opaque_route::Invalid),
415            #[prost(message, tag = "2")]
416            Forbidden(super::super::super::opaque_route::Forbidden),
417        }
418    }
419    #[derive(Clone, PartialEq, ::prost::Message)]
420    pub struct Distribution {
421        #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
422        pub kind: ::core::option::Option<distribution::Kind>,
423    }
424    /// Nested message and enum types in `Distribution`.
425    pub mod distribution {
426        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
427        pub struct Empty {}
428        #[derive(Clone, PartialEq, ::prost::Message)]
429        pub struct FirstAvailable {
430            #[prost(message, repeated, tag = "1")]
431            pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
432        }
433        #[derive(Clone, PartialEq, ::prost::Message)]
434        pub struct RandomAvailable {
435            #[prost(message, repeated, tag = "1")]
436            pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
437        }
438        #[derive(Clone, PartialEq, ::prost::Oneof)]
439        pub enum Kind {
440            #[prost(message, tag = "1")]
441            Empty(Empty),
442            /// Use the first available backend in the list.
443            #[prost(message, tag = "2")]
444            FirstAvailable(FirstAvailable),
445            #[prost(message, tag = "3")]
446            RandomAvailable(RandomAvailable),
447        }
448    }
449    #[derive(Clone, PartialEq, ::prost::Message)]
450    pub struct RouteBackend {
451        #[prost(message, optional, tag = "1")]
452        pub backend: ::core::option::Option<super::Backend>,
453        #[prost(message, repeated, tag = "3")]
454        pub filters: ::prost::alloc::vec::Vec<Filter>,
455    }
456    #[derive(Clone, PartialEq, ::prost::Message)]
457    pub struct WeightedRouteBackend {
458        #[prost(message, optional, tag = "1")]
459        pub backend: ::core::option::Option<RouteBackend>,
460        #[prost(uint32, tag = "2")]
461        pub weight: u32,
462    }
463}
464#[derive(Clone, PartialEq, ::prost::Message)]
465pub struct TlsRoute {
466    #[prost(message, optional, tag = "1")]
467    pub metadata: ::core::option::Option<super::meta::Metadata>,
468    /// If empty, the SNI value is ignored.
469    #[prost(message, repeated, tag = "2")]
470    pub snis: ::prost::alloc::vec::Vec<super::tls_route::SniMatch>,
471    /// Must have at least one rule.
472    #[prost(message, repeated, tag = "3")]
473    pub rules: ::prost::alloc::vec::Vec<tls_route::Rule>,
474}
475/// Nested message and enum types in `TlsRoute`.
476pub mod tls_route {
477    #[derive(Clone, PartialEq, ::prost::Message)]
478    pub struct Rule {
479        #[prost(message, optional, tag = "1")]
480        pub backends: ::core::option::Option<Distribution>,
481        #[prost(message, repeated, tag = "2")]
482        pub filters: ::prost::alloc::vec::Vec<Filter>,
483    }
484    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
485    pub struct Filter {
486        #[prost(oneof = "filter::Kind", tags = "1, 2")]
487        pub kind: ::core::option::Option<filter::Kind>,
488    }
489    /// Nested message and enum types in `Filter`.
490    pub mod filter {
491        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
492        pub enum Kind {
493            #[prost(message, tag = "1")]
494            Invalid(super::super::super::opaque_route::Invalid),
495            #[prost(message, tag = "2")]
496            Forbidden(super::super::super::opaque_route::Forbidden),
497        }
498    }
499    #[derive(Clone, PartialEq, ::prost::Message)]
500    pub struct Distribution {
501        #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
502        pub kind: ::core::option::Option<distribution::Kind>,
503    }
504    /// Nested message and enum types in `Distribution`.
505    pub mod distribution {
506        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
507        pub struct Empty {}
508        #[derive(Clone, PartialEq, ::prost::Message)]
509        pub struct FirstAvailable {
510            #[prost(message, repeated, tag = "1")]
511            pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
512        }
513        #[derive(Clone, PartialEq, ::prost::Message)]
514        pub struct RandomAvailable {
515            #[prost(message, repeated, tag = "1")]
516            pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
517        }
518        #[derive(Clone, PartialEq, ::prost::Oneof)]
519        pub enum Kind {
520            #[prost(message, tag = "1")]
521            Empty(Empty),
522            /// Use the first available backend in the list.
523            #[prost(message, tag = "2")]
524            FirstAvailable(FirstAvailable),
525            #[prost(message, tag = "3")]
526            RandomAvailable(RandomAvailable),
527        }
528    }
529    #[derive(Clone, PartialEq, ::prost::Message)]
530    pub struct RouteBackend {
531        #[prost(message, optional, tag = "1")]
532        pub backend: ::core::option::Option<super::Backend>,
533        #[prost(message, repeated, tag = "3")]
534        pub filters: ::prost::alloc::vec::Vec<Filter>,
535    }
536    #[derive(Clone, PartialEq, ::prost::Message)]
537    pub struct WeightedRouteBackend {
538        #[prost(message, optional, tag = "1")]
539        pub backend: ::core::option::Option<RouteBackend>,
540        #[prost(uint32, tag = "2")]
541        pub weight: u32,
542    }
543}
544#[derive(Clone, PartialEq, ::prost::Message)]
545pub struct Backend {
546    #[prost(message, optional, tag = "1")]
547    pub metadata: ::core::option::Option<super::meta::Metadata>,
548    /// Describes queue configuration for a backend.
549    #[prost(message, optional, tag = "4")]
550    pub queue: ::core::option::Option<Queue>,
551    #[prost(oneof = "backend::Kind", tags = "2, 3")]
552    pub kind: ::core::option::Option<backend::Kind>,
553}
554/// Nested message and enum types in `Backend`.
555pub mod backend {
556    /// A strategy for discovering endpoints for a service.
557    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
558    pub struct EndpointDiscovery {
559        #[prost(oneof = "endpoint_discovery::Kind", tags = "1")]
560        pub kind: ::core::option::Option<endpoint_discovery::Kind>,
561    }
562    /// Nested message and enum types in `EndpointDiscovery`.
563    pub mod endpoint_discovery {
564        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
565        pub struct DestinationGet {
566            #[prost(string, tag = "1")]
567            pub path: ::prost::alloc::string::String,
568        }
569        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
570        pub enum Kind {
571            /// Use the `Destination` service to discover endpoints for this service.
572            #[prost(message, tag = "1")]
573            Dst(DestinationGet),
574        }
575    }
576    /// Describes a power-of-two-choices (P2C) load balancer configuration for a
577    /// backend.
578    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
579    pub struct BalanceP2c {
580        #[prost(message, optional, tag = "1")]
581        pub discovery: ::core::option::Option<EndpointDiscovery>,
582        /// The load estimation strategy used by this load balancer.
583        #[prost(oneof = "balance_p2c::Load", tags = "2")]
584        pub load: ::core::option::Option<balance_p2c::Load>,
585    }
586    /// Nested message and enum types in `BalanceP2c`.
587    pub mod balance_p2c {
588        /// Parameters configuring peak EWMA load estimation.
589        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
590        pub struct PeakEwma {
591            /// Initial latency value used when no latencies have been
592            /// recorded for an endpoint.
593            #[prost(message, optional, tag = "1")]
594            pub default_rtt: ::core::option::Option<::prost_types::Duration>,
595            /// The duration of the moving window over which latency is observed.
596            #[prost(message, optional, tag = "2")]
597            pub decay: ::core::option::Option<::prost_types::Duration>,
598        }
599        /// The load estimation strategy used by this load balancer.
600        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
601        pub enum Load {
602            /// This load balancer uses peak EWMA (exponentially weighted moving
603            /// average) load estimates.
604            #[prost(message, tag = "2")]
605            PeakEwma(PeakEwma),
606        }
607    }
608    #[derive(Clone, PartialEq, ::prost::Oneof)]
609    pub enum Kind {
610        /// A backend that consists of a single endpoint.
611        #[prost(message, tag = "2")]
612        Forward(super::super::destination::WeightedAddr),
613        /// A backend that comprises a load balanced service.
614        #[prost(message, tag = "3")]
615        Balancer(BalanceP2c),
616    }
617}
618#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
619pub struct Queue {
620    /// The number of requests that may be held in a queue before backpressure is
621    /// exerted.
622    #[prost(uint32, tag = "1")]
623    pub capacity: u32,
624    /// A timeout that limits how long a backend may remain unready before any
625    /// requests in its queue are failed.
626    #[prost(message, optional, tag = "2")]
627    pub failfast_timeout: ::core::option::Option<::prost_types::Duration>,
628}
629#[derive(Clone, Copy, PartialEq, ::prost::Message)]
630pub struct FailureAccrual {
631    #[prost(oneof = "failure_accrual::Kind", tags = "1")]
632    pub kind: ::core::option::Option<failure_accrual::Kind>,
633}
634/// Nested message and enum types in `FailureAccrual`.
635pub mod failure_accrual {
636    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
637    pub struct ConsecutiveFailures {
638        #[prost(uint32, tag = "1")]
639        pub max_failures: u32,
640        #[prost(message, optional, tag = "2")]
641        pub backoff: ::core::option::Option<super::ExponentialBackoff>,
642    }
643    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
644    pub enum Kind {
645        #[prost(message, tag = "1")]
646        ConsecutiveFailures(ConsecutiveFailures),
647    }
648}
649#[derive(Clone, Copy, PartialEq, ::prost::Message)]
650pub struct ExponentialBackoff {
651    /// The minimum amount of time to wait before resuming an operation.
652    #[prost(message, optional, tag = "1")]
653    pub min_backoff: ::core::option::Option<::prost_types::Duration>,
654    /// The maximum amount of time to wait before resuming an operation.
655    /// Must be greater than or equal to min_backoff.
656    #[prost(message, optional, tag = "2")]
657    pub max_backoff: ::core::option::Option<::prost_types::Duration>,
658    /// The ratio of the base timeout that may be randomly added to a backoff.
659    /// Must be greater than or equal to 0.0.
660    #[prost(float, tag = "3")]
661    pub jitter_ratio: f32,
662}
663/// Generated client implementations.
664pub mod outbound_policies_client {
665    #![allow(
666        unused_variables,
667        dead_code,
668        missing_docs,
669        clippy::wildcard_imports,
670        clippy::let_unit_value,
671    )]
672    use tonic::codegen::*;
673    use tonic::codegen::http::Uri;
674    #[derive(Debug, Clone)]
675    pub struct OutboundPoliciesClient<T> {
676        inner: tonic::client::Grpc<T>,
677    }
678    impl OutboundPoliciesClient<tonic::transport::Channel> {
679        /// Attempt to create a new client by connecting to a given endpoint.
680        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
681        where
682            D: TryInto<tonic::transport::Endpoint>,
683            D::Error: Into<StdError>,
684        {
685            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
686            Ok(Self::new(conn))
687        }
688    }
689    impl<T> OutboundPoliciesClient<T>
690    where
691        T: tonic::client::GrpcService<tonic::body::Body>,
692        T::Error: Into<StdError>,
693        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
694        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
695    {
696        pub fn new(inner: T) -> Self {
697            let inner = tonic::client::Grpc::new(inner);
698            Self { inner }
699        }
700        pub fn with_origin(inner: T, origin: Uri) -> Self {
701            let inner = tonic::client::Grpc::with_origin(inner, origin);
702            Self { inner }
703        }
704        pub fn with_interceptor<F>(
705            inner: T,
706            interceptor: F,
707        ) -> OutboundPoliciesClient<InterceptedService<T, F>>
708        where
709            F: tonic::service::Interceptor,
710            T::ResponseBody: Default,
711            T: tonic::codegen::Service<
712                http::Request<tonic::body::Body>,
713                Response = http::Response<
714                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
715                >,
716            >,
717            <T as tonic::codegen::Service<
718                http::Request<tonic::body::Body>,
719            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
720        {
721            OutboundPoliciesClient::new(InterceptedService::new(inner, interceptor))
722        }
723        /// Compress requests with the given encoding.
724        ///
725        /// This requires the server to support it otherwise it might respond with an
726        /// error.
727        #[must_use]
728        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
729            self.inner = self.inner.send_compressed(encoding);
730            self
731        }
732        /// Enable decompressing responses.
733        #[must_use]
734        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
735            self.inner = self.inner.accept_compressed(encoding);
736            self
737        }
738        /// Limits the maximum size of a decoded message.
739        ///
740        /// Default: `4MB`
741        #[must_use]
742        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
743            self.inner = self.inner.max_decoding_message_size(limit);
744            self
745        }
746        /// Limits the maximum size of an encoded message.
747        ///
748        /// Default: `usize::MAX`
749        #[must_use]
750        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
751            self.inner = self.inner.max_encoding_message_size(limit);
752            self
753        }
754        pub async fn get(
755            &mut self,
756            request: impl tonic::IntoRequest<super::TrafficSpec>,
757        ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status> {
758            self.inner
759                .ready()
760                .await
761                .map_err(|e| {
762                    tonic::Status::unknown(
763                        format!("Service was not ready: {}", e.into()),
764                    )
765                })?;
766            let codec = tonic_prost::ProstCodec::default();
767            let path = http::uri::PathAndQuery::from_static(
768                "/io.linkerd.proxy.outbound.OutboundPolicies/Get",
769            );
770            let mut req = request.into_request();
771            req.extensions_mut()
772                .insert(
773                    GrpcMethod::new("io.linkerd.proxy.outbound.OutboundPolicies", "Get"),
774                );
775            self.inner.unary(req, path, codec).await
776        }
777        pub async fn watch(
778            &mut self,
779            request: impl tonic::IntoRequest<super::TrafficSpec>,
780        ) -> std::result::Result<
781            tonic::Response<tonic::codec::Streaming<super::OutboundPolicy>>,
782            tonic::Status,
783        > {
784            self.inner
785                .ready()
786                .await
787                .map_err(|e| {
788                    tonic::Status::unknown(
789                        format!("Service was not ready: {}", e.into()),
790                    )
791                })?;
792            let codec = tonic_prost::ProstCodec::default();
793            let path = http::uri::PathAndQuery::from_static(
794                "/io.linkerd.proxy.outbound.OutboundPolicies/Watch",
795            );
796            let mut req = request.into_request();
797            req.extensions_mut()
798                .insert(
799                    GrpcMethod::new(
800                        "io.linkerd.proxy.outbound.OutboundPolicies",
801                        "Watch",
802                    ),
803                );
804            self.inner.server_streaming(req, path, codec).await
805        }
806    }
807}
808/// Generated server implementations.
809pub mod outbound_policies_server {
810    #![allow(
811        unused_variables,
812        dead_code,
813        missing_docs,
814        clippy::wildcard_imports,
815        clippy::let_unit_value,
816    )]
817    use tonic::codegen::*;
818    /// Generated trait containing gRPC methods that should be implemented for use with OutboundPoliciesServer.
819    #[async_trait]
820    pub trait OutboundPolicies: std::marker::Send + std::marker::Sync + 'static {
821        async fn get(
822            &self,
823            request: tonic::Request<super::TrafficSpec>,
824        ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status>;
825        /// Server streaming response type for the Watch method.
826        type WatchStream: tonic::codegen::tokio_stream::Stream<
827                Item = std::result::Result<super::OutboundPolicy, tonic::Status>,
828            >
829            + std::marker::Send
830            + 'static;
831        async fn watch(
832            &self,
833            request: tonic::Request<super::TrafficSpec>,
834        ) -> std::result::Result<tonic::Response<Self::WatchStream>, tonic::Status>;
835    }
836    #[derive(Debug)]
837    pub struct OutboundPoliciesServer<T> {
838        inner: Arc<T>,
839        accept_compression_encodings: EnabledCompressionEncodings,
840        send_compression_encodings: EnabledCompressionEncodings,
841        max_decoding_message_size: Option<usize>,
842        max_encoding_message_size: Option<usize>,
843    }
844    impl<T> OutboundPoliciesServer<T> {
845        pub fn new(inner: T) -> Self {
846            Self::from_arc(Arc::new(inner))
847        }
848        pub fn from_arc(inner: Arc<T>) -> Self {
849            Self {
850                inner,
851                accept_compression_encodings: Default::default(),
852                send_compression_encodings: Default::default(),
853                max_decoding_message_size: None,
854                max_encoding_message_size: None,
855            }
856        }
857        pub fn with_interceptor<F>(
858            inner: T,
859            interceptor: F,
860        ) -> InterceptedService<Self, F>
861        where
862            F: tonic::service::Interceptor,
863        {
864            InterceptedService::new(Self::new(inner), interceptor)
865        }
866        /// Enable decompressing requests with the given encoding.
867        #[must_use]
868        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
869            self.accept_compression_encodings.enable(encoding);
870            self
871        }
872        /// Compress responses with the given encoding, if the client supports it.
873        #[must_use]
874        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
875            self.send_compression_encodings.enable(encoding);
876            self
877        }
878        /// Limits the maximum size of a decoded message.
879        ///
880        /// Default: `4MB`
881        #[must_use]
882        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
883            self.max_decoding_message_size = Some(limit);
884            self
885        }
886        /// Limits the maximum size of an encoded message.
887        ///
888        /// Default: `usize::MAX`
889        #[must_use]
890        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
891            self.max_encoding_message_size = Some(limit);
892            self
893        }
894    }
895    impl<T, B> tonic::codegen::Service<http::Request<B>> for OutboundPoliciesServer<T>
896    where
897        T: OutboundPolicies,
898        B: Body + std::marker::Send + 'static,
899        B::Error: Into<StdError> + std::marker::Send + 'static,
900    {
901        type Response = http::Response<tonic::body::Body>;
902        type Error = std::convert::Infallible;
903        type Future = BoxFuture<Self::Response, Self::Error>;
904        fn poll_ready(
905            &mut self,
906            _cx: &mut Context<'_>,
907        ) -> Poll<std::result::Result<(), Self::Error>> {
908            Poll::Ready(Ok(()))
909        }
910        fn call(&mut self, req: http::Request<B>) -> Self::Future {
911            match req.uri().path() {
912                "/io.linkerd.proxy.outbound.OutboundPolicies/Get" => {
913                    #[allow(non_camel_case_types)]
914                    struct GetSvc<T: OutboundPolicies>(pub Arc<T>);
915                    impl<
916                        T: OutboundPolicies,
917                    > tonic::server::UnaryService<super::TrafficSpec> for GetSvc<T> {
918                        type Response = super::OutboundPolicy;
919                        type Future = BoxFuture<
920                            tonic::Response<Self::Response>,
921                            tonic::Status,
922                        >;
923                        fn call(
924                            &mut self,
925                            request: tonic::Request<super::TrafficSpec>,
926                        ) -> Self::Future {
927                            let inner = Arc::clone(&self.0);
928                            let fut = async move {
929                                <T as OutboundPolicies>::get(&inner, request).await
930                            };
931                            Box::pin(fut)
932                        }
933                    }
934                    let accept_compression_encodings = self.accept_compression_encodings;
935                    let send_compression_encodings = self.send_compression_encodings;
936                    let max_decoding_message_size = self.max_decoding_message_size;
937                    let max_encoding_message_size = self.max_encoding_message_size;
938                    let inner = self.inner.clone();
939                    let fut = async move {
940                        let method = GetSvc(inner);
941                        let codec = tonic_prost::ProstCodec::default();
942                        let mut grpc = tonic::server::Grpc::new(codec)
943                            .apply_compression_config(
944                                accept_compression_encodings,
945                                send_compression_encodings,
946                            )
947                            .apply_max_message_size_config(
948                                max_decoding_message_size,
949                                max_encoding_message_size,
950                            );
951                        let res = grpc.unary(method, req).await;
952                        Ok(res)
953                    };
954                    Box::pin(fut)
955                }
956                "/io.linkerd.proxy.outbound.OutboundPolicies/Watch" => {
957                    #[allow(non_camel_case_types)]
958                    struct WatchSvc<T: OutboundPolicies>(pub Arc<T>);
959                    impl<
960                        T: OutboundPolicies,
961                    > tonic::server::ServerStreamingService<super::TrafficSpec>
962                    for WatchSvc<T> {
963                        type Response = super::OutboundPolicy;
964                        type ResponseStream = T::WatchStream;
965                        type Future = BoxFuture<
966                            tonic::Response<Self::ResponseStream>,
967                            tonic::Status,
968                        >;
969                        fn call(
970                            &mut self,
971                            request: tonic::Request<super::TrafficSpec>,
972                        ) -> Self::Future {
973                            let inner = Arc::clone(&self.0);
974                            let fut = async move {
975                                <T as OutboundPolicies>::watch(&inner, request).await
976                            };
977                            Box::pin(fut)
978                        }
979                    }
980                    let accept_compression_encodings = self.accept_compression_encodings;
981                    let send_compression_encodings = self.send_compression_encodings;
982                    let max_decoding_message_size = self.max_decoding_message_size;
983                    let max_encoding_message_size = self.max_encoding_message_size;
984                    let inner = self.inner.clone();
985                    let fut = async move {
986                        let method = WatchSvc(inner);
987                        let codec = tonic_prost::ProstCodec::default();
988                        let mut grpc = tonic::server::Grpc::new(codec)
989                            .apply_compression_config(
990                                accept_compression_encodings,
991                                send_compression_encodings,
992                            )
993                            .apply_max_message_size_config(
994                                max_decoding_message_size,
995                                max_encoding_message_size,
996                            );
997                        let res = grpc.server_streaming(method, req).await;
998                        Ok(res)
999                    };
1000                    Box::pin(fut)
1001                }
1002                _ => {
1003                    Box::pin(async move {
1004                        let mut response = http::Response::new(
1005                            tonic::body::Body::default(),
1006                        );
1007                        let headers = response.headers_mut();
1008                        headers
1009                            .insert(
1010                                tonic::Status::GRPC_STATUS,
1011                                (tonic::Code::Unimplemented as i32).into(),
1012                            );
1013                        headers
1014                            .insert(
1015                                http::header::CONTENT_TYPE,
1016                                tonic::metadata::GRPC_CONTENT_TYPE,
1017                            );
1018                        Ok(response)
1019                    })
1020                }
1021            }
1022        }
1023    }
1024    impl<T> Clone for OutboundPoliciesServer<T> {
1025        fn clone(&self) -> Self {
1026            let inner = self.inner.clone();
1027            Self {
1028                inner,
1029                accept_compression_encodings: self.accept_compression_encodings,
1030                send_compression_encodings: self.send_compression_encodings,
1031                max_decoding_message_size: self.max_decoding_message_size,
1032                max_encoding_message_size: self.max_encoding_message_size,
1033            }
1034        }
1035    }
1036    /// Generated gRPC service name
1037    pub const SERVICE_NAME: &str = "io.linkerd.proxy.outbound.OutboundPolicies";
1038    impl<T> tonic::server::NamedService for OutboundPoliciesServer<T> {
1039        const NAME: &'static str = SERVICE_NAME;
1040    }
1041}