Skip to main content

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, 3")]
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        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
600        pub struct PenaltyPeakEwma {
601            /// Initial latency value used when no latencies have been
602            /// recorded for an endpoint.
603            #[prost(message, optional, tag = "1")]
604            pub default_rtt: ::core::option::Option<::prost_types::Duration>,
605            /// The duration of the moving window over which latency is observed.
606            #[prost(message, optional, tag = "2")]
607            pub decay: ::core::option::Option<::prost_types::Duration>,
608            /// The penalty duration to inject when a matching response is received.
609            #[prost(message, optional, tag = "3")]
610            pub penalty: ::core::option::Option<::prost_types::Duration>,
611            /// The maximum duration to respect for Retry-After hints. Hints that exceed this value will be capped.
612            #[prost(message, optional, tag = "4")]
613            pub max_retry_after: ::core::option::Option<::prost_types::Duration>,
614            /// The EWMA decay window for the penalty.
615            #[prost(message, optional, tag = "5")]
616            pub penalty_decay: ::core::option::Option<::prost_types::Duration>,
617        }
618        /// The load estimation strategy used by this load balancer.
619        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
620        pub enum Load {
621            /// This load balancer uses peak EWMA (exponentially weighted moving
622            /// average) load estimates.
623            #[prost(message, tag = "2")]
624            PeakEwma(PeakEwma),
625            /// A variant of peak EWMA that injects artificial penalties based on response
626            /// codes, enabling 429-aware load balancing.
627            #[prost(message, tag = "3")]
628            PenaltyPeakEwma(PenaltyPeakEwma),
629        }
630    }
631    #[derive(Clone, PartialEq, ::prost::Oneof)]
632    pub enum Kind {
633        /// A backend that consists of a single endpoint.
634        #[prost(message, tag = "2")]
635        Forward(super::super::destination::WeightedAddr),
636        /// A backend that comprises a load balanced service.
637        #[prost(message, tag = "3")]
638        Balancer(BalanceP2c),
639    }
640}
641#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
642pub struct Queue {
643    /// The number of requests that may be held in a queue before backpressure is
644    /// exerted.
645    #[prost(uint32, tag = "1")]
646    pub capacity: u32,
647    /// A timeout that limits how long a backend may remain unready before any
648    /// requests in its queue are failed.
649    #[prost(message, optional, tag = "2")]
650    pub failfast_timeout: ::core::option::Option<::prost_types::Duration>,
651}
652/// Configures failure accrual policies for circuit breaking.
653/// Setting a numeric policy field to zero disables that policy.
654#[derive(Clone, Copy, PartialEq, ::prost::Message)]
655pub struct FailureAccrual {
656    /// Ejection protection for the pool. When set, prevents circuit
657    /// breakers from ejecting endpoints below the configured floor.
658    #[prost(message, optional, tag = "3")]
659    pub ejection: ::core::option::Option<EjectionConfig>,
660    #[prost(oneof = "failure_accrual::Kind", tags = "1, 2")]
661    pub kind: ::core::option::Option<failure_accrual::Kind>,
662}
663/// Nested message and enum types in `FailureAccrual`.
664pub mod failure_accrual {
665    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
666    pub struct ConsecutiveFailures {
667        /// Maximum consecutive failures before the circuit trips.
668        /// Set to 0 to disable (an unset field has the same effect).
669        #[prost(uint32, tag = "1")]
670        pub max_failures: u32,
671        /// Must be set. Controls the ejection duration before probe requests
672        /// are allowed after this policy trips the circuit.
673        #[prost(message, optional, tag = "2")]
674        pub backoff: ::core::option::Option<super::ExponentialBackoff>,
675    }
676    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
677    pub struct Unified {
678        /// Success rate threshold in \[0.0, 1.0\]. The circuit trips when the
679        /// EWMA success rate drops below this value. Set to 0.0 to disable.
680        /// Defined as `double` (not `float`) because this value is compared
681        /// against the proxy's f64 EWMA on every request.
682        #[prost(double, tag = "1")]
683        pub success_rate_threshold: f64,
684        /// EWMA decay window for success rate tracking.
685        #[prost(message, optional, tag = "2")]
686        pub decay: ::core::option::Option<::prost_types::Duration>,
687        /// Minimum requests before the success rate policy can trip (cold-start guard).
688        #[prost(uint32, tag = "3")]
689        pub min_requests: u32,
690        /// Maximum consecutive failures before the circuit trips.
691        /// Set to 0 to disable (an unset field has the same effect).
692        #[prost(uint32, tag = "4")]
693        pub max_consecutive_failures: u32,
694        /// Must be set. Controls the ejection duration before probe requests
695        /// are allowed after this policy trips the circuit.
696        #[prost(message, optional, tag = "5")]
697        pub backoff: ::core::option::Option<super::ExponentialBackoff>,
698    }
699    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
700    pub enum Kind {
701        #[prost(message, tag = "1")]
702        ConsecutiveFailures(ConsecutiveFailures),
703        #[prost(message, tag = "2")]
704        Unified(Unified),
705    }
706}
707/// Pool-level ejection protection. Prevents circuit breakers from
708/// ejecting all endpoints in a load-balancing pool.
709///
710/// Additional ejection parameters may follow in future fields.
711#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
712pub struct EjectionConfig {
713    /// Minimum number of endpoints that must remain unejected.
714    /// When set to 0 (or absent), ejection protection is disabled.
715    #[prost(uint32, tag = "1")]
716    pub min_ready_endpoints: u32,
717}
718#[derive(Clone, Copy, PartialEq, ::prost::Message)]
719pub struct ExponentialBackoff {
720    /// The minimum amount of time to wait before resuming an operation.
721    #[prost(message, optional, tag = "1")]
722    pub min_backoff: ::core::option::Option<::prost_types::Duration>,
723    /// The maximum amount of time to wait before resuming an operation.
724    /// Must be greater than or equal to min_backoff.
725    #[prost(message, optional, tag = "2")]
726    pub max_backoff: ::core::option::Option<::prost_types::Duration>,
727    /// The ratio of the base timeout that may be randomly added to a backoff.
728    /// Must be greater than or equal to 0.0.
729    #[prost(float, tag = "3")]
730    pub jitter_ratio: f32,
731    /// If true, the proxy will use the Retry-After hint (if present on the response)
732    /// as the initial backoff duration, clamped by min_backoff and max_backoff.
733    #[prost(bool, tag = "4")]
734    pub respect_retry_after_hint: bool,
735}
736/// Generated client implementations.
737pub mod outbound_policies_client {
738    #![allow(
739        unused_variables,
740        dead_code,
741        missing_docs,
742        clippy::wildcard_imports,
743        clippy::let_unit_value,
744    )]
745    use tonic::codegen::*;
746    use tonic::codegen::http::Uri;
747    #[derive(Debug, Clone)]
748    pub struct OutboundPoliciesClient<T> {
749        inner: tonic::client::Grpc<T>,
750    }
751    impl OutboundPoliciesClient<tonic::transport::Channel> {
752        /// Attempt to create a new client by connecting to a given endpoint.
753        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
754        where
755            D: TryInto<tonic::transport::Endpoint>,
756            D::Error: Into<StdError>,
757        {
758            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
759            Ok(Self::new(conn))
760        }
761    }
762    impl<T> OutboundPoliciesClient<T>
763    where
764        T: tonic::client::GrpcService<tonic::body::Body>,
765        T::Error: Into<StdError>,
766        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
767        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
768    {
769        pub fn new(inner: T) -> Self {
770            let inner = tonic::client::Grpc::new(inner);
771            Self { inner }
772        }
773        pub fn with_origin(inner: T, origin: Uri) -> Self {
774            let inner = tonic::client::Grpc::with_origin(inner, origin);
775            Self { inner }
776        }
777        pub fn with_interceptor<F>(
778            inner: T,
779            interceptor: F,
780        ) -> OutboundPoliciesClient<InterceptedService<T, F>>
781        where
782            F: tonic::service::Interceptor,
783            T::ResponseBody: Default,
784            T: tonic::codegen::Service<
785                http::Request<tonic::body::Body>,
786                Response = http::Response<
787                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
788                >,
789            >,
790            <T as tonic::codegen::Service<
791                http::Request<tonic::body::Body>,
792            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
793        {
794            OutboundPoliciesClient::new(InterceptedService::new(inner, interceptor))
795        }
796        /// Compress requests with the given encoding.
797        ///
798        /// This requires the server to support it otherwise it might respond with an
799        /// error.
800        #[must_use]
801        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
802            self.inner = self.inner.send_compressed(encoding);
803            self
804        }
805        /// Enable decompressing responses.
806        #[must_use]
807        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
808            self.inner = self.inner.accept_compressed(encoding);
809            self
810        }
811        /// Limits the maximum size of a decoded message.
812        ///
813        /// Default: `4MB`
814        #[must_use]
815        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
816            self.inner = self.inner.max_decoding_message_size(limit);
817            self
818        }
819        /// Limits the maximum size of an encoded message.
820        ///
821        /// Default: `usize::MAX`
822        #[must_use]
823        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
824            self.inner = self.inner.max_encoding_message_size(limit);
825            self
826        }
827        pub async fn get(
828            &mut self,
829            request: impl tonic::IntoRequest<super::TrafficSpec>,
830        ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status> {
831            self.inner
832                .ready()
833                .await
834                .map_err(|e| {
835                    tonic::Status::unknown(
836                        format!("Service was not ready: {}", e.into()),
837                    )
838                })?;
839            let codec = tonic_prost::ProstCodec::default();
840            let path = http::uri::PathAndQuery::from_static(
841                "/io.linkerd.proxy.outbound.OutboundPolicies/Get",
842            );
843            let mut req = request.into_request();
844            req.extensions_mut()
845                .insert(
846                    GrpcMethod::new("io.linkerd.proxy.outbound.OutboundPolicies", "Get"),
847                );
848            self.inner.unary(req, path, codec).await
849        }
850        pub async fn watch(
851            &mut self,
852            request: impl tonic::IntoRequest<super::TrafficSpec>,
853        ) -> std::result::Result<
854            tonic::Response<tonic::codec::Streaming<super::OutboundPolicy>>,
855            tonic::Status,
856        > {
857            self.inner
858                .ready()
859                .await
860                .map_err(|e| {
861                    tonic::Status::unknown(
862                        format!("Service was not ready: {}", e.into()),
863                    )
864                })?;
865            let codec = tonic_prost::ProstCodec::default();
866            let path = http::uri::PathAndQuery::from_static(
867                "/io.linkerd.proxy.outbound.OutboundPolicies/Watch",
868            );
869            let mut req = request.into_request();
870            req.extensions_mut()
871                .insert(
872                    GrpcMethod::new(
873                        "io.linkerd.proxy.outbound.OutboundPolicies",
874                        "Watch",
875                    ),
876                );
877            self.inner.server_streaming(req, path, codec).await
878        }
879    }
880}
881/// Generated server implementations.
882pub mod outbound_policies_server {
883    #![allow(
884        unused_variables,
885        dead_code,
886        missing_docs,
887        clippy::wildcard_imports,
888        clippy::let_unit_value,
889    )]
890    use tonic::codegen::*;
891    /// Generated trait containing gRPC methods that should be implemented for use with OutboundPoliciesServer.
892    #[async_trait]
893    pub trait OutboundPolicies: std::marker::Send + std::marker::Sync + 'static {
894        async fn get(
895            &self,
896            request: tonic::Request<super::TrafficSpec>,
897        ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status>;
898        /// Server streaming response type for the Watch method.
899        type WatchStream: tonic::codegen::tokio_stream::Stream<
900                Item = std::result::Result<super::OutboundPolicy, tonic::Status>,
901            >
902            + std::marker::Send
903            + 'static;
904        async fn watch(
905            &self,
906            request: tonic::Request<super::TrafficSpec>,
907        ) -> std::result::Result<tonic::Response<Self::WatchStream>, tonic::Status>;
908    }
909    #[derive(Debug)]
910    pub struct OutboundPoliciesServer<T> {
911        inner: Arc<T>,
912        accept_compression_encodings: EnabledCompressionEncodings,
913        send_compression_encodings: EnabledCompressionEncodings,
914        max_decoding_message_size: Option<usize>,
915        max_encoding_message_size: Option<usize>,
916    }
917    impl<T> OutboundPoliciesServer<T> {
918        pub fn new(inner: T) -> Self {
919            Self::from_arc(Arc::new(inner))
920        }
921        pub fn from_arc(inner: Arc<T>) -> Self {
922            Self {
923                inner,
924                accept_compression_encodings: Default::default(),
925                send_compression_encodings: Default::default(),
926                max_decoding_message_size: None,
927                max_encoding_message_size: None,
928            }
929        }
930        pub fn with_interceptor<F>(
931            inner: T,
932            interceptor: F,
933        ) -> InterceptedService<Self, F>
934        where
935            F: tonic::service::Interceptor,
936        {
937            InterceptedService::new(Self::new(inner), interceptor)
938        }
939        /// Enable decompressing requests with the given encoding.
940        #[must_use]
941        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
942            self.accept_compression_encodings.enable(encoding);
943            self
944        }
945        /// Compress responses with the given encoding, if the client supports it.
946        #[must_use]
947        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
948            self.send_compression_encodings.enable(encoding);
949            self
950        }
951        /// Limits the maximum size of a decoded message.
952        ///
953        /// Default: `4MB`
954        #[must_use]
955        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
956            self.max_decoding_message_size = Some(limit);
957            self
958        }
959        /// Limits the maximum size of an encoded message.
960        ///
961        /// Default: `usize::MAX`
962        #[must_use]
963        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
964            self.max_encoding_message_size = Some(limit);
965            self
966        }
967    }
968    impl<T, B> tonic::codegen::Service<http::Request<B>> for OutboundPoliciesServer<T>
969    where
970        T: OutboundPolicies,
971        B: Body + std::marker::Send + 'static,
972        B::Error: Into<StdError> + std::marker::Send + 'static,
973    {
974        type Response = http::Response<tonic::body::Body>;
975        type Error = std::convert::Infallible;
976        type Future = BoxFuture<Self::Response, Self::Error>;
977        fn poll_ready(
978            &mut self,
979            _cx: &mut Context<'_>,
980        ) -> Poll<std::result::Result<(), Self::Error>> {
981            Poll::Ready(Ok(()))
982        }
983        fn call(&mut self, req: http::Request<B>) -> Self::Future {
984            match req.uri().path() {
985                "/io.linkerd.proxy.outbound.OutboundPolicies/Get" => {
986                    #[allow(non_camel_case_types)]
987                    struct GetSvc<T: OutboundPolicies>(pub Arc<T>);
988                    impl<
989                        T: OutboundPolicies,
990                    > tonic::server::UnaryService<super::TrafficSpec> for GetSvc<T> {
991                        type Response = super::OutboundPolicy;
992                        type Future = BoxFuture<
993                            tonic::Response<Self::Response>,
994                            tonic::Status,
995                        >;
996                        fn call(
997                            &mut self,
998                            request: tonic::Request<super::TrafficSpec>,
999                        ) -> Self::Future {
1000                            let inner = Arc::clone(&self.0);
1001                            let fut = async move {
1002                                <T as OutboundPolicies>::get(&inner, request).await
1003                            };
1004                            Box::pin(fut)
1005                        }
1006                    }
1007                    let accept_compression_encodings = self.accept_compression_encodings;
1008                    let send_compression_encodings = self.send_compression_encodings;
1009                    let max_decoding_message_size = self.max_decoding_message_size;
1010                    let max_encoding_message_size = self.max_encoding_message_size;
1011                    let inner = self.inner.clone();
1012                    let fut = async move {
1013                        let method = GetSvc(inner);
1014                        let codec = tonic_prost::ProstCodec::default();
1015                        let mut grpc = tonic::server::Grpc::new(codec)
1016                            .apply_compression_config(
1017                                accept_compression_encodings,
1018                                send_compression_encodings,
1019                            )
1020                            .apply_max_message_size_config(
1021                                max_decoding_message_size,
1022                                max_encoding_message_size,
1023                            );
1024                        let res = grpc.unary(method, req).await;
1025                        Ok(res)
1026                    };
1027                    Box::pin(fut)
1028                }
1029                "/io.linkerd.proxy.outbound.OutboundPolicies/Watch" => {
1030                    #[allow(non_camel_case_types)]
1031                    struct WatchSvc<T: OutboundPolicies>(pub Arc<T>);
1032                    impl<
1033                        T: OutboundPolicies,
1034                    > tonic::server::ServerStreamingService<super::TrafficSpec>
1035                    for WatchSvc<T> {
1036                        type Response = super::OutboundPolicy;
1037                        type ResponseStream = T::WatchStream;
1038                        type Future = BoxFuture<
1039                            tonic::Response<Self::ResponseStream>,
1040                            tonic::Status,
1041                        >;
1042                        fn call(
1043                            &mut self,
1044                            request: tonic::Request<super::TrafficSpec>,
1045                        ) -> Self::Future {
1046                            let inner = Arc::clone(&self.0);
1047                            let fut = async move {
1048                                <T as OutboundPolicies>::watch(&inner, request).await
1049                            };
1050                            Box::pin(fut)
1051                        }
1052                    }
1053                    let accept_compression_encodings = self.accept_compression_encodings;
1054                    let send_compression_encodings = self.send_compression_encodings;
1055                    let max_decoding_message_size = self.max_decoding_message_size;
1056                    let max_encoding_message_size = self.max_encoding_message_size;
1057                    let inner = self.inner.clone();
1058                    let fut = async move {
1059                        let method = WatchSvc(inner);
1060                        let codec = tonic_prost::ProstCodec::default();
1061                        let mut grpc = tonic::server::Grpc::new(codec)
1062                            .apply_compression_config(
1063                                accept_compression_encodings,
1064                                send_compression_encodings,
1065                            )
1066                            .apply_max_message_size_config(
1067                                max_decoding_message_size,
1068                                max_encoding_message_size,
1069                            );
1070                        let res = grpc.server_streaming(method, req).await;
1071                        Ok(res)
1072                    };
1073                    Box::pin(fut)
1074                }
1075                _ => {
1076                    Box::pin(async move {
1077                        let mut response = http::Response::new(
1078                            tonic::body::Body::default(),
1079                        );
1080                        let headers = response.headers_mut();
1081                        headers
1082                            .insert(
1083                                tonic::Status::GRPC_STATUS,
1084                                (tonic::Code::Unimplemented as i32).into(),
1085                            );
1086                        headers
1087                            .insert(
1088                                http::header::CONTENT_TYPE,
1089                                tonic::metadata::GRPC_CONTENT_TYPE,
1090                            );
1091                        Ok(response)
1092                    })
1093                }
1094            }
1095        }
1096    }
1097    impl<T> Clone for OutboundPoliciesServer<T> {
1098        fn clone(&self) -> Self {
1099            let inner = self.inner.clone();
1100            Self {
1101                inner,
1102                accept_compression_encodings: self.accept_compression_encodings,
1103                send_compression_encodings: self.send_compression_encodings,
1104                max_decoding_message_size: self.max_decoding_message_size,
1105                max_encoding_message_size: self.max_encoding_message_size,
1106            }
1107        }
1108    }
1109    /// Generated gRPC service name
1110    pub const SERVICE_NAME: &str = "io.linkerd.proxy.outbound.OutboundPolicies";
1111    impl<T> tonic::server::NamedService for OutboundPoliciesServer<T> {
1112        const NAME: &'static str = SERVICE_NAME;
1113    }
1114}