github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/proto/tendermint/google/api/http.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: tendermint/google/api/http.proto 3 4 package annotations 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 ) 13 14 // Reference imports to suppress errors if they are not otherwise used. 15 var _ = proto.Marshal 16 var _ = fmt.Errorf 17 var _ = math.Inf 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the proto package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // proto package needs to be updated. 23 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 24 25 // Defines the HTTP configuration for an API service. It contains a list of 26 // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method 27 // to one or more HTTP REST API methods. 28 type Http struct { 29 // A list of HTTP configuration rules that apply to individual API methods. 30 // 31 // **NOTE:** All service configuration rules follow "last one wins" order. 32 Rules []*HttpRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"` 33 // When set to true, URL path parameters will be fully URI-decoded except in 34 // cases of single segment matches in reserved expansion, where "%2F" will be 35 // left encoded. 36 // 37 // The default behavior is to not decode RFC 6570 reserved characters in multi 38 // segment matches. 39 FullyDecodeReservedExpansion bool `protobuf:"varint,2,opt,name=fully_decode_reserved_expansion,json=fullyDecodeReservedExpansion,proto3" json:"fully_decode_reserved_expansion,omitempty"` 40 } 41 42 func (m *Http) Reset() { *m = Http{} } 43 func (m *Http) String() string { return proto.CompactTextString(m) } 44 func (*Http) ProtoMessage() {} 45 func (*Http) Descriptor() ([]byte, []int) { 46 return fileDescriptor_be62adc3a8875e43, []int{0} 47 } 48 func (m *Http) XXX_Unmarshal(b []byte) error { 49 return m.Unmarshal(b) 50 } 51 func (m *Http) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 52 if deterministic { 53 return xxx_messageInfo_Http.Marshal(b, m, deterministic) 54 } else { 55 b = b[:cap(b)] 56 n, err := m.MarshalToSizedBuffer(b) 57 if err != nil { 58 return nil, err 59 } 60 return b[:n], nil 61 } 62 } 63 func (m *Http) XXX_Merge(src proto.Message) { 64 xxx_messageInfo_Http.Merge(m, src) 65 } 66 func (m *Http) XXX_Size() int { 67 return m.Size() 68 } 69 func (m *Http) XXX_DiscardUnknown() { 70 xxx_messageInfo_Http.DiscardUnknown(m) 71 } 72 73 var xxx_messageInfo_Http proto.InternalMessageInfo 74 75 func (m *Http) GetRules() []*HttpRule { 76 if m != nil { 77 return m.Rules 78 } 79 return nil 80 } 81 82 func (m *Http) GetFullyDecodeReservedExpansion() bool { 83 if m != nil { 84 return m.FullyDecodeReservedExpansion 85 } 86 return false 87 } 88 89 // # gRPC Transcoding 90 // 91 // gRPC Transcoding is a feature for mapping between a gRPC method and one or 92 // more HTTP REST endpoints. It allows developers to build a single API service 93 // that supports both gRPC APIs and REST APIs. Many systems, including [Google 94 // APIs](https://github.com/googleapis/googleapis), 95 // [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC 96 // Gateway](https://github.com/grpc-ecosystem/grpc-gateway), 97 // and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature 98 // and use it for large scale production services. 99 // 100 // `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies 101 // how different portions of the gRPC request message are mapped to the URL 102 // path, URL query parameters, and HTTP request body. It also controls how the 103 // gRPC response message is mapped to the HTTP response body. `HttpRule` is 104 // typically specified as an `google.api.http` annotation on the gRPC method. 105 // 106 // Each mapping specifies a URL path template and an HTTP method. The path 107 // template may refer to one or more fields in the gRPC request message, as long 108 // as each field is a non-repeated field with a primitive (non-message) type. 109 // The path template controls how fields of the request message are mapped to 110 // the URL path. 111 // 112 // Example: 113 // 114 // service Messaging { 115 // rpc GetMessage(GetMessageRequest) returns (Message) { 116 // option (google.api.http) = { 117 // get: "/v1/{name=messages/*}" 118 // }; 119 // } 120 // } 121 // message GetMessageRequest { 122 // string name = 1; // Mapped to URL path. 123 // } 124 // message Message { 125 // string text = 1; // The resource content. 126 // } 127 // 128 // This enables an HTTP REST to gRPC mapping as below: 129 // 130 // HTTP | gRPC 131 // -----|----- 132 // `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` 133 // 134 // Any fields in the request message which are not bound by the path template 135 // automatically become HTTP query parameters if there is no HTTP request body. 136 // For example: 137 // 138 // service Messaging { 139 // rpc GetMessage(GetMessageRequest) returns (Message) { 140 // option (google.api.http) = { 141 // get:"/v1/messages/{message_id}" 142 // }; 143 // } 144 // } 145 // message GetMessageRequest { 146 // message SubMessage { 147 // string subfield = 1; 148 // } 149 // string message_id = 1; // Mapped to URL path. 150 // int64 revision = 2; // Mapped to URL query parameter `revision`. 151 // SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. 152 // } 153 // 154 // This enables a HTTP JSON to RPC mapping as below: 155 // 156 // HTTP | gRPC 157 // -----|----- 158 // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | 159 // `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: 160 // "foo"))` 161 // 162 // Note that fields which are mapped to URL query parameters must have a 163 // primitive type or a repeated primitive type or a non-repeated message type. 164 // In the case of a repeated type, the parameter can be repeated in the URL 165 // as `...?param=A¶m=B`. In the case of a message type, each field of the 166 // message is mapped to a separate parameter, such as 167 // `...?foo.a=A&foo.b=B&foo.c=C`. 168 // 169 // For HTTP methods that allow a request body, the `body` field 170 // specifies the mapping. Consider a REST update method on the 171 // message resource collection: 172 // 173 // service Messaging { 174 // rpc UpdateMessage(UpdateMessageRequest) returns (Message) { 175 // option (google.api.http) = { 176 // patch: "/v1/messages/{message_id}" 177 // body: "message" 178 // }; 179 // } 180 // } 181 // message UpdateMessageRequest { 182 // string message_id = 1; // mapped to the URL 183 // Message message = 2; // mapped to the body 184 // } 185 // 186 // The following HTTP JSON to RPC mapping is enabled, where the 187 // representation of the JSON in the request body is determined by 188 // protos JSON encoding: 189 // 190 // HTTP | gRPC 191 // -----|----- 192 // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: 193 // "123456" message { text: "Hi!" })` 194 // 195 // The special name `*` can be used in the body mapping to define that 196 // every field not bound by the path template should be mapped to the 197 // request body. This enables the following alternative definition of 198 // the update method: 199 // 200 // service Messaging { 201 // rpc UpdateMessage(Message) returns (Message) { 202 // option (google.api.http) = { 203 // patch: "/v1/messages/{message_id}" 204 // body: "*" 205 // }; 206 // } 207 // } 208 // message Message { 209 // string message_id = 1; 210 // string text = 2; 211 // } 212 // 213 // 214 // The following HTTP JSON to RPC mapping is enabled: 215 // 216 // HTTP | gRPC 217 // -----|----- 218 // `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: 219 // "123456" text: "Hi!")` 220 // 221 // Note that when using `*` in the body mapping, it is not possible to 222 // have HTTP parameters, as all fields not bound by the path end in 223 // the body. This makes this option more rarely used in practice when 224 // defining REST APIs. The common usage of `*` is in custom methods 225 // which don't use the URL at all for transferring data. 226 // 227 // It is possible to define multiple HTTP methods for one RPC by using 228 // the `additional_bindings` option. Example: 229 // 230 // service Messaging { 231 // rpc GetMessage(GetMessageRequest) returns (Message) { 232 // option (google.api.http) = { 233 // get: "/v1/messages/{message_id}" 234 // additional_bindings { 235 // get: "/v1/users/{user_id}/messages/{message_id}" 236 // } 237 // }; 238 // } 239 // } 240 // message GetMessageRequest { 241 // string message_id = 1; 242 // string user_id = 2; 243 // } 244 // 245 // This enables the following two alternative HTTP JSON to RPC mappings: 246 // 247 // HTTP | gRPC 248 // -----|----- 249 // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` 250 // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: 251 // "123456")` 252 // 253 // ## Rules for HTTP mapping 254 // 255 // 1. Leaf request fields (recursive expansion nested messages in the request 256 // message) are classified into three categories: 257 // - Fields referred by the path template. They are passed via the URL path. 258 // - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP 259 // request body. 260 // - All other fields are passed via the URL query parameters, and the 261 // parameter name is the field path in the request message. A repeated 262 // field can be represented as multiple query parameters under the same 263 // name. 264 // 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields 265 // are passed via URL path and HTTP request body. 266 // 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all 267 // fields are passed via URL path and URL query parameters. 268 // 269 // ### Path template syntax 270 // 271 // Template = "/" Segments [ Verb ] ; 272 // Segments = Segment { "/" Segment } ; 273 // Segment = "*" | "**" | LITERAL | Variable ; 274 // Variable = "{" FieldPath [ "=" Segments ] "}" ; 275 // FieldPath = IDENT { "." IDENT } ; 276 // Verb = ":" LITERAL ; 277 // 278 // The syntax `*` matches a single URL path segment. The syntax `**` matches 279 // zero or more URL path segments, which must be the last part of the URL path 280 // except the `Verb`. 281 // 282 // The syntax `Variable` matches part of the URL path as specified by its 283 // template. A variable template must not contain other variables. If a variable 284 // matches a single path segment, its template may be omitted, e.g. `{var}` 285 // is equivalent to `{var=*}`. 286 // 287 // The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` 288 // contains any reserved character, such characters should be percent-encoded 289 // before the matching. 290 // 291 // If a variable contains exactly one path segment, such as `"{var}"` or 292 // `"{var=*}"`, when such a variable is expanded into a URL path on the client 293 // side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The 294 // server side does the reverse decoding. Such variables show up in the 295 // [Discovery 296 // Document](https://developers.google.com/discovery/v1/reference/apis) as 297 // `{var}`. 298 // 299 // If a variable contains multiple path segments, such as `"{var=foo/*}"` 300 // or `"{var=**}"`, when such a variable is expanded into a URL path on the 301 // client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. 302 // The server side does the reverse decoding, except "%2F" and "%2f" are left 303 // unchanged. Such variables show up in the 304 // [Discovery 305 // Document](https://developers.google.com/discovery/v1/reference/apis) as 306 // `{+var}`. 307 // 308 // ## Using gRPC API Service Configuration 309 // 310 // gRPC API Service Configuration (service config) is a configuration language 311 // for configuring a gRPC service to become a user-facing product. The 312 // service config is simply the YAML representation of the `google.api.Service` 313 // proto message. 314 // 315 // As an alternative to annotating your proto file, you can configure gRPC 316 // transcoding in your service config YAML files. You do this by specifying a 317 // `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same 318 // effect as the proto annotation. This can be particularly useful if you 319 // have a proto that is reused in multiple services. Note that any transcoding 320 // specified in the service config will override any matching transcoding 321 // configuration in the proto. 322 // 323 // Example: 324 // 325 // http: 326 // rules: 327 // # Selects a gRPC method and applies HttpRule to it. 328 // - selector: example.v1.Messaging.GetMessage 329 // get: /v1/messages/{message_id}/{sub.subfield} 330 // 331 // ## Special notes 332 // 333 // When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the 334 // proto to JSON conversion must follow the [proto3 335 // specification](https://developers.google.com/protocol-buffers/docs/proto3#json). 336 // 337 // While the single segment variable follows the semantics of 338 // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String 339 // Expansion, the multi segment variable **does not** follow RFC 6570 Section 340 // 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion 341 // does not expand special characters like `?` and `#`, which would lead 342 // to invalid URLs. As the result, gRPC Transcoding uses a custom encoding 343 // for multi segment variables. 344 // 345 // The path variables **must not** refer to any repeated or mapped field, 346 // because client libraries are not capable of handling such variable expansion. 347 // 348 // The path variables **must not** capture the leading "/" character. The reason 349 // is that the most common use case "{var}" does not capture the leading "/" 350 // character. For consistency, all path variables must share the same behavior. 351 // 352 // Repeated message fields must not be mapped to URL query parameters, because 353 // no client library can support such complicated mapping. 354 // 355 // If an API needs to use a JSON array for request or response body, it can map 356 // the request or response body to a repeated field. However, some gRPC 357 // Transcoding implementations may not support this feature. 358 type HttpRule struct { 359 // Selects a method to which this rule applies. 360 // 361 // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. 362 Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"` 363 // Determines the URL pattern is matched by this rules. This pattern can be 364 // used with any of the {get|put|post|delete|patch} methods. A custom method 365 // can be defined using the 'custom' field. 366 // 367 // Types that are valid to be assigned to Pattern: 368 // *HttpRule_Get 369 // *HttpRule_Put 370 // *HttpRule_Post 371 // *HttpRule_Delete 372 // *HttpRule_Patch 373 // *HttpRule_Custom 374 Pattern isHttpRule_Pattern `protobuf_oneof:"pattern"` 375 // The name of the request field whose value is mapped to the HTTP request 376 // body, or `*` for mapping all request fields not captured by the path 377 // pattern to the HTTP body, or omitted for not having any HTTP request body. 378 // 379 // NOTE: the referred field must be present at the top-level of the request 380 // message type. 381 Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` 382 // Optional. The name of the response field whose value is mapped to the HTTP 383 // response body. When omitted, the entire response message will be used 384 // as the HTTP response body. 385 // 386 // NOTE: The referred field must be present at the top-level of the response 387 // message type. 388 ResponseBody string `protobuf:"bytes,12,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` 389 // Additional HTTP bindings for the selector. Nested bindings must 390 // not contain an `additional_bindings` field themselves (that is, 391 // the nesting may only be one level deep). 392 AdditionalBindings []*HttpRule `protobuf:"bytes,11,rep,name=additional_bindings,json=additionalBindings,proto3" json:"additional_bindings,omitempty"` 393 } 394 395 func (m *HttpRule) Reset() { *m = HttpRule{} } 396 func (m *HttpRule) String() string { return proto.CompactTextString(m) } 397 func (*HttpRule) ProtoMessage() {} 398 func (*HttpRule) Descriptor() ([]byte, []int) { 399 return fileDescriptor_be62adc3a8875e43, []int{1} 400 } 401 func (m *HttpRule) XXX_Unmarshal(b []byte) error { 402 return m.Unmarshal(b) 403 } 404 func (m *HttpRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 405 if deterministic { 406 return xxx_messageInfo_HttpRule.Marshal(b, m, deterministic) 407 } else { 408 b = b[:cap(b)] 409 n, err := m.MarshalToSizedBuffer(b) 410 if err != nil { 411 return nil, err 412 } 413 return b[:n], nil 414 } 415 } 416 func (m *HttpRule) XXX_Merge(src proto.Message) { 417 xxx_messageInfo_HttpRule.Merge(m, src) 418 } 419 func (m *HttpRule) XXX_Size() int { 420 return m.Size() 421 } 422 func (m *HttpRule) XXX_DiscardUnknown() { 423 xxx_messageInfo_HttpRule.DiscardUnknown(m) 424 } 425 426 var xxx_messageInfo_HttpRule proto.InternalMessageInfo 427 428 type isHttpRule_Pattern interface { 429 isHttpRule_Pattern() 430 MarshalTo([]byte) (int, error) 431 Size() int 432 } 433 434 type HttpRule_Get struct { 435 Get string `protobuf:"bytes,2,opt,name=get,proto3,oneof" json:"get,omitempty"` 436 } 437 type HttpRule_Put struct { 438 Put string `protobuf:"bytes,3,opt,name=put,proto3,oneof" json:"put,omitempty"` 439 } 440 type HttpRule_Post struct { 441 Post string `protobuf:"bytes,4,opt,name=post,proto3,oneof" json:"post,omitempty"` 442 } 443 type HttpRule_Delete struct { 444 Delete string `protobuf:"bytes,5,opt,name=delete,proto3,oneof" json:"delete,omitempty"` 445 } 446 type HttpRule_Patch struct { 447 Patch string `protobuf:"bytes,6,opt,name=patch,proto3,oneof" json:"patch,omitempty"` 448 } 449 type HttpRule_Custom struct { 450 Custom *CustomHttpPattern `protobuf:"bytes,8,opt,name=custom,proto3,oneof" json:"custom,omitempty"` 451 } 452 453 func (*HttpRule_Get) isHttpRule_Pattern() {} 454 func (*HttpRule_Put) isHttpRule_Pattern() {} 455 func (*HttpRule_Post) isHttpRule_Pattern() {} 456 func (*HttpRule_Delete) isHttpRule_Pattern() {} 457 func (*HttpRule_Patch) isHttpRule_Pattern() {} 458 func (*HttpRule_Custom) isHttpRule_Pattern() {} 459 460 func (m *HttpRule) GetPattern() isHttpRule_Pattern { 461 if m != nil { 462 return m.Pattern 463 } 464 return nil 465 } 466 467 func (m *HttpRule) GetSelector() string { 468 if m != nil { 469 return m.Selector 470 } 471 return "" 472 } 473 474 func (m *HttpRule) GetGet() string { 475 if x, ok := m.GetPattern().(*HttpRule_Get); ok { 476 return x.Get 477 } 478 return "" 479 } 480 481 func (m *HttpRule) GetPut() string { 482 if x, ok := m.GetPattern().(*HttpRule_Put); ok { 483 return x.Put 484 } 485 return "" 486 } 487 488 func (m *HttpRule) GetPost() string { 489 if x, ok := m.GetPattern().(*HttpRule_Post); ok { 490 return x.Post 491 } 492 return "" 493 } 494 495 func (m *HttpRule) GetDelete() string { 496 if x, ok := m.GetPattern().(*HttpRule_Delete); ok { 497 return x.Delete 498 } 499 return "" 500 } 501 502 func (m *HttpRule) GetPatch() string { 503 if x, ok := m.GetPattern().(*HttpRule_Patch); ok { 504 return x.Patch 505 } 506 return "" 507 } 508 509 func (m *HttpRule) GetCustom() *CustomHttpPattern { 510 if x, ok := m.GetPattern().(*HttpRule_Custom); ok { 511 return x.Custom 512 } 513 return nil 514 } 515 516 func (m *HttpRule) GetBody() string { 517 if m != nil { 518 return m.Body 519 } 520 return "" 521 } 522 523 func (m *HttpRule) GetResponseBody() string { 524 if m != nil { 525 return m.ResponseBody 526 } 527 return "" 528 } 529 530 func (m *HttpRule) GetAdditionalBindings() []*HttpRule { 531 if m != nil { 532 return m.AdditionalBindings 533 } 534 return nil 535 } 536 537 // XXX_OneofWrappers is for the internal use of the proto package. 538 func (*HttpRule) XXX_OneofWrappers() []interface{} { 539 return []interface{}{ 540 (*HttpRule_Get)(nil), 541 (*HttpRule_Put)(nil), 542 (*HttpRule_Post)(nil), 543 (*HttpRule_Delete)(nil), 544 (*HttpRule_Patch)(nil), 545 (*HttpRule_Custom)(nil), 546 } 547 } 548 549 // A custom pattern is used for defining custom HTTP verb. 550 type CustomHttpPattern struct { 551 // The name of this custom HTTP verb. 552 Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"` 553 // The path matched by this custom verb. 554 Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` 555 } 556 557 func (m *CustomHttpPattern) Reset() { *m = CustomHttpPattern{} } 558 func (m *CustomHttpPattern) String() string { return proto.CompactTextString(m) } 559 func (*CustomHttpPattern) ProtoMessage() {} 560 func (*CustomHttpPattern) Descriptor() ([]byte, []int) { 561 return fileDescriptor_be62adc3a8875e43, []int{2} 562 } 563 func (m *CustomHttpPattern) XXX_Unmarshal(b []byte) error { 564 return m.Unmarshal(b) 565 } 566 func (m *CustomHttpPattern) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 567 if deterministic { 568 return xxx_messageInfo_CustomHttpPattern.Marshal(b, m, deterministic) 569 } else { 570 b = b[:cap(b)] 571 n, err := m.MarshalToSizedBuffer(b) 572 if err != nil { 573 return nil, err 574 } 575 return b[:n], nil 576 } 577 } 578 func (m *CustomHttpPattern) XXX_Merge(src proto.Message) { 579 xxx_messageInfo_CustomHttpPattern.Merge(m, src) 580 } 581 func (m *CustomHttpPattern) XXX_Size() int { 582 return m.Size() 583 } 584 func (m *CustomHttpPattern) XXX_DiscardUnknown() { 585 xxx_messageInfo_CustomHttpPattern.DiscardUnknown(m) 586 } 587 588 var xxx_messageInfo_CustomHttpPattern proto.InternalMessageInfo 589 590 func (m *CustomHttpPattern) GetKind() string { 591 if m != nil { 592 return m.Kind 593 } 594 return "" 595 } 596 597 func (m *CustomHttpPattern) GetPath() string { 598 if m != nil { 599 return m.Path 600 } 601 return "" 602 } 603 604 func init() { 605 proto.RegisterType((*Http)(nil), "google.api.Http") 606 proto.RegisterType((*HttpRule)(nil), "google.api.HttpRule") 607 proto.RegisterType((*CustomHttpPattern)(nil), "google.api.CustomHttpPattern") 608 } 609 610 func init() { proto.RegisterFile("tendermint/google/api/http.proto", fileDescriptor_be62adc3a8875e43) } 611 612 var fileDescriptor_be62adc3a8875e43 = []byte{ 613 // 458 bytes of a gzipped FileDescriptorProto 614 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xbf, 0x8e, 0xd3, 0x40, 615 0x10, 0xc6, 0xb3, 0xf9, 0x77, 0xc9, 0xe6, 0x40, 0x62, 0x39, 0xa1, 0x15, 0x02, 0x13, 0x85, 0x26, 616 0xa2, 0x70, 0xa4, 0xa3, 0xa0, 0xb8, 0xea, 0x0c, 0x11, 0x47, 0x17, 0xb9, 0xa4, 0xb1, 0x36, 0xde, 617 0xc1, 0x59, 0xe1, 0xec, 0xae, 0xbc, 0x63, 0x44, 0x5a, 0x9e, 0x80, 0x67, 0xe0, 0x69, 0x28, 0xaf, 618 0x44, 0x54, 0x28, 0x79, 0x09, 0x4a, 0xb4, 0x6b, 0x87, 0x8b, 0x84, 0x44, 0x37, 0xf3, 0x7d, 0xbf, 619 0x1d, 0x7d, 0x1e, 0x0f, 0x9d, 0x22, 0x68, 0x09, 0xd5, 0x56, 0x69, 0x5c, 0x14, 0xc6, 0x14, 0x25, 620 0x2c, 0x84, 0x55, 0x8b, 0x0d, 0xa2, 0x8d, 0x6d, 0x65, 0xd0, 0x30, 0xda, 0xc8, 0xb1, 0xb0, 0x6a, 621 0xb6, 0xa3, 0xfd, 0x1b, 0x44, 0xcb, 0x5e, 0xd0, 0x41, 0x55, 0x97, 0xe0, 0x38, 0x99, 0xf6, 0xe6, 622 0x93, 0xcb, 0x8b, 0xf8, 0x8e, 0x89, 0x3d, 0x90, 0xd6, 0x25, 0xa4, 0x0d, 0xc2, 0x96, 0xf4, 0xd9, 623 0x87, 0xba, 0x2c, 0x77, 0x99, 0x84, 0xdc, 0x48, 0xc8, 0x2a, 0x70, 0x50, 0x7d, 0x02, 0x99, 0xc1, 624 0x67, 0x2b, 0xb4, 0x53, 0x46, 0xf3, 0xee, 0x94, 0xcc, 0x47, 0xe9, 0x93, 0x80, 0xbd, 0x09, 0x54, 625 0xda, 0x42, 0xcb, 0x23, 0x33, 0xfb, 0xd9, 0xa5, 0xa3, 0xe3, 0x68, 0xf6, 0x98, 0x8e, 0x1c, 0x94, 626 0x90, 0xa3, 0xa9, 0x38, 0x99, 0x92, 0xf9, 0x38, 0xfd, 0xdb, 0x33, 0x46, 0x7b, 0x05, 0x60, 0x98, 627 0x39, 0xbe, 0xe9, 0xa4, 0xbe, 0xf1, 0x9a, 0xad, 0x91, 0xf7, 0x8e, 0x9a, 0xad, 0x91, 0x5d, 0xd0, 628 0xbe, 0x35, 0x0e, 0x79, 0xbf, 0x15, 0x43, 0xc7, 0x38, 0x1d, 0x4a, 0x28, 0x01, 0x81, 0x0f, 0x5a, 629 0xbd, 0xed, 0xd9, 0x23, 0x3a, 0xb0, 0x02, 0xf3, 0x0d, 0x1f, 0xb6, 0x46, 0xd3, 0xb2, 0x57, 0x74, 630 0x98, 0xd7, 0x0e, 0xcd, 0x96, 0x8f, 0xa6, 0x64, 0x3e, 0xb9, 0x7c, 0x7a, 0xba, 0x8c, 0xd7, 0xc1, 631 0xf1, 0xb9, 0x57, 0x02, 0x11, 0x2a, 0xed, 0x07, 0x36, 0x38, 0x63, 0xb4, 0xbf, 0x36, 0x72, 0xc7, 632 0xcf, 0xc2, 0x07, 0x84, 0x9a, 0x3d, 0xa7, 0xf7, 0x2a, 0x70, 0xd6, 0x68, 0x07, 0x59, 0x30, 0xcf, 633 0x83, 0x79, 0x7e, 0x14, 0x13, 0x0f, 0x2d, 0xe9, 0x43, 0x21, 0xa5, 0x42, 0x65, 0xb4, 0x28, 0xb3, 634 0xb5, 0xd2, 0x52, 0xe9, 0xc2, 0xf1, 0xc9, 0x7f, 0xfe, 0x05, 0xbb, 0x7b, 0x90, 0xb4, 0x7c, 0x32, 635 0xa6, 0x67, 0xb6, 0x09, 0x35, 0xbb, 0xa2, 0x0f, 0xfe, 0x49, 0xea, 0xf3, 0x7d, 0x54, 0x5a, 0xb6, 636 0x0b, 0x0e, 0xb5, 0xd7, 0xac, 0xc0, 0x4d, 0xb3, 0xdd, 0x34, 0xd4, 0xc9, 0x17, 0xf2, 0x7d, 0x1f, 637 0x91, 0xdb, 0x7d, 0x44, 0x7e, 0xed, 0x23, 0xf2, 0xf5, 0x10, 0x75, 0x6e, 0x0f, 0x51, 0xe7, 0xc7, 638 0x21, 0xea, 0xd0, 0xfb, 0xb9, 0xd9, 0x9e, 0xe4, 0x49, 0xc6, 0x61, 0xbe, 0x3f, 0xab, 0x15, 0x79, 639 0x7f, 0xdd, 0x1a, 0x85, 0x29, 0x85, 0x2e, 0x62, 0x53, 0x15, 0x8b, 0x02, 0x74, 0x38, 0xba, 0xf6, 640 0x14, 0x85, 0x55, 0x2e, 0x9c, 0xa3, 0xd0, 0xda, 0xa0, 0xf0, 0xf9, 0xdd, 0xd5, 0x49, 0xfd, 0x9b, 641 0x90, 0x6f, 0xdd, 0xfe, 0xdb, 0xeb, 0xd5, 0xbb, 0xf5, 0x30, 0xbc, 0x7b, 0xf9, 0x27, 0x00, 0x00, 642 0xff, 0xff, 0x3c, 0xc4, 0xd2, 0xfd, 0xd0, 0x02, 0x00, 0x00, 643 } 644 645 func (m *Http) Marshal() (dAtA []byte, err error) { 646 size := m.Size() 647 dAtA = make([]byte, size) 648 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 649 if err != nil { 650 return nil, err 651 } 652 return dAtA[:n], nil 653 } 654 655 func (m *Http) MarshalTo(dAtA []byte) (int, error) { 656 size := m.Size() 657 return m.MarshalToSizedBuffer(dAtA[:size]) 658 } 659 660 func (m *Http) MarshalToSizedBuffer(dAtA []byte) (int, error) { 661 i := len(dAtA) 662 _ = i 663 var l int 664 _ = l 665 if m.FullyDecodeReservedExpansion { 666 i-- 667 if m.FullyDecodeReservedExpansion { 668 dAtA[i] = 1 669 } else { 670 dAtA[i] = 0 671 } 672 i-- 673 dAtA[i] = 0x10 674 } 675 if len(m.Rules) > 0 { 676 for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { 677 { 678 size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 679 if err != nil { 680 return 0, err 681 } 682 i -= size 683 i = encodeVarintHttp(dAtA, i, uint64(size)) 684 } 685 i-- 686 dAtA[i] = 0xa 687 } 688 } 689 return len(dAtA) - i, nil 690 } 691 692 func (m *HttpRule) Marshal() (dAtA []byte, err error) { 693 size := m.Size() 694 dAtA = make([]byte, size) 695 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 696 if err != nil { 697 return nil, err 698 } 699 return dAtA[:n], nil 700 } 701 702 func (m *HttpRule) MarshalTo(dAtA []byte) (int, error) { 703 size := m.Size() 704 return m.MarshalToSizedBuffer(dAtA[:size]) 705 } 706 707 func (m *HttpRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { 708 i := len(dAtA) 709 _ = i 710 var l int 711 _ = l 712 if len(m.ResponseBody) > 0 { 713 i -= len(m.ResponseBody) 714 copy(dAtA[i:], m.ResponseBody) 715 i = encodeVarintHttp(dAtA, i, uint64(len(m.ResponseBody))) 716 i-- 717 dAtA[i] = 0x62 718 } 719 if len(m.AdditionalBindings) > 0 { 720 for iNdEx := len(m.AdditionalBindings) - 1; iNdEx >= 0; iNdEx-- { 721 { 722 size, err := m.AdditionalBindings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 723 if err != nil { 724 return 0, err 725 } 726 i -= size 727 i = encodeVarintHttp(dAtA, i, uint64(size)) 728 } 729 i-- 730 dAtA[i] = 0x5a 731 } 732 } 733 if m.Pattern != nil { 734 { 735 size := m.Pattern.Size() 736 i -= size 737 if _, err := m.Pattern.MarshalTo(dAtA[i:]); err != nil { 738 return 0, err 739 } 740 } 741 } 742 if len(m.Body) > 0 { 743 i -= len(m.Body) 744 copy(dAtA[i:], m.Body) 745 i = encodeVarintHttp(dAtA, i, uint64(len(m.Body))) 746 i-- 747 dAtA[i] = 0x3a 748 } 749 if len(m.Selector) > 0 { 750 i -= len(m.Selector) 751 copy(dAtA[i:], m.Selector) 752 i = encodeVarintHttp(dAtA, i, uint64(len(m.Selector))) 753 i-- 754 dAtA[i] = 0xa 755 } 756 return len(dAtA) - i, nil 757 } 758 759 func (m *HttpRule_Get) MarshalTo(dAtA []byte) (int, error) { 760 size := m.Size() 761 return m.MarshalToSizedBuffer(dAtA[:size]) 762 } 763 764 func (m *HttpRule_Get) MarshalToSizedBuffer(dAtA []byte) (int, error) { 765 i := len(dAtA) 766 i -= len(m.Get) 767 copy(dAtA[i:], m.Get) 768 i = encodeVarintHttp(dAtA, i, uint64(len(m.Get))) 769 i-- 770 dAtA[i] = 0x12 771 return len(dAtA) - i, nil 772 } 773 func (m *HttpRule_Put) MarshalTo(dAtA []byte) (int, error) { 774 size := m.Size() 775 return m.MarshalToSizedBuffer(dAtA[:size]) 776 } 777 778 func (m *HttpRule_Put) MarshalToSizedBuffer(dAtA []byte) (int, error) { 779 i := len(dAtA) 780 i -= len(m.Put) 781 copy(dAtA[i:], m.Put) 782 i = encodeVarintHttp(dAtA, i, uint64(len(m.Put))) 783 i-- 784 dAtA[i] = 0x1a 785 return len(dAtA) - i, nil 786 } 787 func (m *HttpRule_Post) MarshalTo(dAtA []byte) (int, error) { 788 size := m.Size() 789 return m.MarshalToSizedBuffer(dAtA[:size]) 790 } 791 792 func (m *HttpRule_Post) MarshalToSizedBuffer(dAtA []byte) (int, error) { 793 i := len(dAtA) 794 i -= len(m.Post) 795 copy(dAtA[i:], m.Post) 796 i = encodeVarintHttp(dAtA, i, uint64(len(m.Post))) 797 i-- 798 dAtA[i] = 0x22 799 return len(dAtA) - i, nil 800 } 801 func (m *HttpRule_Delete) MarshalTo(dAtA []byte) (int, error) { 802 size := m.Size() 803 return m.MarshalToSizedBuffer(dAtA[:size]) 804 } 805 806 func (m *HttpRule_Delete) MarshalToSizedBuffer(dAtA []byte) (int, error) { 807 i := len(dAtA) 808 i -= len(m.Delete) 809 copy(dAtA[i:], m.Delete) 810 i = encodeVarintHttp(dAtA, i, uint64(len(m.Delete))) 811 i-- 812 dAtA[i] = 0x2a 813 return len(dAtA) - i, nil 814 } 815 func (m *HttpRule_Patch) MarshalTo(dAtA []byte) (int, error) { 816 size := m.Size() 817 return m.MarshalToSizedBuffer(dAtA[:size]) 818 } 819 820 func (m *HttpRule_Patch) MarshalToSizedBuffer(dAtA []byte) (int, error) { 821 i := len(dAtA) 822 i -= len(m.Patch) 823 copy(dAtA[i:], m.Patch) 824 i = encodeVarintHttp(dAtA, i, uint64(len(m.Patch))) 825 i-- 826 dAtA[i] = 0x32 827 return len(dAtA) - i, nil 828 } 829 func (m *HttpRule_Custom) MarshalTo(dAtA []byte) (int, error) { 830 size := m.Size() 831 return m.MarshalToSizedBuffer(dAtA[:size]) 832 } 833 834 func (m *HttpRule_Custom) MarshalToSizedBuffer(dAtA []byte) (int, error) { 835 i := len(dAtA) 836 if m.Custom != nil { 837 { 838 size, err := m.Custom.MarshalToSizedBuffer(dAtA[:i]) 839 if err != nil { 840 return 0, err 841 } 842 i -= size 843 i = encodeVarintHttp(dAtA, i, uint64(size)) 844 } 845 i-- 846 dAtA[i] = 0x42 847 } 848 return len(dAtA) - i, nil 849 } 850 func (m *CustomHttpPattern) Marshal() (dAtA []byte, err error) { 851 size := m.Size() 852 dAtA = make([]byte, size) 853 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 854 if err != nil { 855 return nil, err 856 } 857 return dAtA[:n], nil 858 } 859 860 func (m *CustomHttpPattern) MarshalTo(dAtA []byte) (int, error) { 861 size := m.Size() 862 return m.MarshalToSizedBuffer(dAtA[:size]) 863 } 864 865 func (m *CustomHttpPattern) MarshalToSizedBuffer(dAtA []byte) (int, error) { 866 i := len(dAtA) 867 _ = i 868 var l int 869 _ = l 870 if len(m.Path) > 0 { 871 i -= len(m.Path) 872 copy(dAtA[i:], m.Path) 873 i = encodeVarintHttp(dAtA, i, uint64(len(m.Path))) 874 i-- 875 dAtA[i] = 0x12 876 } 877 if len(m.Kind) > 0 { 878 i -= len(m.Kind) 879 copy(dAtA[i:], m.Kind) 880 i = encodeVarintHttp(dAtA, i, uint64(len(m.Kind))) 881 i-- 882 dAtA[i] = 0xa 883 } 884 return len(dAtA) - i, nil 885 } 886 887 func encodeVarintHttp(dAtA []byte, offset int, v uint64) int { 888 offset -= sovHttp(v) 889 base := offset 890 for v >= 1<<7 { 891 dAtA[offset] = uint8(v&0x7f | 0x80) 892 v >>= 7 893 offset++ 894 } 895 dAtA[offset] = uint8(v) 896 return base 897 } 898 func (m *Http) Size() (n int) { 899 if m == nil { 900 return 0 901 } 902 var l int 903 _ = l 904 if len(m.Rules) > 0 { 905 for _, e := range m.Rules { 906 l = e.Size() 907 n += 1 + l + sovHttp(uint64(l)) 908 } 909 } 910 if m.FullyDecodeReservedExpansion { 911 n += 2 912 } 913 return n 914 } 915 916 func (m *HttpRule) Size() (n int) { 917 if m == nil { 918 return 0 919 } 920 var l int 921 _ = l 922 l = len(m.Selector) 923 if l > 0 { 924 n += 1 + l + sovHttp(uint64(l)) 925 } 926 if m.Pattern != nil { 927 n += m.Pattern.Size() 928 } 929 l = len(m.Body) 930 if l > 0 { 931 n += 1 + l + sovHttp(uint64(l)) 932 } 933 if len(m.AdditionalBindings) > 0 { 934 for _, e := range m.AdditionalBindings { 935 l = e.Size() 936 n += 1 + l + sovHttp(uint64(l)) 937 } 938 } 939 l = len(m.ResponseBody) 940 if l > 0 { 941 n += 1 + l + sovHttp(uint64(l)) 942 } 943 return n 944 } 945 946 func (m *HttpRule_Get) Size() (n int) { 947 if m == nil { 948 return 0 949 } 950 var l int 951 _ = l 952 l = len(m.Get) 953 n += 1 + l + sovHttp(uint64(l)) 954 return n 955 } 956 func (m *HttpRule_Put) Size() (n int) { 957 if m == nil { 958 return 0 959 } 960 var l int 961 _ = l 962 l = len(m.Put) 963 n += 1 + l + sovHttp(uint64(l)) 964 return n 965 } 966 func (m *HttpRule_Post) Size() (n int) { 967 if m == nil { 968 return 0 969 } 970 var l int 971 _ = l 972 l = len(m.Post) 973 n += 1 + l + sovHttp(uint64(l)) 974 return n 975 } 976 func (m *HttpRule_Delete) Size() (n int) { 977 if m == nil { 978 return 0 979 } 980 var l int 981 _ = l 982 l = len(m.Delete) 983 n += 1 + l + sovHttp(uint64(l)) 984 return n 985 } 986 func (m *HttpRule_Patch) Size() (n int) { 987 if m == nil { 988 return 0 989 } 990 var l int 991 _ = l 992 l = len(m.Patch) 993 n += 1 + l + sovHttp(uint64(l)) 994 return n 995 } 996 func (m *HttpRule_Custom) Size() (n int) { 997 if m == nil { 998 return 0 999 } 1000 var l int 1001 _ = l 1002 if m.Custom != nil { 1003 l = m.Custom.Size() 1004 n += 1 + l + sovHttp(uint64(l)) 1005 } 1006 return n 1007 } 1008 func (m *CustomHttpPattern) Size() (n int) { 1009 if m == nil { 1010 return 0 1011 } 1012 var l int 1013 _ = l 1014 l = len(m.Kind) 1015 if l > 0 { 1016 n += 1 + l + sovHttp(uint64(l)) 1017 } 1018 l = len(m.Path) 1019 if l > 0 { 1020 n += 1 + l + sovHttp(uint64(l)) 1021 } 1022 return n 1023 } 1024 1025 func sovHttp(x uint64) (n int) { 1026 return (math_bits.Len64(x|1) + 6) / 7 1027 } 1028 func sozHttp(x uint64) (n int) { 1029 return sovHttp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1030 } 1031 func (m *Http) Unmarshal(dAtA []byte) error { 1032 l := len(dAtA) 1033 iNdEx := 0 1034 for iNdEx < l { 1035 preIndex := iNdEx 1036 var wire uint64 1037 for shift := uint(0); ; shift += 7 { 1038 if shift >= 64 { 1039 return ErrIntOverflowHttp 1040 } 1041 if iNdEx >= l { 1042 return io.ErrUnexpectedEOF 1043 } 1044 b := dAtA[iNdEx] 1045 iNdEx++ 1046 wire |= uint64(b&0x7F) << shift 1047 if b < 0x80 { 1048 break 1049 } 1050 } 1051 fieldNum := int32(wire >> 3) 1052 wireType := int(wire & 0x7) 1053 if wireType == 4 { 1054 return fmt.Errorf("proto: Http: wiretype end group for non-group") 1055 } 1056 if fieldNum <= 0 { 1057 return fmt.Errorf("proto: Http: illegal tag %d (wire type %d)", fieldNum, wire) 1058 } 1059 switch fieldNum { 1060 case 1: 1061 if wireType != 2 { 1062 return fmt.Errorf("proto: wrong wireType = %d for field Rules", wireType) 1063 } 1064 var msglen int 1065 for shift := uint(0); ; shift += 7 { 1066 if shift >= 64 { 1067 return ErrIntOverflowHttp 1068 } 1069 if iNdEx >= l { 1070 return io.ErrUnexpectedEOF 1071 } 1072 b := dAtA[iNdEx] 1073 iNdEx++ 1074 msglen |= int(b&0x7F) << shift 1075 if b < 0x80 { 1076 break 1077 } 1078 } 1079 if msglen < 0 { 1080 return ErrInvalidLengthHttp 1081 } 1082 postIndex := iNdEx + msglen 1083 if postIndex < 0 { 1084 return ErrInvalidLengthHttp 1085 } 1086 if postIndex > l { 1087 return io.ErrUnexpectedEOF 1088 } 1089 m.Rules = append(m.Rules, &HttpRule{}) 1090 if err := m.Rules[len(m.Rules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1091 return err 1092 } 1093 iNdEx = postIndex 1094 case 2: 1095 if wireType != 0 { 1096 return fmt.Errorf("proto: wrong wireType = %d for field FullyDecodeReservedExpansion", wireType) 1097 } 1098 var v int 1099 for shift := uint(0); ; shift += 7 { 1100 if shift >= 64 { 1101 return ErrIntOverflowHttp 1102 } 1103 if iNdEx >= l { 1104 return io.ErrUnexpectedEOF 1105 } 1106 b := dAtA[iNdEx] 1107 iNdEx++ 1108 v |= int(b&0x7F) << shift 1109 if b < 0x80 { 1110 break 1111 } 1112 } 1113 m.FullyDecodeReservedExpansion = bool(v != 0) 1114 default: 1115 iNdEx = preIndex 1116 skippy, err := skipHttp(dAtA[iNdEx:]) 1117 if err != nil { 1118 return err 1119 } 1120 if skippy < 0 { 1121 return ErrInvalidLengthHttp 1122 } 1123 if (iNdEx + skippy) < 0 { 1124 return ErrInvalidLengthHttp 1125 } 1126 if (iNdEx + skippy) > l { 1127 return io.ErrUnexpectedEOF 1128 } 1129 iNdEx += skippy 1130 } 1131 } 1132 1133 if iNdEx > l { 1134 return io.ErrUnexpectedEOF 1135 } 1136 return nil 1137 } 1138 func (m *HttpRule) Unmarshal(dAtA []byte) error { 1139 l := len(dAtA) 1140 iNdEx := 0 1141 for iNdEx < l { 1142 preIndex := iNdEx 1143 var wire uint64 1144 for shift := uint(0); ; shift += 7 { 1145 if shift >= 64 { 1146 return ErrIntOverflowHttp 1147 } 1148 if iNdEx >= l { 1149 return io.ErrUnexpectedEOF 1150 } 1151 b := dAtA[iNdEx] 1152 iNdEx++ 1153 wire |= uint64(b&0x7F) << shift 1154 if b < 0x80 { 1155 break 1156 } 1157 } 1158 fieldNum := int32(wire >> 3) 1159 wireType := int(wire & 0x7) 1160 if wireType == 4 { 1161 return fmt.Errorf("proto: HttpRule: wiretype end group for non-group") 1162 } 1163 if fieldNum <= 0 { 1164 return fmt.Errorf("proto: HttpRule: illegal tag %d (wire type %d)", fieldNum, wire) 1165 } 1166 switch fieldNum { 1167 case 1: 1168 if wireType != 2 { 1169 return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) 1170 } 1171 var stringLen uint64 1172 for shift := uint(0); ; shift += 7 { 1173 if shift >= 64 { 1174 return ErrIntOverflowHttp 1175 } 1176 if iNdEx >= l { 1177 return io.ErrUnexpectedEOF 1178 } 1179 b := dAtA[iNdEx] 1180 iNdEx++ 1181 stringLen |= uint64(b&0x7F) << shift 1182 if b < 0x80 { 1183 break 1184 } 1185 } 1186 intStringLen := int(stringLen) 1187 if intStringLen < 0 { 1188 return ErrInvalidLengthHttp 1189 } 1190 postIndex := iNdEx + intStringLen 1191 if postIndex < 0 { 1192 return ErrInvalidLengthHttp 1193 } 1194 if postIndex > l { 1195 return io.ErrUnexpectedEOF 1196 } 1197 m.Selector = string(dAtA[iNdEx:postIndex]) 1198 iNdEx = postIndex 1199 case 2: 1200 if wireType != 2 { 1201 return fmt.Errorf("proto: wrong wireType = %d for field Get", wireType) 1202 } 1203 var stringLen uint64 1204 for shift := uint(0); ; shift += 7 { 1205 if shift >= 64 { 1206 return ErrIntOverflowHttp 1207 } 1208 if iNdEx >= l { 1209 return io.ErrUnexpectedEOF 1210 } 1211 b := dAtA[iNdEx] 1212 iNdEx++ 1213 stringLen |= uint64(b&0x7F) << shift 1214 if b < 0x80 { 1215 break 1216 } 1217 } 1218 intStringLen := int(stringLen) 1219 if intStringLen < 0 { 1220 return ErrInvalidLengthHttp 1221 } 1222 postIndex := iNdEx + intStringLen 1223 if postIndex < 0 { 1224 return ErrInvalidLengthHttp 1225 } 1226 if postIndex > l { 1227 return io.ErrUnexpectedEOF 1228 } 1229 m.Pattern = &HttpRule_Get{string(dAtA[iNdEx:postIndex])} 1230 iNdEx = postIndex 1231 case 3: 1232 if wireType != 2 { 1233 return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType) 1234 } 1235 var stringLen uint64 1236 for shift := uint(0); ; shift += 7 { 1237 if shift >= 64 { 1238 return ErrIntOverflowHttp 1239 } 1240 if iNdEx >= l { 1241 return io.ErrUnexpectedEOF 1242 } 1243 b := dAtA[iNdEx] 1244 iNdEx++ 1245 stringLen |= uint64(b&0x7F) << shift 1246 if b < 0x80 { 1247 break 1248 } 1249 } 1250 intStringLen := int(stringLen) 1251 if intStringLen < 0 { 1252 return ErrInvalidLengthHttp 1253 } 1254 postIndex := iNdEx + intStringLen 1255 if postIndex < 0 { 1256 return ErrInvalidLengthHttp 1257 } 1258 if postIndex > l { 1259 return io.ErrUnexpectedEOF 1260 } 1261 m.Pattern = &HttpRule_Put{string(dAtA[iNdEx:postIndex])} 1262 iNdEx = postIndex 1263 case 4: 1264 if wireType != 2 { 1265 return fmt.Errorf("proto: wrong wireType = %d for field Post", wireType) 1266 } 1267 var stringLen uint64 1268 for shift := uint(0); ; shift += 7 { 1269 if shift >= 64 { 1270 return ErrIntOverflowHttp 1271 } 1272 if iNdEx >= l { 1273 return io.ErrUnexpectedEOF 1274 } 1275 b := dAtA[iNdEx] 1276 iNdEx++ 1277 stringLen |= uint64(b&0x7F) << shift 1278 if b < 0x80 { 1279 break 1280 } 1281 } 1282 intStringLen := int(stringLen) 1283 if intStringLen < 0 { 1284 return ErrInvalidLengthHttp 1285 } 1286 postIndex := iNdEx + intStringLen 1287 if postIndex < 0 { 1288 return ErrInvalidLengthHttp 1289 } 1290 if postIndex > l { 1291 return io.ErrUnexpectedEOF 1292 } 1293 m.Pattern = &HttpRule_Post{string(dAtA[iNdEx:postIndex])} 1294 iNdEx = postIndex 1295 case 5: 1296 if wireType != 2 { 1297 return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) 1298 } 1299 var stringLen uint64 1300 for shift := uint(0); ; shift += 7 { 1301 if shift >= 64 { 1302 return ErrIntOverflowHttp 1303 } 1304 if iNdEx >= l { 1305 return io.ErrUnexpectedEOF 1306 } 1307 b := dAtA[iNdEx] 1308 iNdEx++ 1309 stringLen |= uint64(b&0x7F) << shift 1310 if b < 0x80 { 1311 break 1312 } 1313 } 1314 intStringLen := int(stringLen) 1315 if intStringLen < 0 { 1316 return ErrInvalidLengthHttp 1317 } 1318 postIndex := iNdEx + intStringLen 1319 if postIndex < 0 { 1320 return ErrInvalidLengthHttp 1321 } 1322 if postIndex > l { 1323 return io.ErrUnexpectedEOF 1324 } 1325 m.Pattern = &HttpRule_Delete{string(dAtA[iNdEx:postIndex])} 1326 iNdEx = postIndex 1327 case 6: 1328 if wireType != 2 { 1329 return fmt.Errorf("proto: wrong wireType = %d for field Patch", wireType) 1330 } 1331 var stringLen uint64 1332 for shift := uint(0); ; shift += 7 { 1333 if shift >= 64 { 1334 return ErrIntOverflowHttp 1335 } 1336 if iNdEx >= l { 1337 return io.ErrUnexpectedEOF 1338 } 1339 b := dAtA[iNdEx] 1340 iNdEx++ 1341 stringLen |= uint64(b&0x7F) << shift 1342 if b < 0x80 { 1343 break 1344 } 1345 } 1346 intStringLen := int(stringLen) 1347 if intStringLen < 0 { 1348 return ErrInvalidLengthHttp 1349 } 1350 postIndex := iNdEx + intStringLen 1351 if postIndex < 0 { 1352 return ErrInvalidLengthHttp 1353 } 1354 if postIndex > l { 1355 return io.ErrUnexpectedEOF 1356 } 1357 m.Pattern = &HttpRule_Patch{string(dAtA[iNdEx:postIndex])} 1358 iNdEx = postIndex 1359 case 7: 1360 if wireType != 2 { 1361 return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) 1362 } 1363 var stringLen uint64 1364 for shift := uint(0); ; shift += 7 { 1365 if shift >= 64 { 1366 return ErrIntOverflowHttp 1367 } 1368 if iNdEx >= l { 1369 return io.ErrUnexpectedEOF 1370 } 1371 b := dAtA[iNdEx] 1372 iNdEx++ 1373 stringLen |= uint64(b&0x7F) << shift 1374 if b < 0x80 { 1375 break 1376 } 1377 } 1378 intStringLen := int(stringLen) 1379 if intStringLen < 0 { 1380 return ErrInvalidLengthHttp 1381 } 1382 postIndex := iNdEx + intStringLen 1383 if postIndex < 0 { 1384 return ErrInvalidLengthHttp 1385 } 1386 if postIndex > l { 1387 return io.ErrUnexpectedEOF 1388 } 1389 m.Body = string(dAtA[iNdEx:postIndex]) 1390 iNdEx = postIndex 1391 case 8: 1392 if wireType != 2 { 1393 return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) 1394 } 1395 var msglen int 1396 for shift := uint(0); ; shift += 7 { 1397 if shift >= 64 { 1398 return ErrIntOverflowHttp 1399 } 1400 if iNdEx >= l { 1401 return io.ErrUnexpectedEOF 1402 } 1403 b := dAtA[iNdEx] 1404 iNdEx++ 1405 msglen |= int(b&0x7F) << shift 1406 if b < 0x80 { 1407 break 1408 } 1409 } 1410 if msglen < 0 { 1411 return ErrInvalidLengthHttp 1412 } 1413 postIndex := iNdEx + msglen 1414 if postIndex < 0 { 1415 return ErrInvalidLengthHttp 1416 } 1417 if postIndex > l { 1418 return io.ErrUnexpectedEOF 1419 } 1420 v := &CustomHttpPattern{} 1421 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1422 return err 1423 } 1424 m.Pattern = &HttpRule_Custom{v} 1425 iNdEx = postIndex 1426 case 11: 1427 if wireType != 2 { 1428 return fmt.Errorf("proto: wrong wireType = %d for field AdditionalBindings", wireType) 1429 } 1430 var msglen int 1431 for shift := uint(0); ; shift += 7 { 1432 if shift >= 64 { 1433 return ErrIntOverflowHttp 1434 } 1435 if iNdEx >= l { 1436 return io.ErrUnexpectedEOF 1437 } 1438 b := dAtA[iNdEx] 1439 iNdEx++ 1440 msglen |= int(b&0x7F) << shift 1441 if b < 0x80 { 1442 break 1443 } 1444 } 1445 if msglen < 0 { 1446 return ErrInvalidLengthHttp 1447 } 1448 postIndex := iNdEx + msglen 1449 if postIndex < 0 { 1450 return ErrInvalidLengthHttp 1451 } 1452 if postIndex > l { 1453 return io.ErrUnexpectedEOF 1454 } 1455 m.AdditionalBindings = append(m.AdditionalBindings, &HttpRule{}) 1456 if err := m.AdditionalBindings[len(m.AdditionalBindings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1457 return err 1458 } 1459 iNdEx = postIndex 1460 case 12: 1461 if wireType != 2 { 1462 return fmt.Errorf("proto: wrong wireType = %d for field ResponseBody", wireType) 1463 } 1464 var stringLen uint64 1465 for shift := uint(0); ; shift += 7 { 1466 if shift >= 64 { 1467 return ErrIntOverflowHttp 1468 } 1469 if iNdEx >= l { 1470 return io.ErrUnexpectedEOF 1471 } 1472 b := dAtA[iNdEx] 1473 iNdEx++ 1474 stringLen |= uint64(b&0x7F) << shift 1475 if b < 0x80 { 1476 break 1477 } 1478 } 1479 intStringLen := int(stringLen) 1480 if intStringLen < 0 { 1481 return ErrInvalidLengthHttp 1482 } 1483 postIndex := iNdEx + intStringLen 1484 if postIndex < 0 { 1485 return ErrInvalidLengthHttp 1486 } 1487 if postIndex > l { 1488 return io.ErrUnexpectedEOF 1489 } 1490 m.ResponseBody = string(dAtA[iNdEx:postIndex]) 1491 iNdEx = postIndex 1492 default: 1493 iNdEx = preIndex 1494 skippy, err := skipHttp(dAtA[iNdEx:]) 1495 if err != nil { 1496 return err 1497 } 1498 if skippy < 0 { 1499 return ErrInvalidLengthHttp 1500 } 1501 if (iNdEx + skippy) < 0 { 1502 return ErrInvalidLengthHttp 1503 } 1504 if (iNdEx + skippy) > l { 1505 return io.ErrUnexpectedEOF 1506 } 1507 iNdEx += skippy 1508 } 1509 } 1510 1511 if iNdEx > l { 1512 return io.ErrUnexpectedEOF 1513 } 1514 return nil 1515 } 1516 func (m *CustomHttpPattern) Unmarshal(dAtA []byte) error { 1517 l := len(dAtA) 1518 iNdEx := 0 1519 for iNdEx < l { 1520 preIndex := iNdEx 1521 var wire uint64 1522 for shift := uint(0); ; shift += 7 { 1523 if shift >= 64 { 1524 return ErrIntOverflowHttp 1525 } 1526 if iNdEx >= l { 1527 return io.ErrUnexpectedEOF 1528 } 1529 b := dAtA[iNdEx] 1530 iNdEx++ 1531 wire |= uint64(b&0x7F) << shift 1532 if b < 0x80 { 1533 break 1534 } 1535 } 1536 fieldNum := int32(wire >> 3) 1537 wireType := int(wire & 0x7) 1538 if wireType == 4 { 1539 return fmt.Errorf("proto: CustomHttpPattern: wiretype end group for non-group") 1540 } 1541 if fieldNum <= 0 { 1542 return fmt.Errorf("proto: CustomHttpPattern: illegal tag %d (wire type %d)", fieldNum, wire) 1543 } 1544 switch fieldNum { 1545 case 1: 1546 if wireType != 2 { 1547 return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) 1548 } 1549 var stringLen uint64 1550 for shift := uint(0); ; shift += 7 { 1551 if shift >= 64 { 1552 return ErrIntOverflowHttp 1553 } 1554 if iNdEx >= l { 1555 return io.ErrUnexpectedEOF 1556 } 1557 b := dAtA[iNdEx] 1558 iNdEx++ 1559 stringLen |= uint64(b&0x7F) << shift 1560 if b < 0x80 { 1561 break 1562 } 1563 } 1564 intStringLen := int(stringLen) 1565 if intStringLen < 0 { 1566 return ErrInvalidLengthHttp 1567 } 1568 postIndex := iNdEx + intStringLen 1569 if postIndex < 0 { 1570 return ErrInvalidLengthHttp 1571 } 1572 if postIndex > l { 1573 return io.ErrUnexpectedEOF 1574 } 1575 m.Kind = string(dAtA[iNdEx:postIndex]) 1576 iNdEx = postIndex 1577 case 2: 1578 if wireType != 2 { 1579 return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) 1580 } 1581 var stringLen uint64 1582 for shift := uint(0); ; shift += 7 { 1583 if shift >= 64 { 1584 return ErrIntOverflowHttp 1585 } 1586 if iNdEx >= l { 1587 return io.ErrUnexpectedEOF 1588 } 1589 b := dAtA[iNdEx] 1590 iNdEx++ 1591 stringLen |= uint64(b&0x7F) << shift 1592 if b < 0x80 { 1593 break 1594 } 1595 } 1596 intStringLen := int(stringLen) 1597 if intStringLen < 0 { 1598 return ErrInvalidLengthHttp 1599 } 1600 postIndex := iNdEx + intStringLen 1601 if postIndex < 0 { 1602 return ErrInvalidLengthHttp 1603 } 1604 if postIndex > l { 1605 return io.ErrUnexpectedEOF 1606 } 1607 m.Path = string(dAtA[iNdEx:postIndex]) 1608 iNdEx = postIndex 1609 default: 1610 iNdEx = preIndex 1611 skippy, err := skipHttp(dAtA[iNdEx:]) 1612 if err != nil { 1613 return err 1614 } 1615 if skippy < 0 { 1616 return ErrInvalidLengthHttp 1617 } 1618 if (iNdEx + skippy) < 0 { 1619 return ErrInvalidLengthHttp 1620 } 1621 if (iNdEx + skippy) > l { 1622 return io.ErrUnexpectedEOF 1623 } 1624 iNdEx += skippy 1625 } 1626 } 1627 1628 if iNdEx > l { 1629 return io.ErrUnexpectedEOF 1630 } 1631 return nil 1632 } 1633 func skipHttp(dAtA []byte) (n int, err error) { 1634 l := len(dAtA) 1635 iNdEx := 0 1636 depth := 0 1637 for iNdEx < l { 1638 var wire uint64 1639 for shift := uint(0); ; shift += 7 { 1640 if shift >= 64 { 1641 return 0, ErrIntOverflowHttp 1642 } 1643 if iNdEx >= l { 1644 return 0, io.ErrUnexpectedEOF 1645 } 1646 b := dAtA[iNdEx] 1647 iNdEx++ 1648 wire |= (uint64(b) & 0x7F) << shift 1649 if b < 0x80 { 1650 break 1651 } 1652 } 1653 wireType := int(wire & 0x7) 1654 switch wireType { 1655 case 0: 1656 for shift := uint(0); ; shift += 7 { 1657 if shift >= 64 { 1658 return 0, ErrIntOverflowHttp 1659 } 1660 if iNdEx >= l { 1661 return 0, io.ErrUnexpectedEOF 1662 } 1663 iNdEx++ 1664 if dAtA[iNdEx-1] < 0x80 { 1665 break 1666 } 1667 } 1668 case 1: 1669 iNdEx += 8 1670 case 2: 1671 var length int 1672 for shift := uint(0); ; shift += 7 { 1673 if shift >= 64 { 1674 return 0, ErrIntOverflowHttp 1675 } 1676 if iNdEx >= l { 1677 return 0, io.ErrUnexpectedEOF 1678 } 1679 b := dAtA[iNdEx] 1680 iNdEx++ 1681 length |= (int(b) & 0x7F) << shift 1682 if b < 0x80 { 1683 break 1684 } 1685 } 1686 if length < 0 { 1687 return 0, ErrInvalidLengthHttp 1688 } 1689 iNdEx += length 1690 case 3: 1691 depth++ 1692 case 4: 1693 if depth == 0 { 1694 return 0, ErrUnexpectedEndOfGroupHttp 1695 } 1696 depth-- 1697 case 5: 1698 iNdEx += 4 1699 default: 1700 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 1701 } 1702 if iNdEx < 0 { 1703 return 0, ErrInvalidLengthHttp 1704 } 1705 if depth == 0 { 1706 return iNdEx, nil 1707 } 1708 } 1709 return 0, io.ErrUnexpectedEOF 1710 } 1711 1712 var ( 1713 ErrInvalidLengthHttp = fmt.Errorf("proto: negative length found during unmarshaling") 1714 ErrIntOverflowHttp = fmt.Errorf("proto: integer overflow") 1715 ErrUnexpectedEndOfGroupHttp = fmt.Errorf("proto: unexpected end of group") 1716 )