/
metaprotocol_metarouter.pb.go
4699 lines (4528 loc) · 122 KB
/
metaprotocol_metarouter.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api/metaprotocol/v1alpha1/metaprotocol_metarouter.proto
// $schema: metaprotocol.aeraki.io.v1alpha1.MetaRouter
// $title: MetaRouter
// $description: MetaRouter defines route policies for MetaProtocol proxy.
//
// MetaRouter defines route policies for MetaProtocol proxy.
// *Note*: Only one MetaRouter should be defined for a MetaProtocol service.
// If more than one MetaRouters are found for a service, Aeraki will choose
// a random one to apply to that service.
//
// *Note *: MetaRouter is a mesh-scoped resource, so no matter which namespace
// the MetaRouter is in, it will take effect on the services specified in the hosts.
//
// ```yaml
// apiVersion: metaprotocol.aeraki.io/v1alpha1
// kind: MetaRouter
// metadata:
// name: attribute-based-route
// namespace: istio-system
// spec:
// hosts:
// - org.apache.dubbo.samples.basic.api.demoservice
// gateways:
// - istio-system/ingress-gateway
// routes:
// - name: v1
// match:
// attributes:
// interface:
// exact: org.apache.dubbo.samples.basic.api.DemoService
// method:
// exact: sayHello
// route:
// - destination:
// host: org.apache.dubbo.samples.basic.api.demoservice
// subset: v1
//
// ```
//
// ```yaml
// apiVersion: metaprotocol.aeraki.io/v1alpha1
// kind: MetaRouter
// metadata:
// name: traffic-splitting
// spec:
// hosts:
// - org.apache.dubbo.samples.basic.api.demoservice
// routes:
// - name: traffic-spilt
// route:
// - destination:
// host: org.apache.dubbo.samples.basic.api.demoservice
// subset: v1
// weight: 20
// - destination:
// host: org.apache.dubbo.samples.basic.api.demoservice
// subset: v2
// weight: 80
package v1alpha1
import (
encoding_binary "encoding/binary"
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
io "io"
_ "istio.io/gogo-genproto/googleapis/google/api"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// MetaRouter defines route policies for MetaProtocol proxy.
//
// <!-- crd generation tags
// +cue-gen:MetaRouter:groupName:metaprotocol.aeraki.io
// +cue-gen:MetaRouter:version:v1alpha1
// +cue-gen:MetaRouter:storageVersion
// +cue-gen:MetaRouter:annotations:helm.sh/resource-policy=keep
// +cue-gen:MetaRouter:labels:app=aeraki,chart=aeraki,heritage=Tiller,release=aeraki
// +cue-gen:MetaRouter:subresource:status
// +cue-gen:MetaRouter:scope:Namespaced
// +cue-gen:MetaRouter:resource:categories=aeraki-io,metaprotocol-aeraki-io
// +cue-gen:MetaRouter:preserveUnknownFields:false
// -->
//
// <!-- go code generation tags
// +kubetype-gen
// +kubetype-gen:groupVersion=metaprotocol.aeraki.io/v1alpha1
// +genclient
// +k8s:deepcopy-gen=true
// -->
type MetaRouter struct {
// The destination service to which traffic is being sent.
// *Note for Kubernetes users*: It must be a fully qualified domain name
// (FQDN), (e.g. "thrift-sample-server.meta-thrift.svc.cluster.local" )
// instead of a short name (e.g. "thrift-sample-server").
// *Note*: Only one host is supported now. If multiple hosts are specified,
// Only the first one takes effect.
Hosts []string `protobuf:"bytes,1,rep,name=hosts,proto3" json:"hosts,omitempty"`
// The names of gateways and sidecars that should apply these routes. The usage of
// this field is the same as istio.io/VirtualService
Gateways []string `protobuf:"bytes,2,rep,name=gateways,proto3" json:"gateways,omitempty"`
// An ordered list of route rules for MetaProtocol traffic. The route rules
// will be applied to service ports named "tcp-metaprotocol-${applicationProtocol}-*",
// (e.g. "tcp-metaprotocol-thrift-hello-server"). Order maters in the routes,
// The first rule matching an incoming request is used.
Routes []*MetaRoute `protobuf:"bytes,3,rep,name=routes,proto3" json:"routes,omitempty"`
// Loacal rate limit policy.
LocalRateLimit *LocalRateLimit `protobuf:"bytes,4,opt,name=local_rate_limit,json=localRateLimit,proto3" json:"local_rate_limit,omitempty"`
// Global rate limit policy.
GlobalRateLimit *GlobalRateLimit `protobuf:"bytes,5,opt,name=global_rate_limit,json=globalRateLimit,proto3" json:"global_rate_limit,omitempty"`
// A list of namespaces to which this MetaRouter is exported. Exporting a
// MetaRouter allows it to be used by sidecars defined in other namespaces.
// This feature provides a mechanism for service owners and mesh administrators
// to control the visibility of MetaRouter across namespace boundaries.
//
// If no namespaces are specified then the MetaRouter is exported to all namespaces
// by default.
//
// The value "." is reserved and defines an export to the same namespace that
// the MetaRouter is declared in. Similarly the value "*" is reserved and
// defines an export to all namespaces.
ExportTo []string `protobuf:"bytes,20,rep,name=export_to,json=exportTo,proto3" json:"export_to,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MetaRouter) Reset() { *m = MetaRouter{} }
func (m *MetaRouter) String() string { return proto.CompactTextString(m) }
func (*MetaRouter) ProtoMessage() {}
func (*MetaRouter) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{0}
}
func (m *MetaRouter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MetaRouter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MetaRouter.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *MetaRouter) XXX_Merge(src proto.Message) {
xxx_messageInfo_MetaRouter.Merge(m, src)
}
func (m *MetaRouter) XXX_Size() int {
return m.Size()
}
func (m *MetaRouter) XXX_DiscardUnknown() {
xxx_messageInfo_MetaRouter.DiscardUnknown(m)
}
var xxx_messageInfo_MetaRouter proto.InternalMessageInfo
func (m *MetaRouter) GetHosts() []string {
if m != nil {
return m.Hosts
}
return nil
}
func (m *MetaRouter) GetGateways() []string {
if m != nil {
return m.Gateways
}
return nil
}
func (m *MetaRouter) GetRoutes() []*MetaRoute {
if m != nil {
return m.Routes
}
return nil
}
func (m *MetaRouter) GetLocalRateLimit() *LocalRateLimit {
if m != nil {
return m.LocalRateLimit
}
return nil
}
func (m *MetaRouter) GetGlobalRateLimit() *GlobalRateLimit {
if m != nil {
return m.GlobalRateLimit
}
return nil
}
func (m *MetaRouter) GetExportTo() []string {
if m != nil {
return m.ExportTo
}
return nil
}
// Describes match conditions and actions for routing MetaProtocol.
type MetaRoute struct {
// The name assigned to the route for debugging purposes.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Match conditions to be satisfied for the rule to be activated.
// All conditions inside a single match block have AND semantic.
Match *MetaRouteMatch `protobuf:"bytes,2,opt,name=match,proto3" json:"match,omitempty"`
// A Route rule can forward (default) traffic. The forwarding target
// can be one of several versions of a service (see glossary in
// beginning of document). Weights associated with the service version
// determine the proportion of traffic it receives.
Route []*MetaRouteDestination `protobuf:"bytes,3,rep,name=route,proto3" json:"route,omitempty"`
Mirror *Destination `protobuf:"bytes,5,opt,name=mirror,proto3" json:"mirror,omitempty"`
// Percentage of the traffic to be mirrored by the `mirror` field.
// If this field is absent, all the traffic (100%) will be mirrored.
// Max value is 100.
MirrorPercentage *Percent `protobuf:"bytes,6,opt,name=mirror_percentage,json=mirrorPercentage,proto3" json:"mirror_percentage,omitempty"`
// Specifies a list of key-value pairs that should be mutated for each request. How to interpret the key-value pairs
// depends on the codec implementation
RequestMutation []*KeyValue `protobuf:"bytes,19,rep,name=request_mutation,json=requestMutation,proto3" json:"request_mutation,omitempty"`
// Specifies a list of key-value pairs that should be mutated for each response. How to interpret the key-value pairs
// depends on the codec implementation
ResponseMutation []*KeyValue `protobuf:"bytes,20,rep,name=response_mutation,json=responseMutation,proto3" json:"response_mutation,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MetaRoute) Reset() { *m = MetaRoute{} }
func (m *MetaRoute) String() string { return proto.CompactTextString(m) }
func (*MetaRoute) ProtoMessage() {}
func (*MetaRoute) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{1}
}
func (m *MetaRoute) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MetaRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MetaRoute.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *MetaRoute) XXX_Merge(src proto.Message) {
xxx_messageInfo_MetaRoute.Merge(m, src)
}
func (m *MetaRoute) XXX_Size() int {
return m.Size()
}
func (m *MetaRoute) XXX_DiscardUnknown() {
xxx_messageInfo_MetaRoute.DiscardUnknown(m)
}
var xxx_messageInfo_MetaRoute proto.InternalMessageInfo
func (m *MetaRoute) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *MetaRoute) GetMatch() *MetaRouteMatch {
if m != nil {
return m.Match
}
return nil
}
func (m *MetaRoute) GetRoute() []*MetaRouteDestination {
if m != nil {
return m.Route
}
return nil
}
func (m *MetaRoute) GetMirror() *Destination {
if m != nil {
return m.Mirror
}
return nil
}
func (m *MetaRoute) GetMirrorPercentage() *Percent {
if m != nil {
return m.MirrorPercentage
}
return nil
}
func (m *MetaRoute) GetRequestMutation() []*KeyValue {
if m != nil {
return m.RequestMutation
}
return nil
}
func (m *MetaRoute) GetResponseMutation() []*KeyValue {
if m != nil {
return m.ResponseMutation
}
return nil
}
// KeyValue defines a Key /value pair.
type KeyValue struct {
// Key name.
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// alue.
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *KeyValue) Reset() { *m = KeyValue{} }
func (m *KeyValue) String() string { return proto.CompactTextString(m) }
func (*KeyValue) ProtoMessage() {}
func (*KeyValue) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{2}
}
func (m *KeyValue) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *KeyValue) XXX_Merge(src proto.Message) {
xxx_messageInfo_KeyValue.Merge(m, src)
}
func (m *KeyValue) XXX_Size() int {
return m.Size()
}
func (m *KeyValue) XXX_DiscardUnknown() {
xxx_messageInfo_KeyValue.DiscardUnknown(m)
}
var xxx_messageInfo_KeyValue proto.InternalMessageInfo
func (m *KeyValue) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
func (m *KeyValue) GetValue() string {
if m != nil {
return m.Value
}
return ""
}
type MetaRouteMatch struct {
// If the value is empty and only the name of attribute is specified, presence of the attribute is checked.
Attributes map[string]*StringMatch `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MetaRouteMatch) Reset() { *m = MetaRouteMatch{} }
func (m *MetaRouteMatch) String() string { return proto.CompactTextString(m) }
func (*MetaRouteMatch) ProtoMessage() {}
func (*MetaRouteMatch) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{3}
}
func (m *MetaRouteMatch) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MetaRouteMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MetaRouteMatch.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *MetaRouteMatch) XXX_Merge(src proto.Message) {
xxx_messageInfo_MetaRouteMatch.Merge(m, src)
}
func (m *MetaRouteMatch) XXX_Size() int {
return m.Size()
}
func (m *MetaRouteMatch) XXX_DiscardUnknown() {
xxx_messageInfo_MetaRouteMatch.DiscardUnknown(m)
}
var xxx_messageInfo_MetaRouteMatch proto.InternalMessageInfo
func (m *MetaRouteMatch) GetAttributes() map[string]*StringMatch {
if m != nil {
return m.Attributes
}
return nil
}
// Describes how to match a given string in HTTP headers. Match is
// case-sensitive.
type StringMatch struct {
// Types that are valid to be assigned to MatchType:
// *StringMatch_Exact
// *StringMatch_Prefix
// *StringMatch_Regex
MatchType isStringMatch_MatchType `protobuf_oneof:"match_type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StringMatch) Reset() { *m = StringMatch{} }
func (m *StringMatch) String() string { return proto.CompactTextString(m) }
func (*StringMatch) ProtoMessage() {}
func (*StringMatch) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{4}
}
func (m *StringMatch) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *StringMatch) XXX_Merge(src proto.Message) {
xxx_messageInfo_StringMatch.Merge(m, src)
}
func (m *StringMatch) XXX_Size() int {
return m.Size()
}
func (m *StringMatch) XXX_DiscardUnknown() {
xxx_messageInfo_StringMatch.DiscardUnknown(m)
}
var xxx_messageInfo_StringMatch proto.InternalMessageInfo
type isStringMatch_MatchType interface {
isStringMatch_MatchType()
MarshalTo([]byte) (int, error)
Size() int
}
type StringMatch_Exact struct {
Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof" json:"exact,omitempty"`
}
type StringMatch_Prefix struct {
Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof" json:"prefix,omitempty"`
}
type StringMatch_Regex struct {
Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof" json:"regex,omitempty"`
}
func (*StringMatch_Exact) isStringMatch_MatchType() {}
func (*StringMatch_Prefix) isStringMatch_MatchType() {}
func (*StringMatch_Regex) isStringMatch_MatchType() {}
func (m *StringMatch) GetMatchType() isStringMatch_MatchType {
if m != nil {
return m.MatchType
}
return nil
}
func (m *StringMatch) GetExact() string {
if x, ok := m.GetMatchType().(*StringMatch_Exact); ok {
return x.Exact
}
return ""
}
func (m *StringMatch) GetPrefix() string {
if x, ok := m.GetMatchType().(*StringMatch_Prefix); ok {
return x.Prefix
}
return ""
}
func (m *StringMatch) GetRegex() string {
if x, ok := m.GetMatchType().(*StringMatch_Regex); ok {
return x.Regex
}
return ""
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*StringMatch) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*StringMatch_Exact)(nil),
(*StringMatch_Prefix)(nil),
(*StringMatch_Regex)(nil),
}
}
type MetaRouteDestination struct {
// Destination uniquely identifies the instances of a service
// to which the request/connection should be forwarded to.
Destination *Destination `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
// The proportion of traffic to be forwarded to the service
// version. (0-100). Sum of weights across destinations SHOULD BE == 100.
// If there is only one destination in a rule, the weight value is assumed to
// be 100.
Weight uint32 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MetaRouteDestination) Reset() { *m = MetaRouteDestination{} }
func (m *MetaRouteDestination) String() string { return proto.CompactTextString(m) }
func (*MetaRouteDestination) ProtoMessage() {}
func (*MetaRouteDestination) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{5}
}
func (m *MetaRouteDestination) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *MetaRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MetaRouteDestination.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *MetaRouteDestination) XXX_Merge(src proto.Message) {
xxx_messageInfo_MetaRouteDestination.Merge(m, src)
}
func (m *MetaRouteDestination) XXX_Size() int {
return m.Size()
}
func (m *MetaRouteDestination) XXX_DiscardUnknown() {
xxx_messageInfo_MetaRouteDestination.DiscardUnknown(m)
}
var xxx_messageInfo_MetaRouteDestination proto.InternalMessageInfo
func (m *MetaRouteDestination) GetDestination() *Destination {
if m != nil {
return m.Destination
}
return nil
}
func (m *MetaRouteDestination) GetWeight() uint32 {
if m != nil {
return m.Weight
}
return 0
}
type Destination struct {
// The name of a service from the service registry. Service
// names are looked up from the platform's service registry (e.g.,
// Kubernetes services, Consul services, etc.) and from the hosts
// declared by [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Traffic
// forwarded to destinations that are not found in either of the two, will be dropped.
//
// *Note for Kubernetes users*: When short names are used (e.g. "reviews"
// instead of "reviews.default.svc.cluster.local"), Istio will interpret
// the short name based on the namespace of the rule, not the service. A
// rule in the "default" namespace containing a host "reviews will be
// interpreted as "reviews.default.svc.cluster.local", irrespective of
// the actual namespace associated with the reviews service. To avoid
// potential misconfiguration, it is recommended to always use fully
// qualified domain names over short names.
Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
// The name of a subset within the service. Applicable only to services
// within the mesh. The subset must be defined in a corresponding
// DestinationRule.
Subset string `protobuf:"bytes,2,opt,name=subset,proto3" json:"subset,omitempty"`
// Specifies the port on the host that is being addressed. If a service
// exposes only a single port it is not required to explicitly select the
// port.
Port *PortSelector `protobuf:"bytes,3,opt,name=port,proto3" json:"port,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Destination) Reset() { *m = Destination{} }
func (m *Destination) String() string { return proto.CompactTextString(m) }
func (*Destination) ProtoMessage() {}
func (*Destination) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{6}
}
func (m *Destination) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Destination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Destination.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Destination) XXX_Merge(src proto.Message) {
xxx_messageInfo_Destination.Merge(m, src)
}
func (m *Destination) XXX_Size() int {
return m.Size()
}
func (m *Destination) XXX_DiscardUnknown() {
xxx_messageInfo_Destination.DiscardUnknown(m)
}
var xxx_messageInfo_Destination proto.InternalMessageInfo
func (m *Destination) GetHost() string {
if m != nil {
return m.Host
}
return ""
}
func (m *Destination) GetSubset() string {
if m != nil {
return m.Subset
}
return ""
}
func (m *Destination) GetPort() *PortSelector {
if m != nil {
return m.Port
}
return nil
}
// PortSelector specifies the number of a port to be used for
// matching or selection for final routing.
type PortSelector struct {
// Valid port number
Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PortSelector) Reset() { *m = PortSelector{} }
func (m *PortSelector) String() string { return proto.CompactTextString(m) }
func (*PortSelector) ProtoMessage() {}
func (*PortSelector) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{7}
}
func (m *PortSelector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_PortSelector.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *PortSelector) XXX_Merge(src proto.Message) {
xxx_messageInfo_PortSelector.Merge(m, src)
}
func (m *PortSelector) XXX_Size() int {
return m.Size()
}
func (m *PortSelector) XXX_DiscardUnknown() {
xxx_messageInfo_PortSelector.DiscardUnknown(m)
}
var xxx_messageInfo_PortSelector proto.InternalMessageInfo
func (m *PortSelector) GetNumber() uint32 {
if m != nil {
return m.Number
}
return 0
}
// LocalRateLimit defines local rate limit policies for MetaProtocol proxy
type LocalRateLimit struct {
// The default token bucket configuration to use for rate limiting requests that are processed by
// this filter.
// Local rate limiter will first check the conditions, if a specific condition matches, then the token
// bucket within that condition will be applied to the incoming request. All the other requests
// that don't match the conditions will be rate limited by the default token bucket.
// If the default token bucket is not specified, then the requests that don't match the conditions
// will not be rate limited.
// At least one of token_bucket or conditions should have value.
TokenBucket *LocalRateLimit_TokenBucket `protobuf:"bytes,1,opt,name=token_bucket,json=tokenBucket,proto3" json:"token_bucket,omitempty"`
// The more specific rate limit conditions, the first match will be used.
Conditions []*LocalRateLimit_Condition `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LocalRateLimit) Reset() { *m = LocalRateLimit{} }
func (m *LocalRateLimit) String() string { return proto.CompactTextString(m) }
func (*LocalRateLimit) ProtoMessage() {}
func (*LocalRateLimit) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{8}
}
func (m *LocalRateLimit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LocalRateLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LocalRateLimit.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LocalRateLimit) XXX_Merge(src proto.Message) {
xxx_messageInfo_LocalRateLimit.Merge(m, src)
}
func (m *LocalRateLimit) XXX_Size() int {
return m.Size()
}
func (m *LocalRateLimit) XXX_DiscardUnknown() {
xxx_messageInfo_LocalRateLimit.DiscardUnknown(m)
}
var xxx_messageInfo_LocalRateLimit proto.InternalMessageInfo
func (m *LocalRateLimit) GetTokenBucket() *LocalRateLimit_TokenBucket {
if m != nil {
return m.TokenBucket
}
return nil
}
func (m *LocalRateLimit) GetConditions() []*LocalRateLimit_Condition {
if m != nil {
return m.Conditions
}
return nil
}
// Configures a token bucket which is used for rate limiting.
type LocalRateLimit_TokenBucket struct {
// The maximum tokens that the bucket can hold. This is also the number of tokens that the bucket
// initially contains. The value must be greater than 0.
MaxTokens uint32 `protobuf:"varint,1,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"`
// The number of tokens added to the bucket during each fill interval. The value must be greater than 0.
//If not specified, defaults to a single token.
TokensPerFill *types.UInt32Value `protobuf:"bytes,2,opt,name=tokens_per_fill,json=tokensPerFill,proto3" json:"tokens_per_fill,omitempty"`
// The fill interval that tokens are added to the bucket. During each fill interval
// `tokens_per_fill` are added to the bucket. The bucket will never contain more than
// `max_tokens` tokens.
FillInterval *types.Duration `protobuf:"bytes,3,opt,name=fill_interval,json=fillInterval,proto3" json:"fill_interval,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LocalRateLimit_TokenBucket) Reset() { *m = LocalRateLimit_TokenBucket{} }
func (m *LocalRateLimit_TokenBucket) String() string { return proto.CompactTextString(m) }
func (*LocalRateLimit_TokenBucket) ProtoMessage() {}
func (*LocalRateLimit_TokenBucket) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{8, 0}
}
func (m *LocalRateLimit_TokenBucket) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LocalRateLimit_TokenBucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LocalRateLimit_TokenBucket.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LocalRateLimit_TokenBucket) XXX_Merge(src proto.Message) {
xxx_messageInfo_LocalRateLimit_TokenBucket.Merge(m, src)
}
func (m *LocalRateLimit_TokenBucket) XXX_Size() int {
return m.Size()
}
func (m *LocalRateLimit_TokenBucket) XXX_DiscardUnknown() {
xxx_messageInfo_LocalRateLimit_TokenBucket.DiscardUnknown(m)
}
var xxx_messageInfo_LocalRateLimit_TokenBucket proto.InternalMessageInfo
func (m *LocalRateLimit_TokenBucket) GetMaxTokens() uint32 {
if m != nil {
return m.MaxTokens
}
return 0
}
func (m *LocalRateLimit_TokenBucket) GetTokensPerFill() *types.UInt32Value {
if m != nil {
return m.TokensPerFill
}
return nil
}
func (m *LocalRateLimit_TokenBucket) GetFillInterval() *types.Duration {
if m != nil {
return m.FillInterval
}
return nil
}
// Condition defines a rate limit policy for a more specific condition
type LocalRateLimit_Condition struct {
// Match conditions to be satisfied for the rate limit rule to be activated.
// All conditions inside a single match block have AND semantic.
// If the match is not specified, then all the incoming requests will be considered matched.
Match *MetaRouteMatch `protobuf:"bytes,1,opt,name=match,proto3" json:"match,omitempty"`
// The token bucket for this particular condition
TokenBucket *LocalRateLimit_TokenBucket `protobuf:"bytes,2,opt,name=token_bucket,json=tokenBucket,proto3" json:"token_bucket,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LocalRateLimit_Condition) Reset() { *m = LocalRateLimit_Condition{} }
func (m *LocalRateLimit_Condition) String() string { return proto.CompactTextString(m) }
func (*LocalRateLimit_Condition) ProtoMessage() {}
func (*LocalRateLimit_Condition) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{8, 1}
}
func (m *LocalRateLimit_Condition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LocalRateLimit_Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LocalRateLimit_Condition.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LocalRateLimit_Condition) XXX_Merge(src proto.Message) {
xxx_messageInfo_LocalRateLimit_Condition.Merge(m, src)
}
func (m *LocalRateLimit_Condition) XXX_Size() int {
return m.Size()
}
func (m *LocalRateLimit_Condition) XXX_DiscardUnknown() {
xxx_messageInfo_LocalRateLimit_Condition.DiscardUnknown(m)
}
var xxx_messageInfo_LocalRateLimit_Condition proto.InternalMessageInfo
func (m *LocalRateLimit_Condition) GetMatch() *MetaRouteMatch {
if m != nil {
return m.Match
}
return nil
}
func (m *LocalRateLimit_Condition) GetTokenBucket() *LocalRateLimit_TokenBucket {
if m != nil {
return m.TokenBucket
}
return nil
}
// GlobalRateLimit configures global rate limit service for MetaProtocol proxy
type GlobalRateLimit struct {
// Match conditions to be satisfied for the rate limit rule to be activated.
// All conditions inside a single match block have AND semantic.
// If the match is not specified, then all the incoming requests will be considered matched.
Match *MetaRouteMatch `protobuf:"bytes,1,opt,name=match,proto3" json:"match,omitempty"`
// The rate limit domain to use when calling the rate limit service.
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
// The timeout in milliseconds for the rate limit service RPC. If not
// set, this defaults to 20ms.
RequestTimeout *types.Duration `protobuf:"bytes,3,opt,name=request_timeout,json=requestTimeout,proto3" json:"request_timeout,omitempty"`
// The filter's behavior in case the rate limiting service does
// not respond back. When it is set to true, Envoy will not allow traffic in case of
// communication failure between rate limiting service and the proxy.
DenyOnFail bool `protobuf:"varint,4,opt,name=deny_on_fail,json=denyOnFail,proto3" json:"deny_on_fail,omitempty"`
// The cluster name of the external rate limit service provider.
RateLimitService string `protobuf:"bytes,5,opt,name=rate_limit_service,json=rateLimitService,proto3" json:"rate_limit_service,omitempty"`
// Defines what properties in the requests should be sent to the rate limit service
Descriptors []*GlobalRateLimit_Descriptor `protobuf:"bytes,6,rep,name=descriptors,proto3" json:"descriptors,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GlobalRateLimit) Reset() { *m = GlobalRateLimit{} }
func (m *GlobalRateLimit) String() string { return proto.CompactTextString(m) }
func (*GlobalRateLimit) ProtoMessage() {}
func (*GlobalRateLimit) Descriptor() ([]byte, []int) {
return fileDescriptor_1e2715e051935576, []int{9}
}
func (m *GlobalRateLimit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *GlobalRateLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_GlobalRateLimit.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *GlobalRateLimit) XXX_Merge(src proto.Message) {
xxx_messageInfo_GlobalRateLimit.Merge(m, src)
}
func (m *GlobalRateLimit) XXX_Size() int {
return m.Size()
}
func (m *GlobalRateLimit) XXX_DiscardUnknown() {
xxx_messageInfo_GlobalRateLimit.DiscardUnknown(m)
}
var xxx_messageInfo_GlobalRateLimit proto.InternalMessageInfo
func (m *GlobalRateLimit) GetMatch() *MetaRouteMatch {
if m != nil {
return m.Match
}
return nil
}
func (m *GlobalRateLimit) GetDomain() string {
if m != nil {
return m.Domain
}
return ""
}
func (m *GlobalRateLimit) GetRequestTimeout() *types.Duration {
if m != nil {
return m.RequestTimeout