forked from envoyproxy/go-control-plane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
route.pb.go
15298 lines (14814 loc) · 400 KB
/
route.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: envoy/api/v2/route/route.proto
package route
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
import _type "github.com/envoyproxy/go-control-plane/envoy/type"
import _ "github.com/gogo/protobuf/gogoproto"
import types "github.com/gogo/protobuf/types"
import _ "github.com/lyft/protoc-gen-validate/validate"
import time "time"
import bytes "bytes"
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type VirtualHost_TlsRequirementType int32
const (
// No TLS requirement for the virtual host.
VirtualHost_NONE VirtualHost_TlsRequirementType = 0
// External requests must use TLS. If a request is external and it is not
// using TLS, a 301 redirect will be sent telling the client to use HTTPS.
VirtualHost_EXTERNAL_ONLY VirtualHost_TlsRequirementType = 1
// All requests must use TLS. If a request is not using TLS, a 301 redirect
// will be sent telling the client to use HTTPS.
VirtualHost_ALL VirtualHost_TlsRequirementType = 2
)
var VirtualHost_TlsRequirementType_name = map[int32]string{
0: "NONE",
1: "EXTERNAL_ONLY",
2: "ALL",
}
var VirtualHost_TlsRequirementType_value = map[string]int32{
"NONE": 0,
"EXTERNAL_ONLY": 1,
"ALL": 2,
}
func (x VirtualHost_TlsRequirementType) String() string {
return proto.EnumName(VirtualHost_TlsRequirementType_name, int32(x))
}
func (VirtualHost_TlsRequirementType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{0, 0}
}
type RouteAction_ClusterNotFoundResponseCode int32
const (
// HTTP status code - 503 Service Unavailable.
RouteAction_SERVICE_UNAVAILABLE RouteAction_ClusterNotFoundResponseCode = 0
// HTTP status code - 404 Not Found.
RouteAction_NOT_FOUND RouteAction_ClusterNotFoundResponseCode = 1
)
var RouteAction_ClusterNotFoundResponseCode_name = map[int32]string{
0: "SERVICE_UNAVAILABLE",
1: "NOT_FOUND",
}
var RouteAction_ClusterNotFoundResponseCode_value = map[string]int32{
"SERVICE_UNAVAILABLE": 0,
"NOT_FOUND": 1,
}
func (x RouteAction_ClusterNotFoundResponseCode) String() string {
return proto.EnumName(RouteAction_ClusterNotFoundResponseCode_name, int32(x))
}
func (RouteAction_ClusterNotFoundResponseCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{5, 0}
}
type RedirectAction_RedirectResponseCode int32
const (
// Moved Permanently HTTP Status Code - 301.
RedirectAction_MOVED_PERMANENTLY RedirectAction_RedirectResponseCode = 0
// Found HTTP Status Code - 302.
RedirectAction_FOUND RedirectAction_RedirectResponseCode = 1
// See Other HTTP Status Code - 303.
RedirectAction_SEE_OTHER RedirectAction_RedirectResponseCode = 2
// Temporary Redirect HTTP Status Code - 307.
RedirectAction_TEMPORARY_REDIRECT RedirectAction_RedirectResponseCode = 3
// Permanent Redirect HTTP Status Code - 308.
RedirectAction_PERMANENT_REDIRECT RedirectAction_RedirectResponseCode = 4
)
var RedirectAction_RedirectResponseCode_name = map[int32]string{
0: "MOVED_PERMANENTLY",
1: "FOUND",
2: "SEE_OTHER",
3: "TEMPORARY_REDIRECT",
4: "PERMANENT_REDIRECT",
}
var RedirectAction_RedirectResponseCode_value = map[string]int32{
"MOVED_PERMANENTLY": 0,
"FOUND": 1,
"SEE_OTHER": 2,
"TEMPORARY_REDIRECT": 3,
"PERMANENT_REDIRECT": 4,
}
func (x RedirectAction_RedirectResponseCode) String() string {
return proto.EnumName(RedirectAction_RedirectResponseCode_name, int32(x))
}
func (RedirectAction_RedirectResponseCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{6, 0}
}
// The top level element in the routing configuration is a virtual host. Each virtual host has
// a logical name as well as a set of domains that get routed to it based on the incoming request's
// host header. This allows a single listener to service multiple top level domain path trees. Once
// a virtual host is selected based on the domain, the routes are processed in order to see which
// upstream cluster to route to or whether to perform a redirect.
// [#comment:next free field: 15]
type VirtualHost struct {
// The logical name of the virtual host. This is used when emitting certain
// statistics but is not relevant for routing.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// A list of domains (host/authority header) that will be matched to this
// virtual host. Wildcard hosts are supported in the form of ``*.foo.com`` or
// ``*-bar.foo.com``.
//
// .. note::
//
// The wildcard will not match the empty string.
// e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``.
// Additionally, a special entry ``*`` is allowed which will match any
// host/authority header. Only a single virtual host in the entire route
// configuration can match on ``*``. A domain must be unique across all virtual
// hosts or the config will fail to load.
Domains []string `protobuf:"bytes,2,rep,name=domains" json:"domains,omitempty"`
// The list of routes that will be matched, in order, for incoming requests.
// The first route that matches will be used.
Routes []Route `protobuf:"bytes,3,rep,name=routes" json:"routes"`
// Specifies the type of TLS enforcement the virtual host expects. If this option is not
// specified, there is no TLS requirement for the virtual host.
RequireTls VirtualHost_TlsRequirementType `protobuf:"varint,4,opt,name=require_tls,json=requireTls,proto3,enum=envoy.api.v2.route.VirtualHost_TlsRequirementType" json:"require_tls,omitempty"`
// A list of virtual clusters defined for this virtual host. Virtual clusters
// are used for additional statistics gathering.
VirtualClusters []*VirtualCluster `protobuf:"bytes,5,rep,name=virtual_clusters,json=virtualClusters" json:"virtual_clusters,omitempty"`
// Specifies a set of rate limit configurations that will be applied to the
// virtual host.
RateLimits []*RateLimit `protobuf:"bytes,6,rep,name=rate_limits,json=rateLimits" json:"rate_limits,omitempty"`
// Specifies a list of HTTP headers that should be added to each request
// handled by this virtual host. Headers specified at this level are applied
// after headers from enclosed :ref:`envoy_api_msg_route.Route` and before headers from the
// enclosing :ref:`envoy_api_msg_RouteConfiguration`. For more information, including
// details on header value syntax, see the documentation on :ref:`custom request headers
// <config_http_conn_man_headers_custom_request_headers>`.
RequestHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,7,rep,name=request_headers_to_add,json=requestHeadersToAdd" json:"request_headers_to_add,omitempty"`
// Specifies a list of HTTP headers that should be removed from each request
// handled by this virtual host.
RequestHeadersToRemove []string `protobuf:"bytes,13,rep,name=request_headers_to_remove,json=requestHeadersToRemove" json:"request_headers_to_remove,omitempty"`
// Specifies a list of HTTP headers that should be added to each response
// handled by this virtual host. Headers specified at this level are applied
// after headers from enclosed :ref:`envoy_api_msg_route.Route` and before headers from the
// enclosing :ref:`envoy_api_msg_RouteConfiguration`. For more information, including
// details on header value syntax, see the documentation on :ref:`custom request headers
// <config_http_conn_man_headers_custom_request_headers>`.
ResponseHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,10,rep,name=response_headers_to_add,json=responseHeadersToAdd" json:"response_headers_to_add,omitempty"`
// Specifies a list of HTTP headers that should be removed from each response
// handled by this virtual host.
ResponseHeadersToRemove []string `protobuf:"bytes,11,rep,name=response_headers_to_remove,json=responseHeadersToRemove" json:"response_headers_to_remove,omitempty"`
// Indicates that the virtual host has a CORS policy.
Cors *CorsPolicy `protobuf:"bytes,8,opt,name=cors" json:"cors,omitempty"`
// The per_filter_config field can be used to provide virtual host-specific
// configurations for filters. The key should match the filter name, such as
// *envoy.buffer* for the HTTP buffer filter. Use of this field is filter
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
// for if and how it is utilized.
PerFilterConfig map[string]*types.Struct `protobuf:"bytes,12,rep,name=per_filter_config,json=perFilterConfig" json:"per_filter_config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
// Decides whether the :ref:`x-envoy-attempt-count
// <config_http_filters_router_x-envoy-attempt-count>` header should be included
// in the upstream request. Setting this option will cause it to override any existing header
// value, so in the case of two Envoys on the request path with this option enabled, the upstream
// will see the attempt count as perceived by the second Envoy. Defaults to false.
// This header is unaffected by the
// :ref:`suppress_envoy_headers
// <envoy_api_field_config.filter.http.router.v2.Router.suppress_envoy_headers>` flag.
IncludeRequestAttemptCount bool `protobuf:"varint,14,opt,name=include_request_attempt_count,json=includeRequestAttemptCount,proto3" json:"include_request_attempt_count,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *VirtualHost) Reset() { *m = VirtualHost{} }
func (m *VirtualHost) String() string { return proto.CompactTextString(m) }
func (*VirtualHost) ProtoMessage() {}
func (*VirtualHost) Descriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{0}
}
func (m *VirtualHost) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *VirtualHost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_VirtualHost.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *VirtualHost) XXX_Merge(src proto.Message) {
xxx_messageInfo_VirtualHost.Merge(dst, src)
}
func (m *VirtualHost) XXX_Size() int {
return m.Size()
}
func (m *VirtualHost) XXX_DiscardUnknown() {
xxx_messageInfo_VirtualHost.DiscardUnknown(m)
}
var xxx_messageInfo_VirtualHost proto.InternalMessageInfo
func (m *VirtualHost) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *VirtualHost) GetDomains() []string {
if m != nil {
return m.Domains
}
return nil
}
func (m *VirtualHost) GetRoutes() []Route {
if m != nil {
return m.Routes
}
return nil
}
func (m *VirtualHost) GetRequireTls() VirtualHost_TlsRequirementType {
if m != nil {
return m.RequireTls
}
return VirtualHost_NONE
}
func (m *VirtualHost) GetVirtualClusters() []*VirtualCluster {
if m != nil {
return m.VirtualClusters
}
return nil
}
func (m *VirtualHost) GetRateLimits() []*RateLimit {
if m != nil {
return m.RateLimits
}
return nil
}
func (m *VirtualHost) GetRequestHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.RequestHeadersToAdd
}
return nil
}
func (m *VirtualHost) GetRequestHeadersToRemove() []string {
if m != nil {
return m.RequestHeadersToRemove
}
return nil
}
func (m *VirtualHost) GetResponseHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.ResponseHeadersToAdd
}
return nil
}
func (m *VirtualHost) GetResponseHeadersToRemove() []string {
if m != nil {
return m.ResponseHeadersToRemove
}
return nil
}
func (m *VirtualHost) GetCors() *CorsPolicy {
if m != nil {
return m.Cors
}
return nil
}
func (m *VirtualHost) GetPerFilterConfig() map[string]*types.Struct {
if m != nil {
return m.PerFilterConfig
}
return nil
}
func (m *VirtualHost) GetIncludeRequestAttemptCount() bool {
if m != nil {
return m.IncludeRequestAttemptCount
}
return false
}
// A route is both a specification of how to match a request as well as an indication of what to do
// next (e.g., redirect, forward, rewrite, etc.).
//
// .. attention::
//
// Envoy supports routing on HTTP method via :ref:`header matching
// <envoy_api_msg_route.HeaderMatcher>`.
// [#comment:next free field: 13]
type Route struct {
// Route matching parameters.
Match RouteMatch `protobuf:"bytes,1,opt,name=match" json:"match"`
// Types that are valid to be assigned to Action:
// *Route_Route
// *Route_Redirect
// *Route_DirectResponse
Action isRoute_Action `protobuf_oneof:"action"`
// The Metadata field can be used to provide additional information
// about the route. It can be used for configuration, stats, and logging.
// The metadata should go under the filter namespace that will need it.
// For instance, if the metadata is intended for the Router filter,
// the filter name should be specified as *envoy.router*.
Metadata *core.Metadata `protobuf:"bytes,4,opt,name=metadata" json:"metadata,omitempty"`
// Decorator for the matched route.
Decorator *Decorator `protobuf:"bytes,5,opt,name=decorator" json:"decorator,omitempty"`
// The per_filter_config field can be used to provide route-specific
// configurations for filters. The key should match the filter name, such as
// *envoy.buffer* for the HTTP buffer filter. Use of this field is filter
// specific; see the :ref:`HTTP filter documentation <config_http_filters>` for
// if and how it is utilized.
PerFilterConfig map[string]*types.Struct `protobuf:"bytes,8,rep,name=per_filter_config,json=perFilterConfig" json:"per_filter_config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
// Specifies a set of headers that will be added to requests matching this
// route. Headers specified at this level are applied before headers from the
// enclosing :ref:`envoy_api_msg_route.VirtualHost` and
// :ref:`envoy_api_msg_RouteConfiguration`. For more information, including details on
// header value syntax, see the documentation on :ref:`custom request headers
// <config_http_conn_man_headers_custom_request_headers>`.
RequestHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,9,rep,name=request_headers_to_add,json=requestHeadersToAdd" json:"request_headers_to_add,omitempty"`
// Specifies a list of HTTP headers that should be removed from each request
// matching this route.
RequestHeadersToRemove []string `protobuf:"bytes,12,rep,name=request_headers_to_remove,json=requestHeadersToRemove" json:"request_headers_to_remove,omitempty"`
// Specifies a set of headers that will be added to responses to requests
// matching this route. Headers specified at this level are applied before
// headers from the enclosing :ref:`envoy_api_msg_route.VirtualHost` and
// :ref:`envoy_api_msg_RouteConfiguration`. For more information, including
// details on header value syntax, see the documentation on
// :ref:`custom request headers <config_http_conn_man_headers_custom_request_headers>`.
ResponseHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,10,rep,name=response_headers_to_add,json=responseHeadersToAdd" json:"response_headers_to_add,omitempty"`
// Specifies a list of HTTP headers that should be removed from each response
// to requests matching this route.
ResponseHeadersToRemove []string `protobuf:"bytes,11,rep,name=response_headers_to_remove,json=responseHeadersToRemove" json:"response_headers_to_remove,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Route) Reset() { *m = Route{} }
func (m *Route) String() string { return proto.CompactTextString(m) }
func (*Route) ProtoMessage() {}
func (*Route) Descriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{1}
}
func (m *Route) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Route.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *Route) XXX_Merge(src proto.Message) {
xxx_messageInfo_Route.Merge(dst, src)
}
func (m *Route) XXX_Size() int {
return m.Size()
}
func (m *Route) XXX_DiscardUnknown() {
xxx_messageInfo_Route.DiscardUnknown(m)
}
var xxx_messageInfo_Route proto.InternalMessageInfo
type isRoute_Action interface {
isRoute_Action()
Equal(interface{}) bool
MarshalTo([]byte) (int, error)
Size() int
}
type Route_Route struct {
Route *RouteAction `protobuf:"bytes,2,opt,name=route,oneof"`
}
type Route_Redirect struct {
Redirect *RedirectAction `protobuf:"bytes,3,opt,name=redirect,oneof"`
}
type Route_DirectResponse struct {
DirectResponse *DirectResponseAction `protobuf:"bytes,7,opt,name=direct_response,json=directResponse,oneof"`
}
func (*Route_Route) isRoute_Action() {}
func (*Route_Redirect) isRoute_Action() {}
func (*Route_DirectResponse) isRoute_Action() {}
func (m *Route) GetAction() isRoute_Action {
if m != nil {
return m.Action
}
return nil
}
func (m *Route) GetMatch() RouteMatch {
if m != nil {
return m.Match
}
return RouteMatch{}
}
func (m *Route) GetRoute() *RouteAction {
if x, ok := m.GetAction().(*Route_Route); ok {
return x.Route
}
return nil
}
func (m *Route) GetRedirect() *RedirectAction {
if x, ok := m.GetAction().(*Route_Redirect); ok {
return x.Redirect
}
return nil
}
func (m *Route) GetDirectResponse() *DirectResponseAction {
if x, ok := m.GetAction().(*Route_DirectResponse); ok {
return x.DirectResponse
}
return nil
}
func (m *Route) GetMetadata() *core.Metadata {
if m != nil {
return m.Metadata
}
return nil
}
func (m *Route) GetDecorator() *Decorator {
if m != nil {
return m.Decorator
}
return nil
}
func (m *Route) GetPerFilterConfig() map[string]*types.Struct {
if m != nil {
return m.PerFilterConfig
}
return nil
}
func (m *Route) GetRequestHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.RequestHeadersToAdd
}
return nil
}
func (m *Route) GetRequestHeadersToRemove() []string {
if m != nil {
return m.RequestHeadersToRemove
}
return nil
}
func (m *Route) GetResponseHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.ResponseHeadersToAdd
}
return nil
}
func (m *Route) GetResponseHeadersToRemove() []string {
if m != nil {
return m.ResponseHeadersToRemove
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Route) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Route_OneofMarshaler, _Route_OneofUnmarshaler, _Route_OneofSizer, []interface{}{
(*Route_Route)(nil),
(*Route_Redirect)(nil),
(*Route_DirectResponse)(nil),
}
}
func _Route_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Route)
// action
switch x := m.Action.(type) {
case *Route_Route:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Route); err != nil {
return err
}
case *Route_Redirect:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Redirect); err != nil {
return err
}
case *Route_DirectResponse:
_ = b.EncodeVarint(7<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.DirectResponse); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Route.Action has unexpected type %T", x)
}
return nil
}
func _Route_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Route)
switch tag {
case 2: // action.route
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(RouteAction)
err := b.DecodeMessage(msg)
m.Action = &Route_Route{msg}
return true, err
case 3: // action.redirect
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(RedirectAction)
err := b.DecodeMessage(msg)
m.Action = &Route_Redirect{msg}
return true, err
case 7: // action.direct_response
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(DirectResponseAction)
err := b.DecodeMessage(msg)
m.Action = &Route_DirectResponse{msg}
return true, err
default:
return false, nil
}
}
func _Route_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Route)
// action
switch x := m.Action.(type) {
case *Route_Route:
s := proto.Size(x.Route)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Route_Redirect:
s := proto.Size(x.Redirect)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Route_DirectResponse:
s := proto.Size(x.DirectResponse)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// Compared to the :ref:`cluster <envoy_api_field_route.RouteAction.cluster>` field that specifies a
// single upstream cluster as the target of a request, the :ref:`weighted_clusters
// <envoy_api_field_route.RouteAction.weighted_clusters>` option allows for specification of
// multiple upstream clusters along with weights that indicate the percentage of
// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the
// weights.
// [#comment:next free field: 10]
type WeightedCluster struct {
// Specifies one or more upstream clusters associated with the route.
Clusters []*WeightedCluster_ClusterWeight `protobuf:"bytes,1,rep,name=clusters" json:"clusters,omitempty"`
// Specifies the total weight across all clusters. The sum of all cluster weights must equal this
// value, which must be greater than 0. Defaults to 100.
TotalWeight *types.UInt32Value `protobuf:"bytes,3,opt,name=total_weight,json=totalWeight" json:"total_weight,omitempty"`
// Specifies the runtime key prefix that should be used to construct the
// runtime keys associated with each cluster. When the *runtime_key_prefix* is
// specified, the router will look for weights associated with each upstream
// cluster under the key *runtime_key_prefix* + "." + *cluster[i].name* where
// *cluster[i]* denotes an entry in the clusters array field. If the runtime
// key for the cluster does not exist, the value specified in the
// configuration file will be used as the default weight. See the :ref:`runtime documentation
// <operations_runtime>` for how key names map to the underlying implementation.
RuntimeKeyPrefix string `protobuf:"bytes,2,opt,name=runtime_key_prefix,json=runtimeKeyPrefix,proto3" json:"runtime_key_prefix,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WeightedCluster) Reset() { *m = WeightedCluster{} }
func (m *WeightedCluster) String() string { return proto.CompactTextString(m) }
func (*WeightedCluster) ProtoMessage() {}
func (*WeightedCluster) Descriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{2}
}
func (m *WeightedCluster) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *WeightedCluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_WeightedCluster.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *WeightedCluster) XXX_Merge(src proto.Message) {
xxx_messageInfo_WeightedCluster.Merge(dst, src)
}
func (m *WeightedCluster) XXX_Size() int {
return m.Size()
}
func (m *WeightedCluster) XXX_DiscardUnknown() {
xxx_messageInfo_WeightedCluster.DiscardUnknown(m)
}
var xxx_messageInfo_WeightedCluster proto.InternalMessageInfo
func (m *WeightedCluster) GetClusters() []*WeightedCluster_ClusterWeight {
if m != nil {
return m.Clusters
}
return nil
}
func (m *WeightedCluster) GetTotalWeight() *types.UInt32Value {
if m != nil {
return m.TotalWeight
}
return nil
}
func (m *WeightedCluster) GetRuntimeKeyPrefix() string {
if m != nil {
return m.RuntimeKeyPrefix
}
return ""
}
type WeightedCluster_ClusterWeight struct {
// Name of the upstream cluster. The cluster must exist in the
// :ref:`cluster manager configuration <config_cluster_manager>`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// An integer between 0 and :ref:`total_weight
// <envoy_api_field_route.WeightedCluster.total_weight>`. When a request matches the route,
// the choice of an upstream cluster is determined by its weight. The sum of weights across all
// entries in the clusters array must add up to the total_weight, which defaults to 100.
Weight *types.UInt32Value `protobuf:"bytes,2,opt,name=weight" json:"weight,omitempty"`
// Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints in
// the upstream cluster with metadata matching what is set in this field will be considered for
// load balancing. Note that this will be merged with what's provided in :ref:
// `RouteAction.MetadataMatch <envoy_api_field_route.RouteAction.metadata_match>`, with values
// here taking precedence. The filter name should be specified as *envoy.lb*.
MetadataMatch *core.Metadata `protobuf:"bytes,3,opt,name=metadata_match,json=metadataMatch" json:"metadata_match,omitempty"`
// Specifies a list of headers to be added to requests when this cluster is selected
// through the enclosing :ref:`envoy_api_msg_route.RouteAction`.
// Headers specified at this level are applied before headers from the enclosing
// :ref:`envoy_api_msg_route.Route`, :ref:`envoy_api_msg_route.VirtualHost`, and
// :ref:`envoy_api_msg_RouteConfiguration`. For more information, including details on
// header value syntax, see the documentation on :ref:`custom request headers
// <config_http_conn_man_headers_custom_request_headers>`.
RequestHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,4,rep,name=request_headers_to_add,json=requestHeadersToAdd" json:"request_headers_to_add,omitempty"`
// Specifies a list of HTTP headers that should be removed from each request when
// this cluster is selected through the enclosing :ref:`envoy_api_msg_route.RouteAction`.
RequestHeadersToRemove []string `protobuf:"bytes,9,rep,name=request_headers_to_remove,json=requestHeadersToRemove" json:"request_headers_to_remove,omitempty"`
// Specifies a list of headers to be added to responses when this cluster is selected
// through the enclosing :ref:`envoy_api_msg_route.RouteAction`.
// Headers specified at this level are applied before headers from the enclosing
// :ref:`envoy_api_msg_route.Route`, :ref:`envoy_api_msg_route.VirtualHost`, and
// :ref:`envoy_api_msg_RouteConfiguration`. For more information, including details on
// header value syntax, see the documentation on :ref:`custom request headers
// <config_http_conn_man_headers_custom_request_headers>`.
ResponseHeadersToAdd []*core.HeaderValueOption `protobuf:"bytes,5,rep,name=response_headers_to_add,json=responseHeadersToAdd" json:"response_headers_to_add,omitempty"`
// Specifies a list of headers to be removed from responses when this cluster is selected
// through the enclosing :ref:`envoy_api_msg_route.RouteAction`.
ResponseHeadersToRemove []string `protobuf:"bytes,6,rep,name=response_headers_to_remove,json=responseHeadersToRemove" json:"response_headers_to_remove,omitempty"`
// The per_filter_config field can be used to provide weighted cluster-specific
// configurations for filters. The key should match the filter name, such as
// *envoy.buffer* for the HTTP buffer filter. Use of this field is filter
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
// for if and how it is utilized.
PerFilterConfig map[string]*types.Struct `protobuf:"bytes,8,rep,name=per_filter_config,json=perFilterConfig" json:"per_filter_config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *WeightedCluster_ClusterWeight) Reset() { *m = WeightedCluster_ClusterWeight{} }
func (m *WeightedCluster_ClusterWeight) String() string { return proto.CompactTextString(m) }
func (*WeightedCluster_ClusterWeight) ProtoMessage() {}
func (*WeightedCluster_ClusterWeight) Descriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{2, 0}
}
func (m *WeightedCluster_ClusterWeight) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *WeightedCluster_ClusterWeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_WeightedCluster_ClusterWeight.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *WeightedCluster_ClusterWeight) XXX_Merge(src proto.Message) {
xxx_messageInfo_WeightedCluster_ClusterWeight.Merge(dst, src)
}
func (m *WeightedCluster_ClusterWeight) XXX_Size() int {
return m.Size()
}
func (m *WeightedCluster_ClusterWeight) XXX_DiscardUnknown() {
xxx_messageInfo_WeightedCluster_ClusterWeight.DiscardUnknown(m)
}
var xxx_messageInfo_WeightedCluster_ClusterWeight proto.InternalMessageInfo
func (m *WeightedCluster_ClusterWeight) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *WeightedCluster_ClusterWeight) GetWeight() *types.UInt32Value {
if m != nil {
return m.Weight
}
return nil
}
func (m *WeightedCluster_ClusterWeight) GetMetadataMatch() *core.Metadata {
if m != nil {
return m.MetadataMatch
}
return nil
}
func (m *WeightedCluster_ClusterWeight) GetRequestHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.RequestHeadersToAdd
}
return nil
}
func (m *WeightedCluster_ClusterWeight) GetRequestHeadersToRemove() []string {
if m != nil {
return m.RequestHeadersToRemove
}
return nil
}
func (m *WeightedCluster_ClusterWeight) GetResponseHeadersToAdd() []*core.HeaderValueOption {
if m != nil {
return m.ResponseHeadersToAdd
}
return nil
}
func (m *WeightedCluster_ClusterWeight) GetResponseHeadersToRemove() []string {
if m != nil {
return m.ResponseHeadersToRemove
}
return nil
}
func (m *WeightedCluster_ClusterWeight) GetPerFilterConfig() map[string]*types.Struct {
if m != nil {
return m.PerFilterConfig
}
return nil
}
type RouteMatch struct {
// Types that are valid to be assigned to PathSpecifier:
// *RouteMatch_Prefix
// *RouteMatch_Path
// *RouteMatch_Regex
PathSpecifier isRouteMatch_PathSpecifier `protobuf_oneof:"path_specifier"`
// Indicates that prefix/path matching should be case insensitive. The default
// is true.
CaseSensitive *types.BoolValue `protobuf:"bytes,4,opt,name=case_sensitive,json=caseSensitive" json:"case_sensitive,omitempty"`
// Indicates that the route should additionally match on a runtime key. Every time the route
// is considered for a match, it must also fall under the percentage of matches indicated by
// this field. For some fraction N/D, a random number in the range [0,D) is selected. If the
// number is <= the value of the numberator N, or if the key is not present, the default
// value, the router continues to evaluate the remaining match criteria. A runtime_fraction
// route configuration can be used to roll out route changes in a gradual manner without full
// code/config deploys. Refer to the :ref:`traffic shifting
// <config_http_conn_man_route_table_traffic_splitting_shift>` docs for additional documentation.
//
// .. note::
//
// Parsing this field is implemented such that the runtime key's data may be represented
// as a FractionalPercent proto represented as JSON/YAM and may also be represented as an
// integer with the assumption that the value is an integral percentage out of 100. For
// instance, a runtime key lookup returning the value "42" would parse as a FractionalPercent
// whose numerator is 42 and denominator is HUNDRED. This preserves legacy semantics.
RuntimeFraction *core.RuntimeFractionalPercent `protobuf:"bytes,9,opt,name=runtime_fraction,json=runtimeFraction" json:"runtime_fraction,omitempty"`
// Specifies a set of headers that the route should match on. The router will
// check the request’s headers against all the specified headers in the route
// config. A match will happen if all the headers in the route are present in
// the request with the same values (or based on presence if the value field
// is not in the config).
Headers []*HeaderMatcher `protobuf:"bytes,6,rep,name=headers" json:"headers,omitempty"`
// Specifies a set of URL query parameters on which the route should
// match. The router will check the query string from the *path* header
// against all the specified query parameters. If the number of specified
// query parameters is nonzero, they all must match the *path* header's
// query string for a match to occur.
QueryParameters []*QueryParameterMatcher `protobuf:"bytes,7,rep,name=query_parameters,json=queryParameters" json:"query_parameters,omitempty"`
// If specified, only gRPC requests will be matched. The router will check
// that the content-type header has a application/grpc or one of the various
// application/grpc+ values.
Grpc *RouteMatch_GrpcRouteMatchOptions `protobuf:"bytes,8,opt,name=grpc" json:"grpc,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RouteMatch) Reset() { *m = RouteMatch{} }
func (m *RouteMatch) String() string { return proto.CompactTextString(m) }
func (*RouteMatch) ProtoMessage() {}
func (*RouteMatch) Descriptor() ([]byte, []int) {
return fileDescriptor_route_cd2348441212b092, []int{3}
}
func (m *RouteMatch) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *RouteMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_RouteMatch.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *RouteMatch) XXX_Merge(src proto.Message) {
xxx_messageInfo_RouteMatch.Merge(dst, src)
}
func (m *RouteMatch) XXX_Size() int {
return m.Size()
}
func (m *RouteMatch) XXX_DiscardUnknown() {
xxx_messageInfo_RouteMatch.DiscardUnknown(m)
}
var xxx_messageInfo_RouteMatch proto.InternalMessageInfo
type isRouteMatch_PathSpecifier interface {
isRouteMatch_PathSpecifier()
Equal(interface{}) bool
MarshalTo([]byte) (int, error)
Size() int
}
type RouteMatch_Prefix struct {
Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3,oneof"`
}
type RouteMatch_Path struct {
Path string `protobuf:"bytes,2,opt,name=path,proto3,oneof"`
}
type RouteMatch_Regex struct {
Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof"`
}
func (*RouteMatch_Prefix) isRouteMatch_PathSpecifier() {}
func (*RouteMatch_Path) isRouteMatch_PathSpecifier() {}
func (*RouteMatch_Regex) isRouteMatch_PathSpecifier() {}
func (m *RouteMatch) GetPathSpecifier() isRouteMatch_PathSpecifier {
if m != nil {
return m.PathSpecifier
}
return nil
}
func (m *RouteMatch) GetPrefix() string {
if x, ok := m.GetPathSpecifier().(*RouteMatch_Prefix); ok {
return x.Prefix
}
return ""
}
func (m *RouteMatch) GetPath() string {
if x, ok := m.GetPathSpecifier().(*RouteMatch_Path); ok {
return x.Path
}
return ""
}
func (m *RouteMatch) GetRegex() string {
if x, ok := m.GetPathSpecifier().(*RouteMatch_Regex); ok {
return x.Regex
}
return ""
}
func (m *RouteMatch) GetCaseSensitive() *types.BoolValue {
if m != nil {
return m.CaseSensitive
}
return nil
}
func (m *RouteMatch) GetRuntimeFraction() *core.RuntimeFractionalPercent {
if m != nil {
return m.RuntimeFraction
}
return nil
}
func (m *RouteMatch) GetHeaders() []*HeaderMatcher {
if m != nil {
return m.Headers
}
return nil
}
func (m *RouteMatch) GetQueryParameters() []*QueryParameterMatcher {
if m != nil {
return m.QueryParameters
}
return nil
}
func (m *RouteMatch) GetGrpc() *RouteMatch_GrpcRouteMatchOptions {
if m != nil {
return m.Grpc
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*RouteMatch) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _RouteMatch_OneofMarshaler, _RouteMatch_OneofUnmarshaler, _RouteMatch_OneofSizer, []interface{}{
(*RouteMatch_Prefix)(nil),