1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct TrafficSpec {
4 #[prost(string, tag = "1")]
7 pub source_workload: ::prost::alloc::string::String,
8 #[prost(oneof = "traffic_spec::Target", tags = "2, 3")]
10 pub target: ::core::option::Option<traffic_spec::Target>,
11}
12pub mod traffic_spec {
14 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
16 pub enum Target {
17 #[prost(message, tag = "2")]
19 Addr(super::super::net::TcpAddress),
20 #[prost(string, tag = "3")]
23 Authority(::prost::alloc::string::String),
24 }
25}
26#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct OutboundPolicy {
29 #[prost(message, optional, tag = "1")]
32 pub protocol: ::core::option::Option<ProxyProtocol>,
33 #[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}
42pub mod proxy_protocol {
44 #[derive(Clone, PartialEq, ::prost::Message)]
45 pub struct Detect {
46 #[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 #[prost(message, optional, tag = "3")]
53 pub http1: ::core::option::Option<Http1>,
54 #[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 #[prost(message, optional, tag = "2")]
69 pub failure_accrual: ::core::option::Option<super::FailureAccrual>,
70 #[prost(message, optional, tag = "3")]
72 pub load_bias: ::core::option::Option<super::LoadBiasConfig>,
73 #[prost(message, optional, tag = "4")]
75 pub retry_after: ::core::option::Option<super::RetryAfterConfig>,
76 }
77 #[derive(Clone, PartialEq, ::prost::Message)]
78 pub struct Http2 {
79 #[prost(message, repeated, tag = "1")]
80 pub routes: ::prost::alloc::vec::Vec<super::HttpRoute>,
81 #[prost(message, optional, tag = "2")]
83 pub failure_accrual: ::core::option::Option<super::FailureAccrual>,
84 #[prost(message, optional, tag = "3")]
86 pub load_bias: ::core::option::Option<super::LoadBiasConfig>,
87 #[prost(message, optional, tag = "4")]
89 pub retry_after: ::core::option::Option<super::RetryAfterConfig>,
90 }
91 #[derive(Clone, PartialEq, ::prost::Message)]
92 pub struct Grpc {
93 #[prost(message, repeated, tag = "1")]
94 pub routes: ::prost::alloc::vec::Vec<super::GrpcRoute>,
95 #[prost(message, optional, tag = "2")]
97 pub failure_accrual: ::core::option::Option<super::FailureAccrual>,
98 #[prost(message, optional, tag = "3")]
100 pub load_bias: ::core::option::Option<super::LoadBiasConfig>,
101 #[prost(message, optional, tag = "4")]
104 pub retry_after: ::core::option::Option<super::RetryAfterConfig>,
105 }
106 #[derive(Clone, PartialEq, ::prost::Message)]
107 pub struct Tls {
108 #[prost(message, repeated, tag = "1")]
109 pub routes: ::prost::alloc::vec::Vec<super::TlsRoute>,
110 }
111 #[derive(Clone, PartialEq, ::prost::Oneof)]
112 pub enum Kind {
113 #[prost(message, tag = "1")]
114 Detect(Detect),
115 #[prost(message, tag = "2")]
116 Opaque(Opaque),
117 #[prost(message, tag = "3")]
119 Http1(Http1),
120 #[prost(message, tag = "4")]
122 Http2(Http2),
123 #[prost(message, tag = "5")]
125 Grpc(Grpc),
126 #[prost(message, tag = "6")]
128 Tls(Tls),
129 }
130}
131#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct HttpRoute {
135 #[prost(message, optional, tag = "1")]
136 pub metadata: ::core::option::Option<super::meta::Metadata>,
137 #[prost(message, repeated, tag = "2")]
139 pub hosts: ::prost::alloc::vec::Vec<super::http_route::HostMatch>,
140 #[prost(message, repeated, tag = "3")]
142 pub rules: ::prost::alloc::vec::Vec<http_route::Rule>,
143}
144pub mod http_route {
146 #[derive(Clone, PartialEq, ::prost::Message)]
147 pub struct Rule {
148 #[prost(message, repeated, tag = "1")]
149 pub matches: ::prost::alloc::vec::Vec<super::super::http_route::HttpRouteMatch>,
150 #[prost(message, repeated, tag = "2")]
151 pub filters: ::prost::alloc::vec::Vec<Filter>,
152 #[prost(message, optional, tag = "3")]
153 pub backends: ::core::option::Option<Distribution>,
154 #[deprecated]
157 #[prost(message, optional, tag = "4")]
158 pub request_timeout: ::core::option::Option<::prost_types::Duration>,
159 #[prost(message, optional, tag = "5")]
160 pub timeouts: ::core::option::Option<super::super::http_route::Timeouts>,
161 #[prost(message, optional, tag = "6")]
162 pub retry: ::core::option::Option<Retry>,
163 #[prost(bool, tag = "7")]
166 pub allow_l5d_request_headers: bool,
167 }
168 #[derive(Clone, PartialEq, ::prost::Message)]
169 pub struct Filter {
170 #[prost(oneof = "filter::Kind", tags = "1, 2, 3, 4")]
171 pub kind: ::core::option::Option<filter::Kind>,
172 }
173 pub mod filter {
175 #[derive(Clone, PartialEq, ::prost::Oneof)]
176 pub enum Kind {
177 #[prost(message, tag = "1")]
178 FailureInjector(super::super::super::http_route::HttpFailureInjector),
179 #[prost(message, tag = "2")]
180 RequestHeaderModifier(
181 super::super::super::http_route::RequestHeaderModifier,
182 ),
183 #[prost(message, tag = "3")]
184 Redirect(super::super::super::http_route::RequestRedirect),
185 #[prost(message, tag = "4")]
186 ResponseHeaderModifier(
187 super::super::super::http_route::ResponseHeaderModifier,
188 ),
189 }
190 }
191 #[derive(Clone, PartialEq, ::prost::Message)]
192 pub struct Distribution {
193 #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
194 pub kind: ::core::option::Option<distribution::Kind>,
195 }
196 pub mod distribution {
198 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
199 pub struct Empty {}
200 #[derive(Clone, PartialEq, ::prost::Message)]
201 pub struct FirstAvailable {
202 #[prost(message, repeated, tag = "1")]
203 pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
204 }
205 #[derive(Clone, PartialEq, ::prost::Message)]
206 pub struct RandomAvailable {
207 #[prost(message, repeated, tag = "1")]
208 pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
209 }
210 #[derive(Clone, PartialEq, ::prost::Oneof)]
211 pub enum Kind {
212 #[prost(message, tag = "1")]
213 Empty(Empty),
214 #[prost(message, tag = "2")]
216 FirstAvailable(FirstAvailable),
217 #[prost(message, tag = "3")]
218 RandomAvailable(RandomAvailable),
219 }
220 }
221 #[derive(Clone, PartialEq, ::prost::Message)]
222 pub struct Retry {
223 #[prost(uint32, tag = "1")]
224 pub max_retries: u32,
225 #[prost(uint32, tag = "2")]
226 pub max_request_bytes: u32,
227 #[prost(message, optional, tag = "3")]
229 pub conditions: ::core::option::Option<retry::Conditions>,
230 #[prost(message, optional, tag = "4")]
231 pub timeout: ::core::option::Option<::prost_types::Duration>,
232 #[prost(message, optional, tag = "5")]
233 pub backoff: ::core::option::Option<super::ExponentialBackoff>,
234 }
235 pub mod retry {
237 #[derive(Clone, PartialEq, ::prost::Message)]
239 pub struct Conditions {
240 #[prost(message, repeated, tag = "1")]
242 pub status_ranges: ::prost::alloc::vec::Vec<conditions::StatusRange>,
243 }
244 pub mod conditions {
246 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
247 pub struct StatusRange {
248 #[prost(uint32, tag = "1")]
249 pub start: u32,
250 #[prost(uint32, tag = "2")]
251 pub end: u32,
252 }
253 }
254 }
255 #[derive(Clone, PartialEq, ::prost::Message)]
256 pub struct RouteBackend {
257 #[prost(message, optional, tag = "1")]
258 pub backend: ::core::option::Option<super::Backend>,
259 #[prost(message, repeated, tag = "3")]
260 pub filters: ::prost::alloc::vec::Vec<Filter>,
261 #[deprecated]
263 #[prost(message, optional, tag = "4")]
264 pub request_timeout: ::core::option::Option<::prost_types::Duration>,
265 }
266 #[derive(Clone, PartialEq, ::prost::Message)]
267 pub struct WeightedRouteBackend {
268 #[prost(message, optional, tag = "1")]
269 pub backend: ::core::option::Option<RouteBackend>,
270 #[prost(uint32, tag = "2")]
271 pub weight: u32,
272 }
273}
274#[derive(Clone, PartialEq, ::prost::Message)]
275pub struct GrpcRoute {
276 #[prost(message, optional, tag = "1")]
277 pub metadata: ::core::option::Option<super::meta::Metadata>,
278 #[prost(message, repeated, tag = "2")]
280 pub hosts: ::prost::alloc::vec::Vec<super::http_route::HostMatch>,
281 #[prost(message, repeated, tag = "3")]
283 pub rules: ::prost::alloc::vec::Vec<grpc_route::Rule>,
284}
285pub mod grpc_route {
287 #[derive(Clone, PartialEq, ::prost::Message)]
288 pub struct Rule {
289 #[prost(message, repeated, tag = "1")]
290 pub matches: ::prost::alloc::vec::Vec<super::super::grpc_route::GrpcRouteMatch>,
291 #[prost(message, repeated, tag = "2")]
292 pub filters: ::prost::alloc::vec::Vec<Filter>,
293 #[prost(message, optional, tag = "3")]
294 pub backends: ::core::option::Option<Distribution>,
295 #[deprecated]
298 #[prost(message, optional, tag = "4")]
299 pub request_timeout: ::core::option::Option<::prost_types::Duration>,
300 #[prost(message, optional, tag = "5")]
301 pub timeouts: ::core::option::Option<super::super::http_route::Timeouts>,
302 #[prost(message, optional, tag = "6")]
303 pub retry: ::core::option::Option<Retry>,
304 #[prost(bool, tag = "7")]
307 pub allow_l5d_request_headers: bool,
308 }
309 #[derive(Clone, PartialEq, ::prost::Message)]
310 pub struct Filter {
311 #[prost(oneof = "filter::Kind", tags = "1, 2")]
312 pub kind: ::core::option::Option<filter::Kind>,
313 }
314 pub mod filter {
316 #[derive(Clone, PartialEq, ::prost::Oneof)]
317 pub enum Kind {
318 #[prost(message, tag = "1")]
319 FailureInjector(super::super::super::grpc_route::GrpcFailureInjector),
320 #[prost(message, tag = "2")]
321 RequestHeaderModifier(
322 super::super::super::http_route::RequestHeaderModifier,
323 ),
324 }
325 }
326 #[derive(Clone, PartialEq, ::prost::Message)]
327 pub struct Distribution {
328 #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
329 pub kind: ::core::option::Option<distribution::Kind>,
330 }
331 pub mod distribution {
333 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
334 pub struct Empty {}
335 #[derive(Clone, PartialEq, ::prost::Message)]
336 pub struct FirstAvailable {
337 #[prost(message, repeated, tag = "1")]
338 pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
339 }
340 #[derive(Clone, PartialEq, ::prost::Message)]
341 pub struct RandomAvailable {
342 #[prost(message, repeated, tag = "1")]
343 pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
344 }
345 #[derive(Clone, PartialEq, ::prost::Oneof)]
346 pub enum Kind {
347 #[prost(message, tag = "1")]
348 Empty(Empty),
349 #[prost(message, tag = "2")]
351 FirstAvailable(FirstAvailable),
352 #[prost(message, tag = "3")]
353 RandomAvailable(RandomAvailable),
354 }
355 }
356 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
357 pub struct Retry {
358 #[prost(uint32, tag = "1")]
359 pub max_retries: u32,
360 #[prost(uint32, tag = "2")]
361 pub max_request_bytes: u32,
362 #[prost(message, optional, tag = "3")]
364 pub conditions: ::core::option::Option<retry::Conditions>,
365 #[prost(message, optional, tag = "4")]
366 pub timeout: ::core::option::Option<::prost_types::Duration>,
367 #[prost(message, optional, tag = "5")]
368 pub backoff: ::core::option::Option<super::ExponentialBackoff>,
369 }
370 pub mod retry {
372 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
374 pub struct Conditions {
375 #[prost(bool, tag = "1")]
376 pub cancelled: bool,
377 #[prost(bool, tag = "4")]
378 pub deadine_exceeded: bool,
379 #[prost(bool, tag = "8")]
380 pub resource_exhausted: bool,
381 #[prost(bool, tag = "13")]
382 pub internal: bool,
383 #[prost(bool, tag = "14")]
384 pub unavailable: bool,
385 }
386 }
387 #[derive(Clone, PartialEq, ::prost::Message)]
388 pub struct RouteBackend {
389 #[prost(message, optional, tag = "1")]
390 pub backend: ::core::option::Option<super::Backend>,
391 #[prost(message, repeated, tag = "3")]
392 pub filters: ::prost::alloc::vec::Vec<Filter>,
393 #[deprecated]
395 #[prost(message, optional, tag = "4")]
396 pub request_timeout: ::core::option::Option<::prost_types::Duration>,
397 }
398 #[derive(Clone, PartialEq, ::prost::Message)]
399 pub struct WeightedRouteBackend {
400 #[prost(message, optional, tag = "1")]
401 pub backend: ::core::option::Option<RouteBackend>,
402 #[prost(uint32, tag = "2")]
403 pub weight: u32,
404 }
405}
406#[derive(Clone, PartialEq, ::prost::Message)]
407pub struct OpaqueRoute {
408 #[prost(message, optional, tag = "1")]
409 pub metadata: ::core::option::Option<super::meta::Metadata>,
410 #[prost(message, repeated, tag = "3")]
412 pub rules: ::prost::alloc::vec::Vec<opaque_route::Rule>,
413}
414pub mod opaque_route {
416 #[derive(Clone, PartialEq, ::prost::Message)]
417 pub struct Rule {
418 #[prost(message, optional, tag = "1")]
419 pub backends: ::core::option::Option<Distribution>,
420 #[prost(message, repeated, tag = "2")]
421 pub filters: ::prost::alloc::vec::Vec<Filter>,
422 }
423 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
424 pub struct Filter {
425 #[prost(oneof = "filter::Kind", tags = "1, 2")]
426 pub kind: ::core::option::Option<filter::Kind>,
427 }
428 pub mod filter {
430 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
431 pub enum Kind {
432 #[prost(message, tag = "1")]
433 Invalid(super::super::super::opaque_route::Invalid),
434 #[prost(message, tag = "2")]
435 Forbidden(super::super::super::opaque_route::Forbidden),
436 }
437 }
438 #[derive(Clone, PartialEq, ::prost::Message)]
439 pub struct Distribution {
440 #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
441 pub kind: ::core::option::Option<distribution::Kind>,
442 }
443 pub mod distribution {
445 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
446 pub struct Empty {}
447 #[derive(Clone, PartialEq, ::prost::Message)]
448 pub struct FirstAvailable {
449 #[prost(message, repeated, tag = "1")]
450 pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
451 }
452 #[derive(Clone, PartialEq, ::prost::Message)]
453 pub struct RandomAvailable {
454 #[prost(message, repeated, tag = "1")]
455 pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
456 }
457 #[derive(Clone, PartialEq, ::prost::Oneof)]
458 pub enum Kind {
459 #[prost(message, tag = "1")]
460 Empty(Empty),
461 #[prost(message, tag = "2")]
463 FirstAvailable(FirstAvailable),
464 #[prost(message, tag = "3")]
465 RandomAvailable(RandomAvailable),
466 }
467 }
468 #[derive(Clone, PartialEq, ::prost::Message)]
469 pub struct RouteBackend {
470 #[prost(message, optional, tag = "1")]
471 pub backend: ::core::option::Option<super::Backend>,
472 #[prost(message, repeated, tag = "3")]
473 pub filters: ::prost::alloc::vec::Vec<Filter>,
474 }
475 #[derive(Clone, PartialEq, ::prost::Message)]
476 pub struct WeightedRouteBackend {
477 #[prost(message, optional, tag = "1")]
478 pub backend: ::core::option::Option<RouteBackend>,
479 #[prost(uint32, tag = "2")]
480 pub weight: u32,
481 }
482}
483#[derive(Clone, PartialEq, ::prost::Message)]
484pub struct TlsRoute {
485 #[prost(message, optional, tag = "1")]
486 pub metadata: ::core::option::Option<super::meta::Metadata>,
487 #[prost(message, repeated, tag = "2")]
489 pub snis: ::prost::alloc::vec::Vec<super::tls_route::SniMatch>,
490 #[prost(message, repeated, tag = "3")]
492 pub rules: ::prost::alloc::vec::Vec<tls_route::Rule>,
493}
494pub mod tls_route {
496 #[derive(Clone, PartialEq, ::prost::Message)]
497 pub struct Rule {
498 #[prost(message, optional, tag = "1")]
499 pub backends: ::core::option::Option<Distribution>,
500 #[prost(message, repeated, tag = "2")]
501 pub filters: ::prost::alloc::vec::Vec<Filter>,
502 }
503 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
504 pub struct Filter {
505 #[prost(oneof = "filter::Kind", tags = "1, 2")]
506 pub kind: ::core::option::Option<filter::Kind>,
507 }
508 pub mod filter {
510 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
511 pub enum Kind {
512 #[prost(message, tag = "1")]
513 Invalid(super::super::super::opaque_route::Invalid),
514 #[prost(message, tag = "2")]
515 Forbidden(super::super::super::opaque_route::Forbidden),
516 }
517 }
518 #[derive(Clone, PartialEq, ::prost::Message)]
519 pub struct Distribution {
520 #[prost(oneof = "distribution::Kind", tags = "1, 2, 3")]
521 pub kind: ::core::option::Option<distribution::Kind>,
522 }
523 pub mod distribution {
525 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
526 pub struct Empty {}
527 #[derive(Clone, PartialEq, ::prost::Message)]
528 pub struct FirstAvailable {
529 #[prost(message, repeated, tag = "1")]
530 pub backends: ::prost::alloc::vec::Vec<super::RouteBackend>,
531 }
532 #[derive(Clone, PartialEq, ::prost::Message)]
533 pub struct RandomAvailable {
534 #[prost(message, repeated, tag = "1")]
535 pub backends: ::prost::alloc::vec::Vec<super::WeightedRouteBackend>,
536 }
537 #[derive(Clone, PartialEq, ::prost::Oneof)]
538 pub enum Kind {
539 #[prost(message, tag = "1")]
540 Empty(Empty),
541 #[prost(message, tag = "2")]
543 FirstAvailable(FirstAvailable),
544 #[prost(message, tag = "3")]
545 RandomAvailable(RandomAvailable),
546 }
547 }
548 #[derive(Clone, PartialEq, ::prost::Message)]
549 pub struct RouteBackend {
550 #[prost(message, optional, tag = "1")]
551 pub backend: ::core::option::Option<super::Backend>,
552 #[prost(message, repeated, tag = "3")]
553 pub filters: ::prost::alloc::vec::Vec<Filter>,
554 }
555 #[derive(Clone, PartialEq, ::prost::Message)]
556 pub struct WeightedRouteBackend {
557 #[prost(message, optional, tag = "1")]
558 pub backend: ::core::option::Option<RouteBackend>,
559 #[prost(uint32, tag = "2")]
560 pub weight: u32,
561 }
562}
563#[derive(Clone, PartialEq, ::prost::Message)]
564pub struct Backend {
565 #[prost(message, optional, tag = "1")]
566 pub metadata: ::core::option::Option<super::meta::Metadata>,
567 #[prost(message, optional, tag = "4")]
569 pub queue: ::core::option::Option<Queue>,
570 #[prost(oneof = "backend::Kind", tags = "2, 3")]
571 pub kind: ::core::option::Option<backend::Kind>,
572}
573pub mod backend {
575 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
577 pub struct EndpointDiscovery {
578 #[prost(oneof = "endpoint_discovery::Kind", tags = "1")]
579 pub kind: ::core::option::Option<endpoint_discovery::Kind>,
580 }
581 pub mod endpoint_discovery {
583 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
584 pub struct DestinationGet {
585 #[prost(string, tag = "1")]
586 pub path: ::prost::alloc::string::String,
587 }
588 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
589 pub enum Kind {
590 #[prost(message, tag = "1")]
592 Dst(DestinationGet),
593 }
594 }
595 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
598 pub struct BalanceP2c {
599 #[prost(message, optional, tag = "1")]
600 pub discovery: ::core::option::Option<EndpointDiscovery>,
601 #[prost(message, optional, tag = "3")]
604 pub ejection: ::core::option::Option<super::EjectionConfig>,
605 #[prost(oneof = "balance_p2c::Load", tags = "2")]
607 pub load: ::core::option::Option<balance_p2c::Load>,
608 }
609 pub mod balance_p2c {
611 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
613 pub struct PeakEwma {
614 #[prost(message, optional, tag = "1")]
617 pub default_rtt: ::core::option::Option<::prost_types::Duration>,
618 #[prost(message, optional, tag = "2")]
620 pub decay: ::core::option::Option<::prost_types::Duration>,
621 }
622 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
624 pub enum Load {
625 #[prost(message, tag = "2")]
628 PeakEwma(PeakEwma),
629 }
630 }
631 #[derive(Clone, PartialEq, ::prost::Oneof)]
632 pub enum Kind {
633 #[prost(message, tag = "2")]
635 Forward(super::super::destination::WeightedAddr),
636 #[prost(message, tag = "3")]
638 Balancer(BalanceP2c),
639 }
640}
641#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
642pub struct Queue {
643 #[prost(uint32, tag = "1")]
646 pub capacity: u32,
647 #[prost(message, optional, tag = "2")]
650 pub failfast_timeout: ::core::option::Option<::prost_types::Duration>,
651}
652#[derive(Clone, Copy, PartialEq, ::prost::Message)]
655pub struct FailureAccrual {
656 #[prost(message, optional, tag = "1")]
659 pub consecutive_failures: ::core::option::Option<
660 failure_accrual::ConsecutiveFailures,
661 >,
662 #[prost(message, optional, tag = "2")]
665 pub success_rate: ::core::option::Option<failure_accrual::SuccessRate>,
666}
667pub mod failure_accrual {
669 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
670 pub struct ConsecutiveFailures {
671 #[prost(uint32, tag = "1")]
674 pub max_failures: u32,
675 #[prost(message, optional, tag = "2")]
678 pub backoff: ::core::option::Option<super::ExponentialBackoff>,
679 }
680 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
681 pub struct SuccessRate {
682 #[prost(double, tag = "1")]
687 pub threshold: f64,
688 #[prost(message, optional, tag = "2")]
690 pub decay: ::core::option::Option<::prost_types::Duration>,
691 #[prost(uint32, tag = "3")]
693 pub min_requests: u32,
694 }
695}
696#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
700pub struct LoadBiasConfig {
701 #[prost(bool, tag = "1")]
704 pub enabled: bool,
705 #[prost(message, optional, tag = "2")]
707 pub penalty: ::core::option::Option<::prost_types::Duration>,
708 #[prost(message, optional, tag = "3")]
710 pub penalty_decay: ::core::option::Option<::prost_types::Duration>,
711}
712#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
717pub struct RetryAfterConfig {
718 #[prost(message, optional, tag = "1")]
722 pub max_duration: ::core::option::Option<::prost_types::Duration>,
723}
724#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
729pub struct EjectionConfig {
730 #[prost(uint32, tag = "1")]
733 pub min_ready_endpoints: u32,
734}
735#[derive(Clone, Copy, PartialEq, ::prost::Message)]
736pub struct ExponentialBackoff {
737 #[prost(message, optional, tag = "1")]
739 pub min_backoff: ::core::option::Option<::prost_types::Duration>,
740 #[prost(message, optional, tag = "2")]
743 pub max_backoff: ::core::option::Option<::prost_types::Duration>,
744 #[prost(float, tag = "3")]
747 pub jitter_ratio: f32,
748}
749pub mod outbound_policies_client {
751 #![allow(
752 unused_variables,
753 dead_code,
754 missing_docs,
755 clippy::wildcard_imports,
756 clippy::let_unit_value,
757 )]
758 use tonic::codegen::*;
759 use tonic::codegen::http::Uri;
760 #[derive(Debug, Clone)]
761 pub struct OutboundPoliciesClient<T> {
762 inner: tonic::client::Grpc<T>,
763 }
764 impl OutboundPoliciesClient<tonic::transport::Channel> {
765 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
767 where
768 D: TryInto<tonic::transport::Endpoint>,
769 D::Error: Into<StdError>,
770 {
771 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
772 Ok(Self::new(conn))
773 }
774 }
775 impl<T> OutboundPoliciesClient<T>
776 where
777 T: tonic::client::GrpcService<tonic::body::Body>,
778 T::Error: Into<StdError>,
779 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
780 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
781 {
782 pub fn new(inner: T) -> Self {
783 let inner = tonic::client::Grpc::new(inner);
784 Self { inner }
785 }
786 pub fn with_origin(inner: T, origin: Uri) -> Self {
787 let inner = tonic::client::Grpc::with_origin(inner, origin);
788 Self { inner }
789 }
790 pub fn with_interceptor<F>(
791 inner: T,
792 interceptor: F,
793 ) -> OutboundPoliciesClient<InterceptedService<T, F>>
794 where
795 F: tonic::service::Interceptor,
796 T::ResponseBody: Default,
797 T: tonic::codegen::Service<
798 http::Request<tonic::body::Body>,
799 Response = http::Response<
800 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
801 >,
802 >,
803 <T as tonic::codegen::Service<
804 http::Request<tonic::body::Body>,
805 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
806 {
807 OutboundPoliciesClient::new(InterceptedService::new(inner, interceptor))
808 }
809 #[must_use]
814 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
815 self.inner = self.inner.send_compressed(encoding);
816 self
817 }
818 #[must_use]
820 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
821 self.inner = self.inner.accept_compressed(encoding);
822 self
823 }
824 #[must_use]
828 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
829 self.inner = self.inner.max_decoding_message_size(limit);
830 self
831 }
832 #[must_use]
836 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
837 self.inner = self.inner.max_encoding_message_size(limit);
838 self
839 }
840 pub async fn get(
841 &mut self,
842 request: impl tonic::IntoRequest<super::TrafficSpec>,
843 ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status> {
844 self.inner
845 .ready()
846 .await
847 .map_err(|e| {
848 tonic::Status::unknown(
849 format!("Service was not ready: {}", e.into()),
850 )
851 })?;
852 let codec = tonic_prost::ProstCodec::default();
853 let path = http::uri::PathAndQuery::from_static(
854 "/io.linkerd.proxy.outbound.OutboundPolicies/Get",
855 );
856 let mut req = request.into_request();
857 req.extensions_mut()
858 .insert(
859 GrpcMethod::new("io.linkerd.proxy.outbound.OutboundPolicies", "Get"),
860 );
861 self.inner.unary(req, path, codec).await
862 }
863 pub async fn watch(
864 &mut self,
865 request: impl tonic::IntoRequest<super::TrafficSpec>,
866 ) -> std::result::Result<
867 tonic::Response<tonic::codec::Streaming<super::OutboundPolicy>>,
868 tonic::Status,
869 > {
870 self.inner
871 .ready()
872 .await
873 .map_err(|e| {
874 tonic::Status::unknown(
875 format!("Service was not ready: {}", e.into()),
876 )
877 })?;
878 let codec = tonic_prost::ProstCodec::default();
879 let path = http::uri::PathAndQuery::from_static(
880 "/io.linkerd.proxy.outbound.OutboundPolicies/Watch",
881 );
882 let mut req = request.into_request();
883 req.extensions_mut()
884 .insert(
885 GrpcMethod::new(
886 "io.linkerd.proxy.outbound.OutboundPolicies",
887 "Watch",
888 ),
889 );
890 self.inner.server_streaming(req, path, codec).await
891 }
892 }
893}
894pub mod outbound_policies_server {
896 #![allow(
897 unused_variables,
898 dead_code,
899 missing_docs,
900 clippy::wildcard_imports,
901 clippy::let_unit_value,
902 )]
903 use tonic::codegen::*;
904 #[async_trait]
906 pub trait OutboundPolicies: std::marker::Send + std::marker::Sync + 'static {
907 async fn get(
908 &self,
909 request: tonic::Request<super::TrafficSpec>,
910 ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status>;
911 type WatchStream: tonic::codegen::tokio_stream::Stream<
913 Item = std::result::Result<super::OutboundPolicy, tonic::Status>,
914 >
915 + std::marker::Send
916 + 'static;
917 async fn watch(
918 &self,
919 request: tonic::Request<super::TrafficSpec>,
920 ) -> std::result::Result<tonic::Response<Self::WatchStream>, tonic::Status>;
921 }
922 #[derive(Debug)]
923 pub struct OutboundPoliciesServer<T> {
924 inner: Arc<T>,
925 accept_compression_encodings: EnabledCompressionEncodings,
926 send_compression_encodings: EnabledCompressionEncodings,
927 max_decoding_message_size: Option<usize>,
928 max_encoding_message_size: Option<usize>,
929 }
930 impl<T> OutboundPoliciesServer<T> {
931 pub fn new(inner: T) -> Self {
932 Self::from_arc(Arc::new(inner))
933 }
934 pub fn from_arc(inner: Arc<T>) -> Self {
935 Self {
936 inner,
937 accept_compression_encodings: Default::default(),
938 send_compression_encodings: Default::default(),
939 max_decoding_message_size: None,
940 max_encoding_message_size: None,
941 }
942 }
943 pub fn with_interceptor<F>(
944 inner: T,
945 interceptor: F,
946 ) -> InterceptedService<Self, F>
947 where
948 F: tonic::service::Interceptor,
949 {
950 InterceptedService::new(Self::new(inner), interceptor)
951 }
952 #[must_use]
954 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
955 self.accept_compression_encodings.enable(encoding);
956 self
957 }
958 #[must_use]
960 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
961 self.send_compression_encodings.enable(encoding);
962 self
963 }
964 #[must_use]
968 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
969 self.max_decoding_message_size = Some(limit);
970 self
971 }
972 #[must_use]
976 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
977 self.max_encoding_message_size = Some(limit);
978 self
979 }
980 }
981 impl<T, B> tonic::codegen::Service<http::Request<B>> for OutboundPoliciesServer<T>
982 where
983 T: OutboundPolicies,
984 B: Body + std::marker::Send + 'static,
985 B::Error: Into<StdError> + std::marker::Send + 'static,
986 {
987 type Response = http::Response<tonic::body::Body>;
988 type Error = std::convert::Infallible;
989 type Future = BoxFuture<Self::Response, Self::Error>;
990 fn poll_ready(
991 &mut self,
992 _cx: &mut Context<'_>,
993 ) -> Poll<std::result::Result<(), Self::Error>> {
994 Poll::Ready(Ok(()))
995 }
996 fn call(&mut self, req: http::Request<B>) -> Self::Future {
997 match req.uri().path() {
998 "/io.linkerd.proxy.outbound.OutboundPolicies/Get" => {
999 #[allow(non_camel_case_types)]
1000 struct GetSvc<T: OutboundPolicies>(pub Arc<T>);
1001 impl<
1002 T: OutboundPolicies,
1003 > tonic::server::UnaryService<super::TrafficSpec> for GetSvc<T> {
1004 type Response = super::OutboundPolicy;
1005 type Future = BoxFuture<
1006 tonic::Response<Self::Response>,
1007 tonic::Status,
1008 >;
1009 fn call(
1010 &mut self,
1011 request: tonic::Request<super::TrafficSpec>,
1012 ) -> Self::Future {
1013 let inner = Arc::clone(&self.0);
1014 let fut = async move {
1015 <T as OutboundPolicies>::get(&inner, request).await
1016 };
1017 Box::pin(fut)
1018 }
1019 }
1020 let accept_compression_encodings = self.accept_compression_encodings;
1021 let send_compression_encodings = self.send_compression_encodings;
1022 let max_decoding_message_size = self.max_decoding_message_size;
1023 let max_encoding_message_size = self.max_encoding_message_size;
1024 let inner = self.inner.clone();
1025 let fut = async move {
1026 let method = GetSvc(inner);
1027 let codec = tonic_prost::ProstCodec::default();
1028 let mut grpc = tonic::server::Grpc::new(codec)
1029 .apply_compression_config(
1030 accept_compression_encodings,
1031 send_compression_encodings,
1032 )
1033 .apply_max_message_size_config(
1034 max_decoding_message_size,
1035 max_encoding_message_size,
1036 );
1037 let res = grpc.unary(method, req).await;
1038 Ok(res)
1039 };
1040 Box::pin(fut)
1041 }
1042 "/io.linkerd.proxy.outbound.OutboundPolicies/Watch" => {
1043 #[allow(non_camel_case_types)]
1044 struct WatchSvc<T: OutboundPolicies>(pub Arc<T>);
1045 impl<
1046 T: OutboundPolicies,
1047 > tonic::server::ServerStreamingService<super::TrafficSpec>
1048 for WatchSvc<T> {
1049 type Response = super::OutboundPolicy;
1050 type ResponseStream = T::WatchStream;
1051 type Future = BoxFuture<
1052 tonic::Response<Self::ResponseStream>,
1053 tonic::Status,
1054 >;
1055 fn call(
1056 &mut self,
1057 request: tonic::Request<super::TrafficSpec>,
1058 ) -> Self::Future {
1059 let inner = Arc::clone(&self.0);
1060 let fut = async move {
1061 <T as OutboundPolicies>::watch(&inner, request).await
1062 };
1063 Box::pin(fut)
1064 }
1065 }
1066 let accept_compression_encodings = self.accept_compression_encodings;
1067 let send_compression_encodings = self.send_compression_encodings;
1068 let max_decoding_message_size = self.max_decoding_message_size;
1069 let max_encoding_message_size = self.max_encoding_message_size;
1070 let inner = self.inner.clone();
1071 let fut = async move {
1072 let method = WatchSvc(inner);
1073 let codec = tonic_prost::ProstCodec::default();
1074 let mut grpc = tonic::server::Grpc::new(codec)
1075 .apply_compression_config(
1076 accept_compression_encodings,
1077 send_compression_encodings,
1078 )
1079 .apply_max_message_size_config(
1080 max_decoding_message_size,
1081 max_encoding_message_size,
1082 );
1083 let res = grpc.server_streaming(method, req).await;
1084 Ok(res)
1085 };
1086 Box::pin(fut)
1087 }
1088 _ => {
1089 Box::pin(async move {
1090 let mut response = http::Response::new(
1091 tonic::body::Body::default(),
1092 );
1093 let headers = response.headers_mut();
1094 headers
1095 .insert(
1096 tonic::Status::GRPC_STATUS,
1097 (tonic::Code::Unimplemented as i32).into(),
1098 );
1099 headers
1100 .insert(
1101 http::header::CONTENT_TYPE,
1102 tonic::metadata::GRPC_CONTENT_TYPE,
1103 );
1104 Ok(response)
1105 })
1106 }
1107 }
1108 }
1109 }
1110 impl<T> Clone for OutboundPoliciesServer<T> {
1111 fn clone(&self) -> Self {
1112 let inner = self.inner.clone();
1113 Self {
1114 inner,
1115 accept_compression_encodings: self.accept_compression_encodings,
1116 send_compression_encodings: self.send_compression_encodings,
1117 max_decoding_message_size: self.max_decoding_message_size,
1118 max_encoding_message_size: self.max_encoding_message_size,
1119 }
1120 }
1121 }
1122 pub const SERVICE_NAME: &str = "io.linkerd.proxy.outbound.OutboundPolicies";
1124 impl<T> tonic::server::NamedService for OutboundPoliciesServer<T> {
1125 const NAME: &'static str = SERVICE_NAME;
1126 }
1127}