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")]
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::Oneof)]
601 pub enum Load {
602 #[prost(message, tag = "2")]
605 PeakEwma(PeakEwma),
606 }
607 }
608 #[derive(Clone, PartialEq, ::prost::Oneof)]
609 pub enum Kind {
610 #[prost(message, tag = "2")]
612 Forward(super::super::destination::WeightedAddr),
613 #[prost(message, tag = "3")]
615 Balancer(BalanceP2c),
616 }
617}
618#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
619pub struct Queue {
620 #[prost(uint32, tag = "1")]
623 pub capacity: u32,
624 #[prost(message, optional, tag = "2")]
627 pub failfast_timeout: ::core::option::Option<::prost_types::Duration>,
628}
629#[derive(Clone, Copy, PartialEq, ::prost::Message)]
630pub struct FailureAccrual {
631 #[prost(oneof = "failure_accrual::Kind", tags = "1")]
632 pub kind: ::core::option::Option<failure_accrual::Kind>,
633}
634pub mod failure_accrual {
636 #[derive(Clone, Copy, PartialEq, ::prost::Message)]
637 pub struct ConsecutiveFailures {
638 #[prost(uint32, tag = "1")]
639 pub max_failures: u32,
640 #[prost(message, optional, tag = "2")]
641 pub backoff: ::core::option::Option<super::ExponentialBackoff>,
642 }
643 #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
644 pub enum Kind {
645 #[prost(message, tag = "1")]
646 ConsecutiveFailures(ConsecutiveFailures),
647 }
648}
649#[derive(Clone, Copy, PartialEq, ::prost::Message)]
650pub struct ExponentialBackoff {
651 #[prost(message, optional, tag = "1")]
653 pub min_backoff: ::core::option::Option<::prost_types::Duration>,
654 #[prost(message, optional, tag = "2")]
657 pub max_backoff: ::core::option::Option<::prost_types::Duration>,
658 #[prost(float, tag = "3")]
661 pub jitter_ratio: f32,
662}
663pub mod outbound_policies_client {
665 #![allow(
666 unused_variables,
667 dead_code,
668 missing_docs,
669 clippy::wildcard_imports,
670 clippy::let_unit_value,
671 )]
672 use tonic::codegen::*;
673 use tonic::codegen::http::Uri;
674 #[derive(Debug, Clone)]
675 pub struct OutboundPoliciesClient<T> {
676 inner: tonic::client::Grpc<T>,
677 }
678 impl OutboundPoliciesClient<tonic::transport::Channel> {
679 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
681 where
682 D: TryInto<tonic::transport::Endpoint>,
683 D::Error: Into<StdError>,
684 {
685 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
686 Ok(Self::new(conn))
687 }
688 }
689 impl<T> OutboundPoliciesClient<T>
690 where
691 T: tonic::client::GrpcService<tonic::body::Body>,
692 T::Error: Into<StdError>,
693 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
694 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
695 {
696 pub fn new(inner: T) -> Self {
697 let inner = tonic::client::Grpc::new(inner);
698 Self { inner }
699 }
700 pub fn with_origin(inner: T, origin: Uri) -> Self {
701 let inner = tonic::client::Grpc::with_origin(inner, origin);
702 Self { inner }
703 }
704 pub fn with_interceptor<F>(
705 inner: T,
706 interceptor: F,
707 ) -> OutboundPoliciesClient<InterceptedService<T, F>>
708 where
709 F: tonic::service::Interceptor,
710 T::ResponseBody: Default,
711 T: tonic::codegen::Service<
712 http::Request<tonic::body::Body>,
713 Response = http::Response<
714 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
715 >,
716 >,
717 <T as tonic::codegen::Service<
718 http::Request<tonic::body::Body>,
719 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
720 {
721 OutboundPoliciesClient::new(InterceptedService::new(inner, interceptor))
722 }
723 #[must_use]
728 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
729 self.inner = self.inner.send_compressed(encoding);
730 self
731 }
732 #[must_use]
734 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
735 self.inner = self.inner.accept_compressed(encoding);
736 self
737 }
738 #[must_use]
742 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
743 self.inner = self.inner.max_decoding_message_size(limit);
744 self
745 }
746 #[must_use]
750 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
751 self.inner = self.inner.max_encoding_message_size(limit);
752 self
753 }
754 pub async fn get(
755 &mut self,
756 request: impl tonic::IntoRequest<super::TrafficSpec>,
757 ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status> {
758 self.inner
759 .ready()
760 .await
761 .map_err(|e| {
762 tonic::Status::unknown(
763 format!("Service was not ready: {}", e.into()),
764 )
765 })?;
766 let codec = tonic_prost::ProstCodec::default();
767 let path = http::uri::PathAndQuery::from_static(
768 "/io.linkerd.proxy.outbound.OutboundPolicies/Get",
769 );
770 let mut req = request.into_request();
771 req.extensions_mut()
772 .insert(
773 GrpcMethod::new("io.linkerd.proxy.outbound.OutboundPolicies", "Get"),
774 );
775 self.inner.unary(req, path, codec).await
776 }
777 pub async fn watch(
778 &mut self,
779 request: impl tonic::IntoRequest<super::TrafficSpec>,
780 ) -> std::result::Result<
781 tonic::Response<tonic::codec::Streaming<super::OutboundPolicy>>,
782 tonic::Status,
783 > {
784 self.inner
785 .ready()
786 .await
787 .map_err(|e| {
788 tonic::Status::unknown(
789 format!("Service was not ready: {}", e.into()),
790 )
791 })?;
792 let codec = tonic_prost::ProstCodec::default();
793 let path = http::uri::PathAndQuery::from_static(
794 "/io.linkerd.proxy.outbound.OutboundPolicies/Watch",
795 );
796 let mut req = request.into_request();
797 req.extensions_mut()
798 .insert(
799 GrpcMethod::new(
800 "io.linkerd.proxy.outbound.OutboundPolicies",
801 "Watch",
802 ),
803 );
804 self.inner.server_streaming(req, path, codec).await
805 }
806 }
807}
808pub mod outbound_policies_server {
810 #![allow(
811 unused_variables,
812 dead_code,
813 missing_docs,
814 clippy::wildcard_imports,
815 clippy::let_unit_value,
816 )]
817 use tonic::codegen::*;
818 #[async_trait]
820 pub trait OutboundPolicies: std::marker::Send + std::marker::Sync + 'static {
821 async fn get(
822 &self,
823 request: tonic::Request<super::TrafficSpec>,
824 ) -> std::result::Result<tonic::Response<super::OutboundPolicy>, tonic::Status>;
825 type WatchStream: tonic::codegen::tokio_stream::Stream<
827 Item = std::result::Result<super::OutboundPolicy, tonic::Status>,
828 >
829 + std::marker::Send
830 + 'static;
831 async fn watch(
832 &self,
833 request: tonic::Request<super::TrafficSpec>,
834 ) -> std::result::Result<tonic::Response<Self::WatchStream>, tonic::Status>;
835 }
836 #[derive(Debug)]
837 pub struct OutboundPoliciesServer<T> {
838 inner: Arc<T>,
839 accept_compression_encodings: EnabledCompressionEncodings,
840 send_compression_encodings: EnabledCompressionEncodings,
841 max_decoding_message_size: Option<usize>,
842 max_encoding_message_size: Option<usize>,
843 }
844 impl<T> OutboundPoliciesServer<T> {
845 pub fn new(inner: T) -> Self {
846 Self::from_arc(Arc::new(inner))
847 }
848 pub fn from_arc(inner: Arc<T>) -> Self {
849 Self {
850 inner,
851 accept_compression_encodings: Default::default(),
852 send_compression_encodings: Default::default(),
853 max_decoding_message_size: None,
854 max_encoding_message_size: None,
855 }
856 }
857 pub fn with_interceptor<F>(
858 inner: T,
859 interceptor: F,
860 ) -> InterceptedService<Self, F>
861 where
862 F: tonic::service::Interceptor,
863 {
864 InterceptedService::new(Self::new(inner), interceptor)
865 }
866 #[must_use]
868 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
869 self.accept_compression_encodings.enable(encoding);
870 self
871 }
872 #[must_use]
874 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
875 self.send_compression_encodings.enable(encoding);
876 self
877 }
878 #[must_use]
882 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
883 self.max_decoding_message_size = Some(limit);
884 self
885 }
886 #[must_use]
890 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
891 self.max_encoding_message_size = Some(limit);
892 self
893 }
894 }
895 impl<T, B> tonic::codegen::Service<http::Request<B>> for OutboundPoliciesServer<T>
896 where
897 T: OutboundPolicies,
898 B: Body + std::marker::Send + 'static,
899 B::Error: Into<StdError> + std::marker::Send + 'static,
900 {
901 type Response = http::Response<tonic::body::Body>;
902 type Error = std::convert::Infallible;
903 type Future = BoxFuture<Self::Response, Self::Error>;
904 fn poll_ready(
905 &mut self,
906 _cx: &mut Context<'_>,
907 ) -> Poll<std::result::Result<(), Self::Error>> {
908 Poll::Ready(Ok(()))
909 }
910 fn call(&mut self, req: http::Request<B>) -> Self::Future {
911 match req.uri().path() {
912 "/io.linkerd.proxy.outbound.OutboundPolicies/Get" => {
913 #[allow(non_camel_case_types)]
914 struct GetSvc<T: OutboundPolicies>(pub Arc<T>);
915 impl<
916 T: OutboundPolicies,
917 > tonic::server::UnaryService<super::TrafficSpec> for GetSvc<T> {
918 type Response = super::OutboundPolicy;
919 type Future = BoxFuture<
920 tonic::Response<Self::Response>,
921 tonic::Status,
922 >;
923 fn call(
924 &mut self,
925 request: tonic::Request<super::TrafficSpec>,
926 ) -> Self::Future {
927 let inner = Arc::clone(&self.0);
928 let fut = async move {
929 <T as OutboundPolicies>::get(&inner, request).await
930 };
931 Box::pin(fut)
932 }
933 }
934 let accept_compression_encodings = self.accept_compression_encodings;
935 let send_compression_encodings = self.send_compression_encodings;
936 let max_decoding_message_size = self.max_decoding_message_size;
937 let max_encoding_message_size = self.max_encoding_message_size;
938 let inner = self.inner.clone();
939 let fut = async move {
940 let method = GetSvc(inner);
941 let codec = tonic_prost::ProstCodec::default();
942 let mut grpc = tonic::server::Grpc::new(codec)
943 .apply_compression_config(
944 accept_compression_encodings,
945 send_compression_encodings,
946 )
947 .apply_max_message_size_config(
948 max_decoding_message_size,
949 max_encoding_message_size,
950 );
951 let res = grpc.unary(method, req).await;
952 Ok(res)
953 };
954 Box::pin(fut)
955 }
956 "/io.linkerd.proxy.outbound.OutboundPolicies/Watch" => {
957 #[allow(non_camel_case_types)]
958 struct WatchSvc<T: OutboundPolicies>(pub Arc<T>);
959 impl<
960 T: OutboundPolicies,
961 > tonic::server::ServerStreamingService<super::TrafficSpec>
962 for WatchSvc<T> {
963 type Response = super::OutboundPolicy;
964 type ResponseStream = T::WatchStream;
965 type Future = BoxFuture<
966 tonic::Response<Self::ResponseStream>,
967 tonic::Status,
968 >;
969 fn call(
970 &mut self,
971 request: tonic::Request<super::TrafficSpec>,
972 ) -> Self::Future {
973 let inner = Arc::clone(&self.0);
974 let fut = async move {
975 <T as OutboundPolicies>::watch(&inner, request).await
976 };
977 Box::pin(fut)
978 }
979 }
980 let accept_compression_encodings = self.accept_compression_encodings;
981 let send_compression_encodings = self.send_compression_encodings;
982 let max_decoding_message_size = self.max_decoding_message_size;
983 let max_encoding_message_size = self.max_encoding_message_size;
984 let inner = self.inner.clone();
985 let fut = async move {
986 let method = WatchSvc(inner);
987 let codec = tonic_prost::ProstCodec::default();
988 let mut grpc = tonic::server::Grpc::new(codec)
989 .apply_compression_config(
990 accept_compression_encodings,
991 send_compression_encodings,
992 )
993 .apply_max_message_size_config(
994 max_decoding_message_size,
995 max_encoding_message_size,
996 );
997 let res = grpc.server_streaming(method, req).await;
998 Ok(res)
999 };
1000 Box::pin(fut)
1001 }
1002 _ => {
1003 Box::pin(async move {
1004 let mut response = http::Response::new(
1005 tonic::body::Body::default(),
1006 );
1007 let headers = response.headers_mut();
1008 headers
1009 .insert(
1010 tonic::Status::GRPC_STATUS,
1011 (tonic::Code::Unimplemented as i32).into(),
1012 );
1013 headers
1014 .insert(
1015 http::header::CONTENT_TYPE,
1016 tonic::metadata::GRPC_CONTENT_TYPE,
1017 );
1018 Ok(response)
1019 })
1020 }
1021 }
1022 }
1023 }
1024 impl<T> Clone for OutboundPoliciesServer<T> {
1025 fn clone(&self) -> Self {
1026 let inner = self.inner.clone();
1027 Self {
1028 inner,
1029 accept_compression_encodings: self.accept_compression_encodings,
1030 send_compression_encodings: self.send_compression_encodings,
1031 max_decoding_message_size: self.max_decoding_message_size,
1032 max_encoding_message_size: self.max_encoding_message_size,
1033 }
1034 }
1035 }
1036 pub const SERVICE_NAME: &str = "io.linkerd.proxy.outbound.OutboundPolicies";
1038 impl<T> tonic::server::NamedService for OutboundPoliciesServer<T> {
1039 const NAME: &'static str = SERVICE_NAME;
1040 }
1041}