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 }
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 #[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 #[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 #[prost(message, tag = "3")]
100 Http1(Http1),
101 #[prost(message, tag = "4")]
103 Http2(Http2),
104 #[prost(message, tag = "5")]
106 Grpc(Grpc),
107 #[prost(message, tag = "6")]
109 Tls(Tls),
110 }
111}
112#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct HttpRoute {
116 #[prost(message, optional, tag = "1")]
117 pub metadata: ::core::option::Option<super::meta::Metadata>,
118 #[prost(message, repeated, tag = "2")]
120 pub hosts: ::prost::alloc::vec::Vec<super::http_route::HostMatch>,
121 #[prost(message, repeated, tag = "3")]
123 pub rules: ::prost::alloc::vec::Vec<http_route::Rule>,
124}
125pub 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]
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 #[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 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 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 #[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 #[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 pub mod retry {
218 #[derive(Clone, PartialEq, ::prost::Message)]
220 pub struct Conditions {
221 #[prost(message, repeated, tag = "1")]
223 pub status_ranges: ::prost::alloc::vec::Vec<conditions::StatusRange>,
224 }
225 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]
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 #[prost(message, repeated, tag = "2")]
261 pub hosts: ::prost::alloc::vec::Vec<super::http_route::HostMatch>,
262 #[prost(message, repeated, tag = "3")]
264 pub rules: ::prost::alloc::vec::Vec<grpc_route::Rule>,
265}
266pub 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]
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 #[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 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 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 #[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 #[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 pub mod retry {
353 #[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]
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 #[prost(message, repeated, tag = "3")]
393 pub rules: ::prost::alloc::vec::Vec<opaque_route::Rule>,
394}
395pub 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 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 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 #[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 #[prost(message, repeated, tag = "2")]
470 pub snis: ::prost::alloc::vec::Vec<super::tls_route::SniMatch>,
471 #[prost(message, repeated, tag = "3")]
473 pub rules: ::prost::alloc::vec::Vec<tls_route::Rule>,
474}
475pub 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 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 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 #[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 #[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}
554pub mod backend {
556 #[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 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 #[prost(message, tag = "1")]
573 Dst(DestinationGet),
574 }
575 }
576 #[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 #[prost(oneof = "balance_p2c::Load", tags = "2, 3")]
584 pub load: ::core::option::Option<balance_p2c::Load>,
585 }
586 pub mod balance_p2c {
588 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
590 pub struct PeakEwma {
591 #[prost(message, optional, tag = "1")]
594 pub default_rtt: ::core::option::Option<::prost_types::Duration>,
595 #[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 #[prost(message, optional, tag = "1")]
604 pub default_rtt: ::core::option::Option<::prost_types::Duration>,
605 #[prost(message, optional, tag = "2")]
607 pub decay: ::core::option::Option<::prost_types::Duration>,
608 #[prost(message, optional, tag = "3")]
610 pub penalty: ::core::option::Option<::prost_types::Duration>,
611 #[prost(message, optional, tag = "4")]
613 pub max_retry_after: ::core::option::Option<::prost_types::Duration>,
614 #[prost(message, optional, tag = "5")]
616 pub penalty_decay: ::core::option::Option<::prost_types::Duration>,
617 }
618 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
620 pub enum Load {
621 #[prost(message, tag = "2")]
624 PeakEwma(PeakEwma),
625 #[prost(message, tag = "3")]
628 PenaltyPeakEwma(PenaltyPeakEwma),
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 = "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}
663pub mod failure_accrual {
665 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
666 pub struct ConsecutiveFailures {
667 #[prost(uint32, tag = "1")]
670 pub max_failures: u32,
671 #[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 #[prost(double, tag = "1")]
683 pub success_rate_threshold: f64,
684 #[prost(message, optional, tag = "2")]
686 pub decay: ::core::option::Option<::prost_types::Duration>,
687 #[prost(uint32, tag = "3")]
689 pub min_requests: u32,
690 #[prost(uint32, tag = "4")]
693 pub max_consecutive_failures: u32,
694 #[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#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
712pub struct EjectionConfig {
713 #[prost(uint32, tag = "1")]
716 pub min_ready_endpoints: u32,
717}
718#[derive(Clone, Copy, PartialEq, ::prost::Message)]
719pub struct ExponentialBackoff {
720 #[prost(message, optional, tag = "1")]
722 pub min_backoff: ::core::option::Option<::prost_types::Duration>,
723 #[prost(message, optional, tag = "2")]
726 pub max_backoff: ::core::option::Option<::prost_types::Duration>,
727 #[prost(float, tag = "3")]
730 pub jitter_ratio: f32,
731 #[prost(bool, tag = "4")]
734 pub respect_retry_after_hint: bool,
735}
736pub 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 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 #[must_use]
801 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
802 self.inner = self.inner.send_compressed(encoding);
803 self
804 }
805 #[must_use]
807 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
808 self.inner = self.inner.accept_compressed(encoding);
809 self
810 }
811 #[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 #[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}
881pub 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 #[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 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 #[must_use]
941 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
942 self.accept_compression_encodings.enable(encoding);
943 self
944 }
945 #[must_use]
947 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
948 self.send_compression_encodings.enable(encoding);
949 self
950 }
951 #[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 #[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 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}