This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
forked from istio/api
/
api_spec.pb.go
1759 lines (1696 loc) · 44.7 KB
/
api_spec.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: mixer/v1/config/client/api_spec.proto
/*
Package client is a generated protocol buffer package.
It is generated from these files:
mixer/v1/config/client/api_spec.proto
mixer/v1/config/client/client_config.proto
mixer/v1/config/client/quota.proto
mixer/v1/config/client/service.proto
It has these top-level messages:
HTTPAPISpec
HTTPAPISpecPattern
APIKey
HTTPAPISpecReference
HTTPAPISpecBinding
NetworkFailPolicy
ServiceConfig
TransportConfig
HttpClientConfig
TcpClientConfig
QuotaSpec
QuotaRule
StringMatch
AttributeMatch
Quota
QuotaSpecBinding
IstioService
*/
package client
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import istio_mixer_v1 "istio.io/api/mixer/v1"
import strings "strings"
import reflect "reflect"
import io "io"
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// HTTPAPISpec defines the canonical configuration for generating
// API-related attributes from HTTP requests based on the method and
// uri templated path matches. It is sufficient for defining the API
// surface of a service for the purposes of API attribute
// generation. It is not intended to represent auth, quota,
// documentation, or other information commonly found in other API
// specifications, e.g. OpenAPI.
//
// Existing standards that define operations (or methods) in terms of
// HTTP methods and paths can be normalized to this format for use in
// Istio. For example, a simple petstore API described by OpenAPIv2
// [here](https://github.com/googleapis/gnostic/blob/master/examples/v2.0/yaml/petstore-simple.yaml)
// can be represented with the following HTTPAPISpec.
//
// ```yaml
// apiVersion: config.istio.io/v1alpha2
// kind: HTTPAPISpec
// metadata:
// name: petstore
// namespace: default
// spec:
// attributes:
// api.service: petstore.swagger.io
// api.version: 1.0.0
// patterns:
// - attributes:
// api.operation: findPets
// httpMethod: GET
// uriTemplate: /api/pets
// - attributes:
// api.operation: addPet
// httpMethod: POST
// uriTemplate: /api/pets
// - attributes:
// api.operation: findPetById
// httpMethod: GET
// uriTemplate: /api/pets/{id}
// - attributes:
// api.operation: deletePet
// httpMethod: DELETE
// uriTemplate: /api/pets/{id}
// api_keys:
// - query: api-key
// ```
type HTTPAPISpec struct {
// List of attributes that are generated when *any* of the HTTP
// patterns match. This list typically includes the "api.service"
// and "api.version" attributes.
Attributes *istio_mixer_v1.Attributes `protobuf:"bytes,1,opt,name=attributes" json:"attributes,omitempty"`
// List of HTTP patterns to match.
Patterns []*HTTPAPISpecPattern `protobuf:"bytes,2,rep,name=patterns" json:"patterns,omitempty"`
// List of APIKey that describes how to extract an API-KEY from an
// HTTP request. The first API-Key match found in the list is used,
// i.e. 'OR' semantics.
//
// The following default policies are used to generate the
// `request.api_key` attribute if no explicit APIKey is defined.
//
// `query: key, `query: api_key`, and then `header: x-api-key`
//
ApiKeys []*APIKey `protobuf:"bytes,3,rep,name=api_keys,json=apiKeys" json:"api_keys,omitempty"`
}
func (m *HTTPAPISpec) Reset() { *m = HTTPAPISpec{} }
func (*HTTPAPISpec) ProtoMessage() {}
func (*HTTPAPISpec) Descriptor() ([]byte, []int) { return fileDescriptorApiSpec, []int{0} }
// HTTPAPISpecPattern defines a single pattern to match against
// incoming HTTP requests. The per-pattern list of attributes is
// generated if both the http_method and uri_template match. In
// addition, the top-level list of attributes in the HTTPAPISpec is also
// generated.
//
// ```yaml
// pattern:
// - attributes
// api.operation: doFooBar
// httpMethod: GET
// uriTemplate: /foo/bar
// ```
type HTTPAPISpecPattern struct {
// List of attributes that are generated if the HTTP request matches
// the specified http_method and uri_template. This typically
// includes the "api.operation" attribute.
Attributes *istio_mixer_v1.Attributes `protobuf:"bytes,1,opt,name=attributes" json:"attributes,omitempty"`
// HTTP request method to match against as defined by
// [rfc7231](https://tools.ietf.org/html/rfc7231#page-21). For
// example: GET, HEAD, POST, PUT, DELETE.
HttpMethod string `protobuf:"bytes,2,opt,name=http_method,json=httpMethod,proto3" json:"http_method,omitempty"`
// Types that are valid to be assigned to Pattern:
// *HTTPAPISpecPattern_UriTemplate
// *HTTPAPISpecPattern_Regex
Pattern isHTTPAPISpecPattern_Pattern `protobuf_oneof:"pattern"`
}
func (m *HTTPAPISpecPattern) Reset() { *m = HTTPAPISpecPattern{} }
func (*HTTPAPISpecPattern) ProtoMessage() {}
func (*HTTPAPISpecPattern) Descriptor() ([]byte, []int) { return fileDescriptorApiSpec, []int{1} }
type isHTTPAPISpecPattern_Pattern interface {
isHTTPAPISpecPattern_Pattern()
MarshalTo([]byte) (int, error)
Size() int
}
type HTTPAPISpecPattern_UriTemplate struct {
UriTemplate string `protobuf:"bytes,3,opt,name=uri_template,json=uriTemplate,proto3,oneof"`
}
type HTTPAPISpecPattern_Regex struct {
Regex string `protobuf:"bytes,4,opt,name=regex,proto3,oneof"`
}
func (*HTTPAPISpecPattern_UriTemplate) isHTTPAPISpecPattern_Pattern() {}
func (*HTTPAPISpecPattern_Regex) isHTTPAPISpecPattern_Pattern() {}
func (m *HTTPAPISpecPattern) GetPattern() isHTTPAPISpecPattern_Pattern {
if m != nil {
return m.Pattern
}
return nil
}
func (m *HTTPAPISpecPattern) GetUriTemplate() string {
if x, ok := m.GetPattern().(*HTTPAPISpecPattern_UriTemplate); ok {
return x.UriTemplate
}
return ""
}
func (m *HTTPAPISpecPattern) GetRegex() string {
if x, ok := m.GetPattern().(*HTTPAPISpecPattern_Regex); ok {
return x.Regex
}
return ""
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*HTTPAPISpecPattern) 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 _HTTPAPISpecPattern_OneofMarshaler, _HTTPAPISpecPattern_OneofUnmarshaler, _HTTPAPISpecPattern_OneofSizer, []interface{}{
(*HTTPAPISpecPattern_UriTemplate)(nil),
(*HTTPAPISpecPattern_Regex)(nil),
}
}
func _HTTPAPISpecPattern_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*HTTPAPISpecPattern)
// pattern
switch x := m.Pattern.(type) {
case *HTTPAPISpecPattern_UriTemplate:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.UriTemplate)
case *HTTPAPISpecPattern_Regex:
_ = b.EncodeVarint(4<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Regex)
case nil:
default:
return fmt.Errorf("HTTPAPISpecPattern.Pattern has unexpected type %T", x)
}
return nil
}
func _HTTPAPISpecPattern_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*HTTPAPISpecPattern)
switch tag {
case 3: // pattern.uri_template
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.Pattern = &HTTPAPISpecPattern_UriTemplate{x}
return true, err
case 4: // pattern.regex
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.Pattern = &HTTPAPISpecPattern_Regex{x}
return true, err
default:
return false, nil
}
}
func _HTTPAPISpecPattern_OneofSizer(msg proto.Message) (n int) {
m := msg.(*HTTPAPISpecPattern)
// pattern
switch x := m.Pattern.(type) {
case *HTTPAPISpecPattern_UriTemplate:
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.UriTemplate)))
n += len(x.UriTemplate)
case *HTTPAPISpecPattern_Regex:
n += proto.SizeVarint(4<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Regex)))
n += len(x.Regex)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// APIKey defines the explicit configuration for generating the
// `request.api_key` attribute from HTTP requests.
//
// See https://swagger.io/docs/specification/authentication/api-keys
// for a general overview of API keys as defined by OpenAPI.
type APIKey struct {
// Types that are valid to be assigned to Key:
// *APIKey_Query
// *APIKey_Header
// *APIKey_Cookie
Key isAPIKey_Key `protobuf_oneof:"key"`
}
func (m *APIKey) Reset() { *m = APIKey{} }
func (*APIKey) ProtoMessage() {}
func (*APIKey) Descriptor() ([]byte, []int) { return fileDescriptorApiSpec, []int{2} }
type isAPIKey_Key interface {
isAPIKey_Key()
MarshalTo([]byte) (int, error)
Size() int
}
type APIKey_Query struct {
Query string `protobuf:"bytes,1,opt,name=query,proto3,oneof"`
}
type APIKey_Header struct {
Header string `protobuf:"bytes,2,opt,name=header,proto3,oneof"`
}
type APIKey_Cookie struct {
Cookie string `protobuf:"bytes,3,opt,name=cookie,proto3,oneof"`
}
func (*APIKey_Query) isAPIKey_Key() {}
func (*APIKey_Header) isAPIKey_Key() {}
func (*APIKey_Cookie) isAPIKey_Key() {}
func (m *APIKey) GetKey() isAPIKey_Key {
if m != nil {
return m.Key
}
return nil
}
func (m *APIKey) GetQuery() string {
if x, ok := m.GetKey().(*APIKey_Query); ok {
return x.Query
}
return ""
}
func (m *APIKey) GetHeader() string {
if x, ok := m.GetKey().(*APIKey_Header); ok {
return x.Header
}
return ""
}
func (m *APIKey) GetCookie() string {
if x, ok := m.GetKey().(*APIKey_Cookie); ok {
return x.Cookie
}
return ""
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*APIKey) 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 _APIKey_OneofMarshaler, _APIKey_OneofUnmarshaler, _APIKey_OneofSizer, []interface{}{
(*APIKey_Query)(nil),
(*APIKey_Header)(nil),
(*APIKey_Cookie)(nil),
}
}
func _APIKey_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*APIKey)
// key
switch x := m.Key.(type) {
case *APIKey_Query:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Query)
case *APIKey_Header:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Header)
case *APIKey_Cookie:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
_ = b.EncodeStringBytes(x.Cookie)
case nil:
default:
return fmt.Errorf("APIKey.Key has unexpected type %T", x)
}
return nil
}
func _APIKey_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*APIKey)
switch tag {
case 1: // key.query
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.Key = &APIKey_Query{x}
return true, err
case 2: // key.header
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.Key = &APIKey_Header{x}
return true, err
case 3: // key.cookie
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.Key = &APIKey_Cookie{x}
return true, err
default:
return false, nil
}
}
func _APIKey_OneofSizer(msg proto.Message) (n int) {
m := msg.(*APIKey)
// key
switch x := m.Key.(type) {
case *APIKey_Query:
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Query)))
n += len(x.Query)
case *APIKey_Header:
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Header)))
n += len(x.Header)
case *APIKey_Cookie:
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Cookie)))
n += len(x.Cookie)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// HTTPAPISpecReference defines a reference to an HTTPAPISpec. This is
// typically used for establishing bindings between an HTTPAPISpec and an
// IstioService. For example, the following defines an
// HTTPAPISpecReference for service `foo` in namespace `bar`.
//
// ```yaml
// - name: foo
// namespace: bar
// ```
type HTTPAPISpecReference struct {
// REQUIRED. The short name of the HTTPAPISpec. This is the resource
// name defined by the metadata name field.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Optional namespace of the HTTPAPISpec. Defaults to the encompassing
// HTTPAPISpecBinding's metadata namespace field.
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
}
func (m *HTTPAPISpecReference) Reset() { *m = HTTPAPISpecReference{} }
func (*HTTPAPISpecReference) ProtoMessage() {}
func (*HTTPAPISpecReference) Descriptor() ([]byte, []int) { return fileDescriptorApiSpec, []int{3} }
// HTTPAPISpecBinding defines the binding between HTTPAPISpecs and one or more
// IstioService. For example, the following establishes a binding
// between the HTTPAPISpec `petstore` and service `foo` in namespace `bar`.
//
// ```yaml
// apiVersion: config.istio.io/v1alpha2
// kind: HTTPAPISpecBinding
// metadata:
// name: my-binding
// namespace: default
// spec:
// services:
// - name: foo
// namespace: bar
// api_specs:
// - name: petstore
// namespace: default
// ```
type HTTPAPISpecBinding struct {
// REQUIRED. One or more services to map the listed HTTPAPISpec onto.
Services []*IstioService `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"`
// REQUIRED. One or more HTTPAPISpec references that should be mapped to
// the specified service(s). The aggregate collection of match
// conditions defined in the HTTPAPISpecs should not overlap.
ApiSpecs []*HTTPAPISpecReference `protobuf:"bytes,2,rep,name=api_specs,json=apiSpecs" json:"api_specs,omitempty"`
}
func (m *HTTPAPISpecBinding) Reset() { *m = HTTPAPISpecBinding{} }
func (*HTTPAPISpecBinding) ProtoMessage() {}
func (*HTTPAPISpecBinding) Descriptor() ([]byte, []int) { return fileDescriptorApiSpec, []int{4} }
func init() {
proto.RegisterType((*HTTPAPISpec)(nil), "istio.mixer.v1.config.client.HTTPAPISpec")
proto.RegisterType((*HTTPAPISpecPattern)(nil), "istio.mixer.v1.config.client.HTTPAPISpecPattern")
proto.RegisterType((*APIKey)(nil), "istio.mixer.v1.config.client.APIKey")
proto.RegisterType((*HTTPAPISpecReference)(nil), "istio.mixer.v1.config.client.HTTPAPISpecReference")
proto.RegisterType((*HTTPAPISpecBinding)(nil), "istio.mixer.v1.config.client.HTTPAPISpecBinding")
}
func (m *HTTPAPISpec) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *HTTPAPISpec) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Attributes != nil {
dAtA[i] = 0xa
i++
i = encodeVarintApiSpec(dAtA, i, uint64(m.Attributes.Size()))
n1, err := m.Attributes.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
}
if len(m.Patterns) > 0 {
for _, msg := range m.Patterns {
dAtA[i] = 0x12
i++
i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.ApiKeys) > 0 {
for _, msg := range m.ApiKeys {
dAtA[i] = 0x1a
i++
i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
return i, nil
}
func (m *HTTPAPISpecPattern) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *HTTPAPISpecPattern) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Attributes != nil {
dAtA[i] = 0xa
i++
i = encodeVarintApiSpec(dAtA, i, uint64(m.Attributes.Size()))
n2, err := m.Attributes.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
if len(m.HttpMethod) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.HttpMethod)))
i += copy(dAtA[i:], m.HttpMethod)
}
if m.Pattern != nil {
nn3, err := m.Pattern.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += nn3
}
return i, nil
}
func (m *HTTPAPISpecPattern_UriTemplate) MarshalTo(dAtA []byte) (int, error) {
i := 0
dAtA[i] = 0x1a
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.UriTemplate)))
i += copy(dAtA[i:], m.UriTemplate)
return i, nil
}
func (m *HTTPAPISpecPattern_Regex) MarshalTo(dAtA []byte) (int, error) {
i := 0
dAtA[i] = 0x22
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Regex)))
i += copy(dAtA[i:], m.Regex)
return i, nil
}
func (m *APIKey) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *APIKey) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Key != nil {
nn4, err := m.Key.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += nn4
}
return i, nil
}
func (m *APIKey_Query) MarshalTo(dAtA []byte) (int, error) {
i := 0
dAtA[i] = 0xa
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Query)))
i += copy(dAtA[i:], m.Query)
return i, nil
}
func (m *APIKey_Header) MarshalTo(dAtA []byte) (int, error) {
i := 0
dAtA[i] = 0x12
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Header)))
i += copy(dAtA[i:], m.Header)
return i, nil
}
func (m *APIKey_Cookie) MarshalTo(dAtA []byte) (int, error) {
i := 0
dAtA[i] = 0x1a
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Cookie)))
i += copy(dAtA[i:], m.Cookie)
return i, nil
}
func (m *HTTPAPISpecReference) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *HTTPAPISpecReference) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Name) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if len(m.Namespace) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintApiSpec(dAtA, i, uint64(len(m.Namespace)))
i += copy(dAtA[i:], m.Namespace)
}
return i, nil
}
func (m *HTTPAPISpecBinding) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *HTTPAPISpecBinding) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Services) > 0 {
for _, msg := range m.Services {
dAtA[i] = 0xa
i++
i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.ApiSpecs) > 0 {
for _, msg := range m.ApiSpecs {
dAtA[i] = 0x12
i++
i = encodeVarintApiSpec(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
return i, nil
}
func encodeVarintApiSpec(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *HTTPAPISpec) Size() (n int) {
var l int
_ = l
if m.Attributes != nil {
l = m.Attributes.Size()
n += 1 + l + sovApiSpec(uint64(l))
}
if len(m.Patterns) > 0 {
for _, e := range m.Patterns {
l = e.Size()
n += 1 + l + sovApiSpec(uint64(l))
}
}
if len(m.ApiKeys) > 0 {
for _, e := range m.ApiKeys {
l = e.Size()
n += 1 + l + sovApiSpec(uint64(l))
}
}
return n
}
func (m *HTTPAPISpecPattern) Size() (n int) {
var l int
_ = l
if m.Attributes != nil {
l = m.Attributes.Size()
n += 1 + l + sovApiSpec(uint64(l))
}
l = len(m.HttpMethod)
if l > 0 {
n += 1 + l + sovApiSpec(uint64(l))
}
if m.Pattern != nil {
n += m.Pattern.Size()
}
return n
}
func (m *HTTPAPISpecPattern_UriTemplate) Size() (n int) {
var l int
_ = l
l = len(m.UriTemplate)
n += 1 + l + sovApiSpec(uint64(l))
return n
}
func (m *HTTPAPISpecPattern_Regex) Size() (n int) {
var l int
_ = l
l = len(m.Regex)
n += 1 + l + sovApiSpec(uint64(l))
return n
}
func (m *APIKey) Size() (n int) {
var l int
_ = l
if m.Key != nil {
n += m.Key.Size()
}
return n
}
func (m *APIKey_Query) Size() (n int) {
var l int
_ = l
l = len(m.Query)
n += 1 + l + sovApiSpec(uint64(l))
return n
}
func (m *APIKey_Header) Size() (n int) {
var l int
_ = l
l = len(m.Header)
n += 1 + l + sovApiSpec(uint64(l))
return n
}
func (m *APIKey_Cookie) Size() (n int) {
var l int
_ = l
l = len(m.Cookie)
n += 1 + l + sovApiSpec(uint64(l))
return n
}
func (m *HTTPAPISpecReference) Size() (n int) {
var l int
_ = l
l = len(m.Name)
if l > 0 {
n += 1 + l + sovApiSpec(uint64(l))
}
l = len(m.Namespace)
if l > 0 {
n += 1 + l + sovApiSpec(uint64(l))
}
return n
}
func (m *HTTPAPISpecBinding) Size() (n int) {
var l int
_ = l
if len(m.Services) > 0 {
for _, e := range m.Services {
l = e.Size()
n += 1 + l + sovApiSpec(uint64(l))
}
}
if len(m.ApiSpecs) > 0 {
for _, e := range m.ApiSpecs {
l = e.Size()
n += 1 + l + sovApiSpec(uint64(l))
}
}
return n
}
func sovApiSpec(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozApiSpec(x uint64) (n int) {
return sovApiSpec(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *HTTPAPISpec) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&HTTPAPISpec{`,
`Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attributes", "istio_mixer_v1.Attributes", 1) + `,`,
`Patterns:` + strings.Replace(fmt.Sprintf("%v", this.Patterns), "HTTPAPISpecPattern", "HTTPAPISpecPattern", 1) + `,`,
`ApiKeys:` + strings.Replace(fmt.Sprintf("%v", this.ApiKeys), "APIKey", "APIKey", 1) + `,`,
`}`,
}, "")
return s
}
func (this *HTTPAPISpecPattern) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&HTTPAPISpecPattern{`,
`Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "Attributes", "istio_mixer_v1.Attributes", 1) + `,`,
`HttpMethod:` + fmt.Sprintf("%v", this.HttpMethod) + `,`,
`Pattern:` + fmt.Sprintf("%v", this.Pattern) + `,`,
`}`,
}, "")
return s
}
func (this *HTTPAPISpecPattern_UriTemplate) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&HTTPAPISpecPattern_UriTemplate{`,
`UriTemplate:` + fmt.Sprintf("%v", this.UriTemplate) + `,`,
`}`,
}, "")
return s
}
func (this *HTTPAPISpecPattern_Regex) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&HTTPAPISpecPattern_Regex{`,
`Regex:` + fmt.Sprintf("%v", this.Regex) + `,`,
`}`,
}, "")
return s
}
func (this *APIKey) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&APIKey{`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`}`,
}, "")
return s
}
func (this *APIKey_Query) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&APIKey_Query{`,
`Query:` + fmt.Sprintf("%v", this.Query) + `,`,
`}`,
}, "")
return s
}
func (this *APIKey_Header) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&APIKey_Header{`,
`Header:` + fmt.Sprintf("%v", this.Header) + `,`,
`}`,
}, "")
return s
}
func (this *APIKey_Cookie) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&APIKey_Cookie{`,
`Cookie:` + fmt.Sprintf("%v", this.Cookie) + `,`,
`}`,
}, "")
return s
}
func (this *HTTPAPISpecReference) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&HTTPAPISpecReference{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
`}`,
}, "")
return s
}
func (this *HTTPAPISpecBinding) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&HTTPAPISpecBinding{`,
`Services:` + strings.Replace(fmt.Sprintf("%v", this.Services), "IstioService", "IstioService", 1) + `,`,
`ApiSpecs:` + strings.Replace(fmt.Sprintf("%v", this.ApiSpecs), "HTTPAPISpecReference", "HTTPAPISpecReference", 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringApiSpec(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *HTTPAPISpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApiSpec
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: HTTPAPISpec: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: HTTPAPISpec: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowApiSpec
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthApiSpec
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Attributes == nil {