1// Code generated by protoc-gen-gogo. DO NOT EDIT. 2// source: google/protobuf/api.proto 3 4package types 5 6import ( 7 bytes "bytes" 8 fmt "fmt" 9 proto "github.com/gogo/protobuf/proto" 10 io "io" 11 math "math" 12 math_bits "math/bits" 13 reflect "reflect" 14 strings "strings" 15) 16 17// Reference imports to suppress errors if they are not otherwise used. 18var _ = proto.Marshal 19var _ = fmt.Errorf 20var _ = math.Inf 21 22// This is a compile-time assertion to ensure that this generated file 23// is compatible with the proto package it is being compiled against. 24// A compilation error at this line likely means your copy of the 25// proto package needs to be updated. 26const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 27 28// Api is a light-weight descriptor for an API Interface. 29// 30// Interfaces are also described as "protocol buffer services" in some contexts, 31// such as by the "service" keyword in a .proto file, but they are different 32// from API Services, which represent a concrete implementation of an interface 33// as opposed to simply a description of methods and bindings. They are also 34// sometimes simply referred to as "APIs" in other contexts, such as the name of 35// this message itself. See https://cloud.google.com/apis/design/glossary for 36// detailed terminology. 37type Api struct { 38 // The fully qualified name of this interface, including package name 39 // followed by the interface's simple name. 40 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 41 // The methods of this interface, in unspecified order. 42 Methods []*Method `protobuf:"bytes,2,rep,name=methods,proto3" json:"methods,omitempty"` 43 // Any metadata attached to the interface. 44 Options []*Option `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` 45 // A version string for this interface. If specified, must have the form 46 // `major-version.minor-version`, as in `1.10`. If the minor version is 47 // omitted, it defaults to zero. If the entire version field is empty, the 48 // major version is derived from the package name, as outlined below. If the 49 // field is not empty, the version in the package name will be verified to be 50 // consistent with what is provided here. 51 // 52 // The versioning schema uses [semantic 53 // versioning](http://semver.org) where the major version number 54 // indicates a breaking change and the minor version an additive, 55 // non-breaking change. Both version numbers are signals to users 56 // what to expect from different versions, and should be carefully 57 // chosen based on the product plan. 58 // 59 // The major version is also reflected in the package name of the 60 // interface, which must end in `v<major-version>`, as in 61 // `google.feature.v1`. For major versions 0 and 1, the suffix can 62 // be omitted. Zero major versions must only be used for 63 // experimental, non-GA interfaces. 64 // 65 // 66 Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` 67 // Source context for the protocol buffer service represented by this 68 // message. 69 SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext,proto3" json:"source_context,omitempty"` 70 // Included interfaces. See [Mixin][]. 71 Mixins []*Mixin `protobuf:"bytes,6,rep,name=mixins,proto3" json:"mixins,omitempty"` 72 // The source syntax of the service. 73 Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` 74 XXX_NoUnkeyedLiteral struct{} `json:"-"` 75 XXX_unrecognized []byte `json:"-"` 76 XXX_sizecache int32 `json:"-"` 77} 78 79func (m *Api) Reset() { *m = Api{} } 80func (*Api) ProtoMessage() {} 81func (*Api) Descriptor() ([]byte, []int) { 82 return fileDescriptor_a2ec32096296c143, []int{0} 83} 84func (m *Api) XXX_Unmarshal(b []byte) error { 85 return m.Unmarshal(b) 86} 87func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 88 if deterministic { 89 return xxx_messageInfo_Api.Marshal(b, m, deterministic) 90 } else { 91 b = b[:cap(b)] 92 n, err := m.MarshalToSizedBuffer(b) 93 if err != nil { 94 return nil, err 95 } 96 return b[:n], nil 97 } 98} 99func (m *Api) XXX_Merge(src proto.Message) { 100 xxx_messageInfo_Api.Merge(m, src) 101} 102func (m *Api) XXX_Size() int { 103 return m.Size() 104} 105func (m *Api) XXX_DiscardUnknown() { 106 xxx_messageInfo_Api.DiscardUnknown(m) 107} 108 109var xxx_messageInfo_Api proto.InternalMessageInfo 110 111func (m *Api) GetName() string { 112 if m != nil { 113 return m.Name 114 } 115 return "" 116} 117 118func (m *Api) GetMethods() []*Method { 119 if m != nil { 120 return m.Methods 121 } 122 return nil 123} 124 125func (m *Api) GetOptions() []*Option { 126 if m != nil { 127 return m.Options 128 } 129 return nil 130} 131 132func (m *Api) GetVersion() string { 133 if m != nil { 134 return m.Version 135 } 136 return "" 137} 138 139func (m *Api) GetSourceContext() *SourceContext { 140 if m != nil { 141 return m.SourceContext 142 } 143 return nil 144} 145 146func (m *Api) GetMixins() []*Mixin { 147 if m != nil { 148 return m.Mixins 149 } 150 return nil 151} 152 153func (m *Api) GetSyntax() Syntax { 154 if m != nil { 155 return m.Syntax 156 } 157 return Syntax_SYNTAX_PROTO2 158} 159 160func (*Api) XXX_MessageName() string { 161 return "google.protobuf.Api" 162} 163 164// Method represents a method of an API interface. 165type Method struct { 166 // The simple name of this method. 167 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 168 // A URL of the input message type. 169 RequestTypeUrl string `protobuf:"bytes,2,opt,name=request_type_url,json=requestTypeUrl,proto3" json:"request_type_url,omitempty"` 170 // If true, the request is streamed. 171 RequestStreaming bool `protobuf:"varint,3,opt,name=request_streaming,json=requestStreaming,proto3" json:"request_streaming,omitempty"` 172 // The URL of the output message type. 173 ResponseTypeUrl string `protobuf:"bytes,4,opt,name=response_type_url,json=responseTypeUrl,proto3" json:"response_type_url,omitempty"` 174 // If true, the response is streamed. 175 ResponseStreaming bool `protobuf:"varint,5,opt,name=response_streaming,json=responseStreaming,proto3" json:"response_streaming,omitempty"` 176 // Any metadata attached to the method. 177 Options []*Option `protobuf:"bytes,6,rep,name=options,proto3" json:"options,omitempty"` 178 // The source syntax of this method. 179 Syntax Syntax `protobuf:"varint,7,opt,name=syntax,proto3,enum=google.protobuf.Syntax" json:"syntax,omitempty"` 180 XXX_NoUnkeyedLiteral struct{} `json:"-"` 181 XXX_unrecognized []byte `json:"-"` 182 XXX_sizecache int32 `json:"-"` 183} 184 185func (m *Method) Reset() { *m = Method{} } 186func (*Method) ProtoMessage() {} 187func (*Method) Descriptor() ([]byte, []int) { 188 return fileDescriptor_a2ec32096296c143, []int{1} 189} 190func (m *Method) XXX_Unmarshal(b []byte) error { 191 return m.Unmarshal(b) 192} 193func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 194 if deterministic { 195 return xxx_messageInfo_Method.Marshal(b, m, deterministic) 196 } else { 197 b = b[:cap(b)] 198 n, err := m.MarshalToSizedBuffer(b) 199 if err != nil { 200 return nil, err 201 } 202 return b[:n], nil 203 } 204} 205func (m *Method) XXX_Merge(src proto.Message) { 206 xxx_messageInfo_Method.Merge(m, src) 207} 208func (m *Method) XXX_Size() int { 209 return m.Size() 210} 211func (m *Method) XXX_DiscardUnknown() { 212 xxx_messageInfo_Method.DiscardUnknown(m) 213} 214 215var xxx_messageInfo_Method proto.InternalMessageInfo 216 217func (m *Method) GetName() string { 218 if m != nil { 219 return m.Name 220 } 221 return "" 222} 223 224func (m *Method) GetRequestTypeUrl() string { 225 if m != nil { 226 return m.RequestTypeUrl 227 } 228 return "" 229} 230 231func (m *Method) GetRequestStreaming() bool { 232 if m != nil { 233 return m.RequestStreaming 234 } 235 return false 236} 237 238func (m *Method) GetResponseTypeUrl() string { 239 if m != nil { 240 return m.ResponseTypeUrl 241 } 242 return "" 243} 244 245func (m *Method) GetResponseStreaming() bool { 246 if m != nil { 247 return m.ResponseStreaming 248 } 249 return false 250} 251 252func (m *Method) GetOptions() []*Option { 253 if m != nil { 254 return m.Options 255 } 256 return nil 257} 258 259func (m *Method) GetSyntax() Syntax { 260 if m != nil { 261 return m.Syntax 262 } 263 return Syntax_SYNTAX_PROTO2 264} 265 266func (*Method) XXX_MessageName() string { 267 return "google.protobuf.Method" 268} 269 270// Declares an API Interface to be included in this interface. The including 271// interface must redeclare all the methods from the included interface, but 272// documentation and options are inherited as follows: 273// 274// - If after comment and whitespace stripping, the documentation 275// string of the redeclared method is empty, it will be inherited 276// from the original method. 277// 278// - Each annotation belonging to the service config (http, 279// visibility) which is not set in the redeclared method will be 280// inherited. 281// 282// - If an http annotation is inherited, the path pattern will be 283// modified as follows. Any version prefix will be replaced by the 284// version of the including interface plus the [root][] path if 285// specified. 286// 287// Example of a simple mixin: 288// 289// package google.acl.v1; 290// service AccessControl { 291// // Get the underlying ACL object. 292// rpc GetAcl(GetAclRequest) returns (Acl) { 293// option (google.api.http).get = "/v1/{resource=**}:getAcl"; 294// } 295// } 296// 297// package google.storage.v2; 298// service Storage { 299// rpc GetAcl(GetAclRequest) returns (Acl); 300// 301// // Get a data record. 302// rpc GetData(GetDataRequest) returns (Data) { 303// option (google.api.http).get = "/v2/{resource=**}"; 304// } 305// } 306// 307// Example of a mixin configuration: 308// 309// apis: 310// - name: google.storage.v2.Storage 311// mixins: 312// - name: google.acl.v1.AccessControl 313// 314// The mixin construct implies that all methods in `AccessControl` are 315// also declared with same name and request/response types in 316// `Storage`. A documentation generator or annotation processor will 317// see the effective `Storage.GetAcl` method after inherting 318// documentation and annotations as follows: 319// 320// service Storage { 321// // Get the underlying ACL object. 322// rpc GetAcl(GetAclRequest) returns (Acl) { 323// option (google.api.http).get = "/v2/{resource=**}:getAcl"; 324// } 325// ... 326// } 327// 328// Note how the version in the path pattern changed from `v1` to `v2`. 329// 330// If the `root` field in the mixin is specified, it should be a 331// relative path under which inherited HTTP paths are placed. Example: 332// 333// apis: 334// - name: google.storage.v2.Storage 335// mixins: 336// - name: google.acl.v1.AccessControl 337// root: acls 338// 339// This implies the following inherited HTTP annotation: 340// 341// service Storage { 342// // Get the underlying ACL object. 343// rpc GetAcl(GetAclRequest) returns (Acl) { 344// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; 345// } 346// ... 347// } 348type Mixin struct { 349 // The fully qualified name of the interface which is included. 350 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 351 // If non-empty specifies a path under which inherited HTTP paths 352 // are rooted. 353 Root string `protobuf:"bytes,2,opt,name=root,proto3" json:"root,omitempty"` 354 XXX_NoUnkeyedLiteral struct{} `json:"-"` 355 XXX_unrecognized []byte `json:"-"` 356 XXX_sizecache int32 `json:"-"` 357} 358 359func (m *Mixin) Reset() { *m = Mixin{} } 360func (*Mixin) ProtoMessage() {} 361func (*Mixin) Descriptor() ([]byte, []int) { 362 return fileDescriptor_a2ec32096296c143, []int{2} 363} 364func (m *Mixin) XXX_Unmarshal(b []byte) error { 365 return m.Unmarshal(b) 366} 367func (m *Mixin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 368 if deterministic { 369 return xxx_messageInfo_Mixin.Marshal(b, m, deterministic) 370 } else { 371 b = b[:cap(b)] 372 n, err := m.MarshalToSizedBuffer(b) 373 if err != nil { 374 return nil, err 375 } 376 return b[:n], nil 377 } 378} 379func (m *Mixin) XXX_Merge(src proto.Message) { 380 xxx_messageInfo_Mixin.Merge(m, src) 381} 382func (m *Mixin) XXX_Size() int { 383 return m.Size() 384} 385func (m *Mixin) XXX_DiscardUnknown() { 386 xxx_messageInfo_Mixin.DiscardUnknown(m) 387} 388 389var xxx_messageInfo_Mixin proto.InternalMessageInfo 390 391func (m *Mixin) GetName() string { 392 if m != nil { 393 return m.Name 394 } 395 return "" 396} 397 398func (m *Mixin) GetRoot() string { 399 if m != nil { 400 return m.Root 401 } 402 return "" 403} 404 405func (*Mixin) XXX_MessageName() string { 406 return "google.protobuf.Mixin" 407} 408func init() { 409 proto.RegisterType((*Api)(nil), "google.protobuf.Api") 410 proto.RegisterType((*Method)(nil), "google.protobuf.Method") 411 proto.RegisterType((*Mixin)(nil), "google.protobuf.Mixin") 412} 413 414func init() { proto.RegisterFile("google/protobuf/api.proto", fileDescriptor_a2ec32096296c143) } 415 416var fileDescriptor_a2ec32096296c143 = []byte{ 417 // 467 bytes of a gzipped FileDescriptorProto 418 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x31, 0x6f, 0x13, 0x31, 419 0x14, 0xc7, 0xeb, 0xbb, 0xe4, 0x52, 0x5c, 0x91, 0x82, 0x91, 0xc0, 0x64, 0xb0, 0x4e, 0x15, 0xc3, 420 0x09, 0xc4, 0x45, 0x94, 0x4f, 0xd0, 0x20, 0xd4, 0x01, 0x21, 0xa2, 0x0b, 0x08, 0x89, 0x25, 0x4a, 421 0x83, 0x09, 0x96, 0xee, 0x6c, 0x63, 0x3b, 0x90, 0x4c, 0xf0, 0x59, 0x98, 0x10, 0x23, 0xdf, 0x80, 422 0xad, 0x23, 0x23, 0x23, 0xb9, 0x2e, 0x8c, 0x1d, 0x19, 0x91, 0x7d, 0xe7, 0xa6, 0x5c, 0x83, 0x04, 423 0x9b, 0xdf, 0xfb, 0xff, 0xfc, 0xf7, 0x7b, 0x7f, 0xc3, 0x9b, 0x33, 0x21, 0x66, 0x39, 0xed, 0x4b, 424 0x25, 0x8c, 0x38, 0x9a, 0xbf, 0xea, 0x4f, 0x24, 0x4b, 0x5d, 0x81, 0x76, 0x2b, 0x29, 0xf5, 0x52, 425 0xef, 0x56, 0x93, 0xd5, 0x62, 0xae, 0xa6, 0x74, 0x3c, 0x15, 0xdc, 0xd0, 0x85, 0xa9, 0xc0, 0x5e, 426 0xaf, 0x49, 0x99, 0xa5, 0xac, 0x4d, 0xf6, 0xbe, 0x06, 0x30, 0x3c, 0x90, 0x0c, 0x21, 0xd8, 0xe2, 427 0x93, 0x82, 0x62, 0x10, 0x83, 0xe4, 0x52, 0xe6, 0xce, 0xe8, 0x1e, 0xec, 0x14, 0xd4, 0xbc, 0x16, 428 0x2f, 0x35, 0x0e, 0xe2, 0x30, 0xd9, 0xd9, 0xbf, 0x91, 0x36, 0x06, 0x48, 0x1f, 0x3b, 0x3d, 0xf3, 429 0x9c, 0xbd, 0x22, 0xa4, 0x61, 0x82, 0x6b, 0x1c, 0xfe, 0xe5, 0xca, 0x13, 0xa7, 0x67, 0x9e, 0x43, 430 0x18, 0x76, 0xde, 0x52, 0xa5, 0x99, 0xe0, 0xb8, 0xe5, 0x1e, 0xf7, 0x25, 0x7a, 0x08, 0xbb, 0x7f, 431 0xee, 0x83, 0xdb, 0x31, 0x48, 0x76, 0xf6, 0xc9, 0x05, 0xcf, 0x91, 0xc3, 0x1e, 0x54, 0x54, 0x76, 432 0x59, 0x9f, 0x2f, 0x51, 0x0a, 0xa3, 0x82, 0x2d, 0x18, 0xd7, 0x38, 0x72, 0x23, 0x5d, 0xbf, 0xb8, 433 0x85, 0x95, 0xb3, 0x9a, 0x42, 0x7d, 0x18, 0xe9, 0x25, 0x37, 0x93, 0x05, 0xee, 0xc4, 0x20, 0xe9, 434 0x6e, 0x58, 0x61, 0xe4, 0xe4, 0xac, 0xc6, 0xf6, 0xbe, 0x04, 0x30, 0xaa, 0x82, 0xd8, 0x18, 0x63, 435 0x02, 0xaf, 0x28, 0xfa, 0x66, 0x4e, 0xb5, 0x19, 0xdb, 0xe0, 0xc7, 0x73, 0x95, 0xe3, 0xc0, 0xe9, 436 0xdd, 0xba, 0xff, 0x74, 0x29, 0xe9, 0x33, 0x95, 0xa3, 0x3b, 0xf0, 0xaa, 0x27, 0xb5, 0x51, 0x74, 437 0x52, 0x30, 0x3e, 0xc3, 0x61, 0x0c, 0x92, 0xed, 0xcc, 0x5b, 0x8c, 0x7c, 0x1f, 0xdd, 0xb6, 0xb0, 438 0x96, 0x82, 0x6b, 0xba, 0xf6, 0xad, 0x12, 0xdc, 0xf5, 0x82, 0x37, 0xbe, 0x0b, 0xd1, 0x19, 0xbb, 439 0x76, 0x6e, 0x3b, 0xe7, 0x33, 0x97, 0xb5, 0xf5, 0xb9, 0x5f, 0x8c, 0xfe, 0xf1, 0x17, 0xff, 0x3b, 440 0xb4, 0x3e, 0x6c, 0xbb, 0xd8, 0x37, 0x46, 0x86, 0x60, 0x4b, 0x09, 0x61, 0xea, 0x98, 0xdc, 0x79, 441 0xf0, 0xfe, 0xfb, 0x8a, 0x6c, 0x9d, 0xae, 0x08, 0xf8, 0xb5, 0x22, 0xe0, 0x43, 0x49, 0xc0, 0xa7, 442 0x92, 0x80, 0xe3, 0x92, 0x80, 0x6f, 0x25, 0x01, 0x3f, 0x4a, 0x02, 0x7e, 0x96, 0x64, 0xeb, 0xd4, 443 0xf6, 0x4f, 0x08, 0x38, 0x3e, 0x21, 0x00, 0x5e, 0x9b, 0x8a, 0xa2, 0x39, 0xc6, 0x60, 0xfb, 0x40, 444 0xb2, 0xa1, 0x2d, 0x86, 0xe0, 0x45, 0xdb, 0xe6, 0xa6, 0x3f, 0x06, 0xe1, 0xe1, 0x70, 0xf0, 0x39, 445 0x20, 0x87, 0x15, 0x3a, 0xf4, 0x13, 0x3f, 0xa7, 0x79, 0xfe, 0x88, 0x8b, 0x77, 0xdc, 0xc6, 0xa8, 446 0x8f, 0x22, 0xe7, 0x71, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x64, 0x40, 0x40, 0xa1, 447 0x03, 0x00, 0x00, 448} 449 450func (this *Api) Compare(that interface{}) int { 451 if that == nil { 452 if this == nil { 453 return 0 454 } 455 return 1 456 } 457 458 that1, ok := that.(*Api) 459 if !ok { 460 that2, ok := that.(Api) 461 if ok { 462 that1 = &that2 463 } else { 464 return 1 465 } 466 } 467 if that1 == nil { 468 if this == nil { 469 return 0 470 } 471 return 1 472 } else if this == nil { 473 return -1 474 } 475 if this.Name != that1.Name { 476 if this.Name < that1.Name { 477 return -1 478 } 479 return 1 480 } 481 if len(this.Methods) != len(that1.Methods) { 482 if len(this.Methods) < len(that1.Methods) { 483 return -1 484 } 485 return 1 486 } 487 for i := range this.Methods { 488 if c := this.Methods[i].Compare(that1.Methods[i]); c != 0 { 489 return c 490 } 491 } 492 if len(this.Options) != len(that1.Options) { 493 if len(this.Options) < len(that1.Options) { 494 return -1 495 } 496 return 1 497 } 498 for i := range this.Options { 499 if c := this.Options[i].Compare(that1.Options[i]); c != 0 { 500 return c 501 } 502 } 503 if this.Version != that1.Version { 504 if this.Version < that1.Version { 505 return -1 506 } 507 return 1 508 } 509 if c := this.SourceContext.Compare(that1.SourceContext); c != 0 { 510 return c 511 } 512 if len(this.Mixins) != len(that1.Mixins) { 513 if len(this.Mixins) < len(that1.Mixins) { 514 return -1 515 } 516 return 1 517 } 518 for i := range this.Mixins { 519 if c := this.Mixins[i].Compare(that1.Mixins[i]); c != 0 { 520 return c 521 } 522 } 523 if this.Syntax != that1.Syntax { 524 if this.Syntax < that1.Syntax { 525 return -1 526 } 527 return 1 528 } 529 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 530 return c 531 } 532 return 0 533} 534func (this *Method) Compare(that interface{}) int { 535 if that == nil { 536 if this == nil { 537 return 0 538 } 539 return 1 540 } 541 542 that1, ok := that.(*Method) 543 if !ok { 544 that2, ok := that.(Method) 545 if ok { 546 that1 = &that2 547 } else { 548 return 1 549 } 550 } 551 if that1 == nil { 552 if this == nil { 553 return 0 554 } 555 return 1 556 } else if this == nil { 557 return -1 558 } 559 if this.Name != that1.Name { 560 if this.Name < that1.Name { 561 return -1 562 } 563 return 1 564 } 565 if this.RequestTypeUrl != that1.RequestTypeUrl { 566 if this.RequestTypeUrl < that1.RequestTypeUrl { 567 return -1 568 } 569 return 1 570 } 571 if this.RequestStreaming != that1.RequestStreaming { 572 if !this.RequestStreaming { 573 return -1 574 } 575 return 1 576 } 577 if this.ResponseTypeUrl != that1.ResponseTypeUrl { 578 if this.ResponseTypeUrl < that1.ResponseTypeUrl { 579 return -1 580 } 581 return 1 582 } 583 if this.ResponseStreaming != that1.ResponseStreaming { 584 if !this.ResponseStreaming { 585 return -1 586 } 587 return 1 588 } 589 if len(this.Options) != len(that1.Options) { 590 if len(this.Options) < len(that1.Options) { 591 return -1 592 } 593 return 1 594 } 595 for i := range this.Options { 596 if c := this.Options[i].Compare(that1.Options[i]); c != 0 { 597 return c 598 } 599 } 600 if this.Syntax != that1.Syntax { 601 if this.Syntax < that1.Syntax { 602 return -1 603 } 604 return 1 605 } 606 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 607 return c 608 } 609 return 0 610} 611func (this *Mixin) Compare(that interface{}) int { 612 if that == nil { 613 if this == nil { 614 return 0 615 } 616 return 1 617 } 618 619 that1, ok := that.(*Mixin) 620 if !ok { 621 that2, ok := that.(Mixin) 622 if ok { 623 that1 = &that2 624 } else { 625 return 1 626 } 627 } 628 if that1 == nil { 629 if this == nil { 630 return 0 631 } 632 return 1 633 } else if this == nil { 634 return -1 635 } 636 if this.Name != that1.Name { 637 if this.Name < that1.Name { 638 return -1 639 } 640 return 1 641 } 642 if this.Root != that1.Root { 643 if this.Root < that1.Root { 644 return -1 645 } 646 return 1 647 } 648 if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { 649 return c 650 } 651 return 0 652} 653func (this *Api) Equal(that interface{}) bool { 654 if that == nil { 655 return this == nil 656 } 657 658 that1, ok := that.(*Api) 659 if !ok { 660 that2, ok := that.(Api) 661 if ok { 662 that1 = &that2 663 } else { 664 return false 665 } 666 } 667 if that1 == nil { 668 return this == nil 669 } else if this == nil { 670 return false 671 } 672 if this.Name != that1.Name { 673 return false 674 } 675 if len(this.Methods) != len(that1.Methods) { 676 return false 677 } 678 for i := range this.Methods { 679 if !this.Methods[i].Equal(that1.Methods[i]) { 680 return false 681 } 682 } 683 if len(this.Options) != len(that1.Options) { 684 return false 685 } 686 for i := range this.Options { 687 if !this.Options[i].Equal(that1.Options[i]) { 688 return false 689 } 690 } 691 if this.Version != that1.Version { 692 return false 693 } 694 if !this.SourceContext.Equal(that1.SourceContext) { 695 return false 696 } 697 if len(this.Mixins) != len(that1.Mixins) { 698 return false 699 } 700 for i := range this.Mixins { 701 if !this.Mixins[i].Equal(that1.Mixins[i]) { 702 return false 703 } 704 } 705 if this.Syntax != that1.Syntax { 706 return false 707 } 708 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 709 return false 710 } 711 return true 712} 713func (this *Method) Equal(that interface{}) bool { 714 if that == nil { 715 return this == nil 716 } 717 718 that1, ok := that.(*Method) 719 if !ok { 720 that2, ok := that.(Method) 721 if ok { 722 that1 = &that2 723 } else { 724 return false 725 } 726 } 727 if that1 == nil { 728 return this == nil 729 } else if this == nil { 730 return false 731 } 732 if this.Name != that1.Name { 733 return false 734 } 735 if this.RequestTypeUrl != that1.RequestTypeUrl { 736 return false 737 } 738 if this.RequestStreaming != that1.RequestStreaming { 739 return false 740 } 741 if this.ResponseTypeUrl != that1.ResponseTypeUrl { 742 return false 743 } 744 if this.ResponseStreaming != that1.ResponseStreaming { 745 return false 746 } 747 if len(this.Options) != len(that1.Options) { 748 return false 749 } 750 for i := range this.Options { 751 if !this.Options[i].Equal(that1.Options[i]) { 752 return false 753 } 754 } 755 if this.Syntax != that1.Syntax { 756 return false 757 } 758 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 759 return false 760 } 761 return true 762} 763func (this *Mixin) Equal(that interface{}) bool { 764 if that == nil { 765 return this == nil 766 } 767 768 that1, ok := that.(*Mixin) 769 if !ok { 770 that2, ok := that.(Mixin) 771 if ok { 772 that1 = &that2 773 } else { 774 return false 775 } 776 } 777 if that1 == nil { 778 return this == nil 779 } else if this == nil { 780 return false 781 } 782 if this.Name != that1.Name { 783 return false 784 } 785 if this.Root != that1.Root { 786 return false 787 } 788 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 789 return false 790 } 791 return true 792} 793func (this *Api) GoString() string { 794 if this == nil { 795 return "nil" 796 } 797 s := make([]string, 0, 11) 798 s = append(s, "&types.Api{") 799 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 800 if this.Methods != nil { 801 s = append(s, "Methods: "+fmt.Sprintf("%#v", this.Methods)+",\n") 802 } 803 if this.Options != nil { 804 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") 805 } 806 s = append(s, "Version: "+fmt.Sprintf("%#v", this.Version)+",\n") 807 if this.SourceContext != nil { 808 s = append(s, "SourceContext: "+fmt.Sprintf("%#v", this.SourceContext)+",\n") 809 } 810 if this.Mixins != nil { 811 s = append(s, "Mixins: "+fmt.Sprintf("%#v", this.Mixins)+",\n") 812 } 813 s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") 814 if this.XXX_unrecognized != nil { 815 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 816 } 817 s = append(s, "}") 818 return strings.Join(s, "") 819} 820func (this *Method) GoString() string { 821 if this == nil { 822 return "nil" 823 } 824 s := make([]string, 0, 11) 825 s = append(s, "&types.Method{") 826 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 827 s = append(s, "RequestTypeUrl: "+fmt.Sprintf("%#v", this.RequestTypeUrl)+",\n") 828 s = append(s, "RequestStreaming: "+fmt.Sprintf("%#v", this.RequestStreaming)+",\n") 829 s = append(s, "ResponseTypeUrl: "+fmt.Sprintf("%#v", this.ResponseTypeUrl)+",\n") 830 s = append(s, "ResponseStreaming: "+fmt.Sprintf("%#v", this.ResponseStreaming)+",\n") 831 if this.Options != nil { 832 s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") 833 } 834 s = append(s, "Syntax: "+fmt.Sprintf("%#v", this.Syntax)+",\n") 835 if this.XXX_unrecognized != nil { 836 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 837 } 838 s = append(s, "}") 839 return strings.Join(s, "") 840} 841func (this *Mixin) GoString() string { 842 if this == nil { 843 return "nil" 844 } 845 s := make([]string, 0, 6) 846 s = append(s, "&types.Mixin{") 847 s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") 848 s = append(s, "Root: "+fmt.Sprintf("%#v", this.Root)+",\n") 849 if this.XXX_unrecognized != nil { 850 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") 851 } 852 s = append(s, "}") 853 return strings.Join(s, "") 854} 855func valueToGoStringApi(v interface{}, typ string) string { 856 rv := reflect.ValueOf(v) 857 if rv.IsNil() { 858 return "nil" 859 } 860 pv := reflect.Indirect(rv).Interface() 861 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 862} 863func (m *Api) Marshal() (dAtA []byte, err error) { 864 size := m.Size() 865 dAtA = make([]byte, size) 866 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 867 if err != nil { 868 return nil, err 869 } 870 return dAtA[:n], nil 871} 872 873func (m *Api) MarshalTo(dAtA []byte) (int, error) { 874 size := m.Size() 875 return m.MarshalToSizedBuffer(dAtA[:size]) 876} 877 878func (m *Api) MarshalToSizedBuffer(dAtA []byte) (int, error) { 879 i := len(dAtA) 880 _ = i 881 var l int 882 _ = l 883 if m.XXX_unrecognized != nil { 884 i -= len(m.XXX_unrecognized) 885 copy(dAtA[i:], m.XXX_unrecognized) 886 } 887 if m.Syntax != 0 { 888 i = encodeVarintApi(dAtA, i, uint64(m.Syntax)) 889 i-- 890 dAtA[i] = 0x38 891 } 892 if len(m.Mixins) > 0 { 893 for iNdEx := len(m.Mixins) - 1; iNdEx >= 0; iNdEx-- { 894 { 895 size, err := m.Mixins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 896 if err != nil { 897 return 0, err 898 } 899 i -= size 900 i = encodeVarintApi(dAtA, i, uint64(size)) 901 } 902 i-- 903 dAtA[i] = 0x32 904 } 905 } 906 if m.SourceContext != nil { 907 { 908 size, err := m.SourceContext.MarshalToSizedBuffer(dAtA[:i]) 909 if err != nil { 910 return 0, err 911 } 912 i -= size 913 i = encodeVarintApi(dAtA, i, uint64(size)) 914 } 915 i-- 916 dAtA[i] = 0x2a 917 } 918 if len(m.Version) > 0 { 919 i -= len(m.Version) 920 copy(dAtA[i:], m.Version) 921 i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) 922 i-- 923 dAtA[i] = 0x22 924 } 925 if len(m.Options) > 0 { 926 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { 927 { 928 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 929 if err != nil { 930 return 0, err 931 } 932 i -= size 933 i = encodeVarintApi(dAtA, i, uint64(size)) 934 } 935 i-- 936 dAtA[i] = 0x1a 937 } 938 } 939 if len(m.Methods) > 0 { 940 for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- { 941 { 942 size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 943 if err != nil { 944 return 0, err 945 } 946 i -= size 947 i = encodeVarintApi(dAtA, i, uint64(size)) 948 } 949 i-- 950 dAtA[i] = 0x12 951 } 952 } 953 if len(m.Name) > 0 { 954 i -= len(m.Name) 955 copy(dAtA[i:], m.Name) 956 i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) 957 i-- 958 dAtA[i] = 0xa 959 } 960 return len(dAtA) - i, nil 961} 962 963func (m *Method) Marshal() (dAtA []byte, err error) { 964 size := m.Size() 965 dAtA = make([]byte, size) 966 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 967 if err != nil { 968 return nil, err 969 } 970 return dAtA[:n], nil 971} 972 973func (m *Method) MarshalTo(dAtA []byte) (int, error) { 974 size := m.Size() 975 return m.MarshalToSizedBuffer(dAtA[:size]) 976} 977 978func (m *Method) MarshalToSizedBuffer(dAtA []byte) (int, error) { 979 i := len(dAtA) 980 _ = i 981 var l int 982 _ = l 983 if m.XXX_unrecognized != nil { 984 i -= len(m.XXX_unrecognized) 985 copy(dAtA[i:], m.XXX_unrecognized) 986 } 987 if m.Syntax != 0 { 988 i = encodeVarintApi(dAtA, i, uint64(m.Syntax)) 989 i-- 990 dAtA[i] = 0x38 991 } 992 if len(m.Options) > 0 { 993 for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { 994 { 995 size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) 996 if err != nil { 997 return 0, err 998 } 999 i -= size 1000 i = encodeVarintApi(dAtA, i, uint64(size)) 1001 } 1002 i-- 1003 dAtA[i] = 0x32 1004 } 1005 } 1006 if m.ResponseStreaming { 1007 i-- 1008 if m.ResponseStreaming { 1009 dAtA[i] = 1 1010 } else { 1011 dAtA[i] = 0 1012 } 1013 i-- 1014 dAtA[i] = 0x28 1015 } 1016 if len(m.ResponseTypeUrl) > 0 { 1017 i -= len(m.ResponseTypeUrl) 1018 copy(dAtA[i:], m.ResponseTypeUrl) 1019 i = encodeVarintApi(dAtA, i, uint64(len(m.ResponseTypeUrl))) 1020 i-- 1021 dAtA[i] = 0x22 1022 } 1023 if m.RequestStreaming { 1024 i-- 1025 if m.RequestStreaming { 1026 dAtA[i] = 1 1027 } else { 1028 dAtA[i] = 0 1029 } 1030 i-- 1031 dAtA[i] = 0x18 1032 } 1033 if len(m.RequestTypeUrl) > 0 { 1034 i -= len(m.RequestTypeUrl) 1035 copy(dAtA[i:], m.RequestTypeUrl) 1036 i = encodeVarintApi(dAtA, i, uint64(len(m.RequestTypeUrl))) 1037 i-- 1038 dAtA[i] = 0x12 1039 } 1040 if len(m.Name) > 0 { 1041 i -= len(m.Name) 1042 copy(dAtA[i:], m.Name) 1043 i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) 1044 i-- 1045 dAtA[i] = 0xa 1046 } 1047 return len(dAtA) - i, nil 1048} 1049 1050func (m *Mixin) Marshal() (dAtA []byte, err error) { 1051 size := m.Size() 1052 dAtA = make([]byte, size) 1053 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1054 if err != nil { 1055 return nil, err 1056 } 1057 return dAtA[:n], nil 1058} 1059 1060func (m *Mixin) MarshalTo(dAtA []byte) (int, error) { 1061 size := m.Size() 1062 return m.MarshalToSizedBuffer(dAtA[:size]) 1063} 1064 1065func (m *Mixin) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1066 i := len(dAtA) 1067 _ = i 1068 var l int 1069 _ = l 1070 if m.XXX_unrecognized != nil { 1071 i -= len(m.XXX_unrecognized) 1072 copy(dAtA[i:], m.XXX_unrecognized) 1073 } 1074 if len(m.Root) > 0 { 1075 i -= len(m.Root) 1076 copy(dAtA[i:], m.Root) 1077 i = encodeVarintApi(dAtA, i, uint64(len(m.Root))) 1078 i-- 1079 dAtA[i] = 0x12 1080 } 1081 if len(m.Name) > 0 { 1082 i -= len(m.Name) 1083 copy(dAtA[i:], m.Name) 1084 i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) 1085 i-- 1086 dAtA[i] = 0xa 1087 } 1088 return len(dAtA) - i, nil 1089} 1090 1091func encodeVarintApi(dAtA []byte, offset int, v uint64) int { 1092 offset -= sovApi(v) 1093 base := offset 1094 for v >= 1<<7 { 1095 dAtA[offset] = uint8(v&0x7f | 0x80) 1096 v >>= 7 1097 offset++ 1098 } 1099 dAtA[offset] = uint8(v) 1100 return base 1101} 1102func NewPopulatedApi(r randyApi, easy bool) *Api { 1103 this := &Api{} 1104 this.Name = string(randStringApi(r)) 1105 if r.Intn(5) != 0 { 1106 v1 := r.Intn(5) 1107 this.Methods = make([]*Method, v1) 1108 for i := 0; i < v1; i++ { 1109 this.Methods[i] = NewPopulatedMethod(r, easy) 1110 } 1111 } 1112 if r.Intn(5) != 0 { 1113 v2 := r.Intn(5) 1114 this.Options = make([]*Option, v2) 1115 for i := 0; i < v2; i++ { 1116 this.Options[i] = NewPopulatedOption(r, easy) 1117 } 1118 } 1119 this.Version = string(randStringApi(r)) 1120 if r.Intn(5) != 0 { 1121 this.SourceContext = NewPopulatedSourceContext(r, easy) 1122 } 1123 if r.Intn(5) != 0 { 1124 v3 := r.Intn(5) 1125 this.Mixins = make([]*Mixin, v3) 1126 for i := 0; i < v3; i++ { 1127 this.Mixins[i] = NewPopulatedMixin(r, easy) 1128 } 1129 } 1130 this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) 1131 if !easy && r.Intn(10) != 0 { 1132 this.XXX_unrecognized = randUnrecognizedApi(r, 8) 1133 } 1134 return this 1135} 1136 1137func NewPopulatedMethod(r randyApi, easy bool) *Method { 1138 this := &Method{} 1139 this.Name = string(randStringApi(r)) 1140 this.RequestTypeUrl = string(randStringApi(r)) 1141 this.RequestStreaming = bool(bool(r.Intn(2) == 0)) 1142 this.ResponseTypeUrl = string(randStringApi(r)) 1143 this.ResponseStreaming = bool(bool(r.Intn(2) == 0)) 1144 if r.Intn(5) != 0 { 1145 v4 := r.Intn(5) 1146 this.Options = make([]*Option, v4) 1147 for i := 0; i < v4; i++ { 1148 this.Options[i] = NewPopulatedOption(r, easy) 1149 } 1150 } 1151 this.Syntax = Syntax([]int32{0, 1}[r.Intn(2)]) 1152 if !easy && r.Intn(10) != 0 { 1153 this.XXX_unrecognized = randUnrecognizedApi(r, 8) 1154 } 1155 return this 1156} 1157 1158func NewPopulatedMixin(r randyApi, easy bool) *Mixin { 1159 this := &Mixin{} 1160 this.Name = string(randStringApi(r)) 1161 this.Root = string(randStringApi(r)) 1162 if !easy && r.Intn(10) != 0 { 1163 this.XXX_unrecognized = randUnrecognizedApi(r, 3) 1164 } 1165 return this 1166} 1167 1168type randyApi interface { 1169 Float32() float32 1170 Float64() float64 1171 Int63() int64 1172 Int31() int32 1173 Uint32() uint32 1174 Intn(n int) int 1175} 1176 1177func randUTF8RuneApi(r randyApi) rune { 1178 ru := r.Intn(62) 1179 if ru < 10 { 1180 return rune(ru + 48) 1181 } else if ru < 36 { 1182 return rune(ru + 55) 1183 } 1184 return rune(ru + 61) 1185} 1186func randStringApi(r randyApi) string { 1187 v5 := r.Intn(100) 1188 tmps := make([]rune, v5) 1189 for i := 0; i < v5; i++ { 1190 tmps[i] = randUTF8RuneApi(r) 1191 } 1192 return string(tmps) 1193} 1194func randUnrecognizedApi(r randyApi, maxFieldNumber int) (dAtA []byte) { 1195 l := r.Intn(5) 1196 for i := 0; i < l; i++ { 1197 wire := r.Intn(4) 1198 if wire == 3 { 1199 wire = 5 1200 } 1201 fieldNumber := maxFieldNumber + r.Intn(100) 1202 dAtA = randFieldApi(dAtA, r, fieldNumber, wire) 1203 } 1204 return dAtA 1205} 1206func randFieldApi(dAtA []byte, r randyApi, fieldNumber int, wire int) []byte { 1207 key := uint32(fieldNumber)<<3 | uint32(wire) 1208 switch wire { 1209 case 0: 1210 dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) 1211 v6 := r.Int63() 1212 if r.Intn(2) == 0 { 1213 v6 *= -1 1214 } 1215 dAtA = encodeVarintPopulateApi(dAtA, uint64(v6)) 1216 case 1: 1217 dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) 1218 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 1219 case 2: 1220 dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) 1221 ll := r.Intn(100) 1222 dAtA = encodeVarintPopulateApi(dAtA, uint64(ll)) 1223 for j := 0; j < ll; j++ { 1224 dAtA = append(dAtA, byte(r.Intn(256))) 1225 } 1226 default: 1227 dAtA = encodeVarintPopulateApi(dAtA, uint64(key)) 1228 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) 1229 } 1230 return dAtA 1231} 1232func encodeVarintPopulateApi(dAtA []byte, v uint64) []byte { 1233 for v >= 1<<7 { 1234 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) 1235 v >>= 7 1236 } 1237 dAtA = append(dAtA, uint8(v)) 1238 return dAtA 1239} 1240func (m *Api) Size() (n int) { 1241 if m == nil { 1242 return 0 1243 } 1244 var l int 1245 _ = l 1246 l = len(m.Name) 1247 if l > 0 { 1248 n += 1 + l + sovApi(uint64(l)) 1249 } 1250 if len(m.Methods) > 0 { 1251 for _, e := range m.Methods { 1252 l = e.Size() 1253 n += 1 + l + sovApi(uint64(l)) 1254 } 1255 } 1256 if len(m.Options) > 0 { 1257 for _, e := range m.Options { 1258 l = e.Size() 1259 n += 1 + l + sovApi(uint64(l)) 1260 } 1261 } 1262 l = len(m.Version) 1263 if l > 0 { 1264 n += 1 + l + sovApi(uint64(l)) 1265 } 1266 if m.SourceContext != nil { 1267 l = m.SourceContext.Size() 1268 n += 1 + l + sovApi(uint64(l)) 1269 } 1270 if len(m.Mixins) > 0 { 1271 for _, e := range m.Mixins { 1272 l = e.Size() 1273 n += 1 + l + sovApi(uint64(l)) 1274 } 1275 } 1276 if m.Syntax != 0 { 1277 n += 1 + sovApi(uint64(m.Syntax)) 1278 } 1279 if m.XXX_unrecognized != nil { 1280 n += len(m.XXX_unrecognized) 1281 } 1282 return n 1283} 1284 1285func (m *Method) Size() (n int) { 1286 if m == nil { 1287 return 0 1288 } 1289 var l int 1290 _ = l 1291 l = len(m.Name) 1292 if l > 0 { 1293 n += 1 + l + sovApi(uint64(l)) 1294 } 1295 l = len(m.RequestTypeUrl) 1296 if l > 0 { 1297 n += 1 + l + sovApi(uint64(l)) 1298 } 1299 if m.RequestStreaming { 1300 n += 2 1301 } 1302 l = len(m.ResponseTypeUrl) 1303 if l > 0 { 1304 n += 1 + l + sovApi(uint64(l)) 1305 } 1306 if m.ResponseStreaming { 1307 n += 2 1308 } 1309 if len(m.Options) > 0 { 1310 for _, e := range m.Options { 1311 l = e.Size() 1312 n += 1 + l + sovApi(uint64(l)) 1313 } 1314 } 1315 if m.Syntax != 0 { 1316 n += 1 + sovApi(uint64(m.Syntax)) 1317 } 1318 if m.XXX_unrecognized != nil { 1319 n += len(m.XXX_unrecognized) 1320 } 1321 return n 1322} 1323 1324func (m *Mixin) Size() (n int) { 1325 if m == nil { 1326 return 0 1327 } 1328 var l int 1329 _ = l 1330 l = len(m.Name) 1331 if l > 0 { 1332 n += 1 + l + sovApi(uint64(l)) 1333 } 1334 l = len(m.Root) 1335 if l > 0 { 1336 n += 1 + l + sovApi(uint64(l)) 1337 } 1338 if m.XXX_unrecognized != nil { 1339 n += len(m.XXX_unrecognized) 1340 } 1341 return n 1342} 1343 1344func sovApi(x uint64) (n int) { 1345 return (math_bits.Len64(x|1) + 6) / 7 1346} 1347func sozApi(x uint64) (n int) { 1348 return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1349} 1350func (this *Api) String() string { 1351 if this == nil { 1352 return "nil" 1353 } 1354 repeatedStringForMethods := "[]*Method{" 1355 for _, f := range this.Methods { 1356 repeatedStringForMethods += strings.Replace(f.String(), "Method", "Method", 1) + "," 1357 } 1358 repeatedStringForMethods += "}" 1359 repeatedStringForOptions := "[]*Option{" 1360 for _, f := range this.Options { 1361 repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + "," 1362 } 1363 repeatedStringForOptions += "}" 1364 repeatedStringForMixins := "[]*Mixin{" 1365 for _, f := range this.Mixins { 1366 repeatedStringForMixins += strings.Replace(f.String(), "Mixin", "Mixin", 1) + "," 1367 } 1368 repeatedStringForMixins += "}" 1369 s := strings.Join([]string{`&Api{`, 1370 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 1371 `Methods:` + repeatedStringForMethods + `,`, 1372 `Options:` + repeatedStringForOptions + `,`, 1373 `Version:` + fmt.Sprintf("%v", this.Version) + `,`, 1374 `SourceContext:` + strings.Replace(fmt.Sprintf("%v", this.SourceContext), "SourceContext", "SourceContext", 1) + `,`, 1375 `Mixins:` + repeatedStringForMixins + `,`, 1376 `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, 1377 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 1378 `}`, 1379 }, "") 1380 return s 1381} 1382func (this *Method) String() string { 1383 if this == nil { 1384 return "nil" 1385 } 1386 repeatedStringForOptions := "[]*Option{" 1387 for _, f := range this.Options { 1388 repeatedStringForOptions += strings.Replace(fmt.Sprintf("%v", f), "Option", "Option", 1) + "," 1389 } 1390 repeatedStringForOptions += "}" 1391 s := strings.Join([]string{`&Method{`, 1392 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 1393 `RequestTypeUrl:` + fmt.Sprintf("%v", this.RequestTypeUrl) + `,`, 1394 `RequestStreaming:` + fmt.Sprintf("%v", this.RequestStreaming) + `,`, 1395 `ResponseTypeUrl:` + fmt.Sprintf("%v", this.ResponseTypeUrl) + `,`, 1396 `ResponseStreaming:` + fmt.Sprintf("%v", this.ResponseStreaming) + `,`, 1397 `Options:` + repeatedStringForOptions + `,`, 1398 `Syntax:` + fmt.Sprintf("%v", this.Syntax) + `,`, 1399 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 1400 `}`, 1401 }, "") 1402 return s 1403} 1404func (this *Mixin) String() string { 1405 if this == nil { 1406 return "nil" 1407 } 1408 s := strings.Join([]string{`&Mixin{`, 1409 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 1410 `Root:` + fmt.Sprintf("%v", this.Root) + `,`, 1411 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 1412 `}`, 1413 }, "") 1414 return s 1415} 1416func valueToStringApi(v interface{}) string { 1417 rv := reflect.ValueOf(v) 1418 if rv.IsNil() { 1419 return "nil" 1420 } 1421 pv := reflect.Indirect(rv).Interface() 1422 return fmt.Sprintf("*%v", pv) 1423} 1424func (m *Api) Unmarshal(dAtA []byte) error { 1425 l := len(dAtA) 1426 iNdEx := 0 1427 for iNdEx < l { 1428 preIndex := iNdEx 1429 var wire uint64 1430 for shift := uint(0); ; shift += 7 { 1431 if shift >= 64 { 1432 return ErrIntOverflowApi 1433 } 1434 if iNdEx >= l { 1435 return io.ErrUnexpectedEOF 1436 } 1437 b := dAtA[iNdEx] 1438 iNdEx++ 1439 wire |= uint64(b&0x7F) << shift 1440 if b < 0x80 { 1441 break 1442 } 1443 } 1444 fieldNum := int32(wire >> 3) 1445 wireType := int(wire & 0x7) 1446 if wireType == 4 { 1447 return fmt.Errorf("proto: Api: wiretype end group for non-group") 1448 } 1449 if fieldNum <= 0 { 1450 return fmt.Errorf("proto: Api: illegal tag %d (wire type %d)", fieldNum, wire) 1451 } 1452 switch fieldNum { 1453 case 1: 1454 if wireType != 2 { 1455 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 1456 } 1457 var stringLen uint64 1458 for shift := uint(0); ; shift += 7 { 1459 if shift >= 64 { 1460 return ErrIntOverflowApi 1461 } 1462 if iNdEx >= l { 1463 return io.ErrUnexpectedEOF 1464 } 1465 b := dAtA[iNdEx] 1466 iNdEx++ 1467 stringLen |= uint64(b&0x7F) << shift 1468 if b < 0x80 { 1469 break 1470 } 1471 } 1472 intStringLen := int(stringLen) 1473 if intStringLen < 0 { 1474 return ErrInvalidLengthApi 1475 } 1476 postIndex := iNdEx + intStringLen 1477 if postIndex < 0 { 1478 return ErrInvalidLengthApi 1479 } 1480 if postIndex > l { 1481 return io.ErrUnexpectedEOF 1482 } 1483 m.Name = string(dAtA[iNdEx:postIndex]) 1484 iNdEx = postIndex 1485 case 2: 1486 if wireType != 2 { 1487 return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType) 1488 } 1489 var msglen int 1490 for shift := uint(0); ; shift += 7 { 1491 if shift >= 64 { 1492 return ErrIntOverflowApi 1493 } 1494 if iNdEx >= l { 1495 return io.ErrUnexpectedEOF 1496 } 1497 b := dAtA[iNdEx] 1498 iNdEx++ 1499 msglen |= int(b&0x7F) << shift 1500 if b < 0x80 { 1501 break 1502 } 1503 } 1504 if msglen < 0 { 1505 return ErrInvalidLengthApi 1506 } 1507 postIndex := iNdEx + msglen 1508 if postIndex < 0 { 1509 return ErrInvalidLengthApi 1510 } 1511 if postIndex > l { 1512 return io.ErrUnexpectedEOF 1513 } 1514 m.Methods = append(m.Methods, &Method{}) 1515 if err := m.Methods[len(m.Methods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1516 return err 1517 } 1518 iNdEx = postIndex 1519 case 3: 1520 if wireType != 2 { 1521 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) 1522 } 1523 var msglen int 1524 for shift := uint(0); ; shift += 7 { 1525 if shift >= 64 { 1526 return ErrIntOverflowApi 1527 } 1528 if iNdEx >= l { 1529 return io.ErrUnexpectedEOF 1530 } 1531 b := dAtA[iNdEx] 1532 iNdEx++ 1533 msglen |= int(b&0x7F) << shift 1534 if b < 0x80 { 1535 break 1536 } 1537 } 1538 if msglen < 0 { 1539 return ErrInvalidLengthApi 1540 } 1541 postIndex := iNdEx + msglen 1542 if postIndex < 0 { 1543 return ErrInvalidLengthApi 1544 } 1545 if postIndex > l { 1546 return io.ErrUnexpectedEOF 1547 } 1548 m.Options = append(m.Options, &Option{}) 1549 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1550 return err 1551 } 1552 iNdEx = postIndex 1553 case 4: 1554 if wireType != 2 { 1555 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 1556 } 1557 var stringLen uint64 1558 for shift := uint(0); ; shift += 7 { 1559 if shift >= 64 { 1560 return ErrIntOverflowApi 1561 } 1562 if iNdEx >= l { 1563 return io.ErrUnexpectedEOF 1564 } 1565 b := dAtA[iNdEx] 1566 iNdEx++ 1567 stringLen |= uint64(b&0x7F) << shift 1568 if b < 0x80 { 1569 break 1570 } 1571 } 1572 intStringLen := int(stringLen) 1573 if intStringLen < 0 { 1574 return ErrInvalidLengthApi 1575 } 1576 postIndex := iNdEx + intStringLen 1577 if postIndex < 0 { 1578 return ErrInvalidLengthApi 1579 } 1580 if postIndex > l { 1581 return io.ErrUnexpectedEOF 1582 } 1583 m.Version = string(dAtA[iNdEx:postIndex]) 1584 iNdEx = postIndex 1585 case 5: 1586 if wireType != 2 { 1587 return fmt.Errorf("proto: wrong wireType = %d for field SourceContext", wireType) 1588 } 1589 var msglen int 1590 for shift := uint(0); ; shift += 7 { 1591 if shift >= 64 { 1592 return ErrIntOverflowApi 1593 } 1594 if iNdEx >= l { 1595 return io.ErrUnexpectedEOF 1596 } 1597 b := dAtA[iNdEx] 1598 iNdEx++ 1599 msglen |= int(b&0x7F) << shift 1600 if b < 0x80 { 1601 break 1602 } 1603 } 1604 if msglen < 0 { 1605 return ErrInvalidLengthApi 1606 } 1607 postIndex := iNdEx + msglen 1608 if postIndex < 0 { 1609 return ErrInvalidLengthApi 1610 } 1611 if postIndex > l { 1612 return io.ErrUnexpectedEOF 1613 } 1614 if m.SourceContext == nil { 1615 m.SourceContext = &SourceContext{} 1616 } 1617 if err := m.SourceContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1618 return err 1619 } 1620 iNdEx = postIndex 1621 case 6: 1622 if wireType != 2 { 1623 return fmt.Errorf("proto: wrong wireType = %d for field Mixins", wireType) 1624 } 1625 var msglen int 1626 for shift := uint(0); ; shift += 7 { 1627 if shift >= 64 { 1628 return ErrIntOverflowApi 1629 } 1630 if iNdEx >= l { 1631 return io.ErrUnexpectedEOF 1632 } 1633 b := dAtA[iNdEx] 1634 iNdEx++ 1635 msglen |= int(b&0x7F) << shift 1636 if b < 0x80 { 1637 break 1638 } 1639 } 1640 if msglen < 0 { 1641 return ErrInvalidLengthApi 1642 } 1643 postIndex := iNdEx + msglen 1644 if postIndex < 0 { 1645 return ErrInvalidLengthApi 1646 } 1647 if postIndex > l { 1648 return io.ErrUnexpectedEOF 1649 } 1650 m.Mixins = append(m.Mixins, &Mixin{}) 1651 if err := m.Mixins[len(m.Mixins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1652 return err 1653 } 1654 iNdEx = postIndex 1655 case 7: 1656 if wireType != 0 { 1657 return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) 1658 } 1659 m.Syntax = 0 1660 for shift := uint(0); ; shift += 7 { 1661 if shift >= 64 { 1662 return ErrIntOverflowApi 1663 } 1664 if iNdEx >= l { 1665 return io.ErrUnexpectedEOF 1666 } 1667 b := dAtA[iNdEx] 1668 iNdEx++ 1669 m.Syntax |= Syntax(b&0x7F) << shift 1670 if b < 0x80 { 1671 break 1672 } 1673 } 1674 default: 1675 iNdEx = preIndex 1676 skippy, err := skipApi(dAtA[iNdEx:]) 1677 if err != nil { 1678 return err 1679 } 1680 if skippy < 0 { 1681 return ErrInvalidLengthApi 1682 } 1683 if (iNdEx + skippy) < 0 { 1684 return ErrInvalidLengthApi 1685 } 1686 if (iNdEx + skippy) > l { 1687 return io.ErrUnexpectedEOF 1688 } 1689 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1690 iNdEx += skippy 1691 } 1692 } 1693 1694 if iNdEx > l { 1695 return io.ErrUnexpectedEOF 1696 } 1697 return nil 1698} 1699func (m *Method) Unmarshal(dAtA []byte) error { 1700 l := len(dAtA) 1701 iNdEx := 0 1702 for iNdEx < l { 1703 preIndex := iNdEx 1704 var wire uint64 1705 for shift := uint(0); ; shift += 7 { 1706 if shift >= 64 { 1707 return ErrIntOverflowApi 1708 } 1709 if iNdEx >= l { 1710 return io.ErrUnexpectedEOF 1711 } 1712 b := dAtA[iNdEx] 1713 iNdEx++ 1714 wire |= uint64(b&0x7F) << shift 1715 if b < 0x80 { 1716 break 1717 } 1718 } 1719 fieldNum := int32(wire >> 3) 1720 wireType := int(wire & 0x7) 1721 if wireType == 4 { 1722 return fmt.Errorf("proto: Method: wiretype end group for non-group") 1723 } 1724 if fieldNum <= 0 { 1725 return fmt.Errorf("proto: Method: illegal tag %d (wire type %d)", fieldNum, wire) 1726 } 1727 switch fieldNum { 1728 case 1: 1729 if wireType != 2 { 1730 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 1731 } 1732 var stringLen uint64 1733 for shift := uint(0); ; shift += 7 { 1734 if shift >= 64 { 1735 return ErrIntOverflowApi 1736 } 1737 if iNdEx >= l { 1738 return io.ErrUnexpectedEOF 1739 } 1740 b := dAtA[iNdEx] 1741 iNdEx++ 1742 stringLen |= uint64(b&0x7F) << shift 1743 if b < 0x80 { 1744 break 1745 } 1746 } 1747 intStringLen := int(stringLen) 1748 if intStringLen < 0 { 1749 return ErrInvalidLengthApi 1750 } 1751 postIndex := iNdEx + intStringLen 1752 if postIndex < 0 { 1753 return ErrInvalidLengthApi 1754 } 1755 if postIndex > l { 1756 return io.ErrUnexpectedEOF 1757 } 1758 m.Name = string(dAtA[iNdEx:postIndex]) 1759 iNdEx = postIndex 1760 case 2: 1761 if wireType != 2 { 1762 return fmt.Errorf("proto: wrong wireType = %d for field RequestTypeUrl", wireType) 1763 } 1764 var stringLen uint64 1765 for shift := uint(0); ; shift += 7 { 1766 if shift >= 64 { 1767 return ErrIntOverflowApi 1768 } 1769 if iNdEx >= l { 1770 return io.ErrUnexpectedEOF 1771 } 1772 b := dAtA[iNdEx] 1773 iNdEx++ 1774 stringLen |= uint64(b&0x7F) << shift 1775 if b < 0x80 { 1776 break 1777 } 1778 } 1779 intStringLen := int(stringLen) 1780 if intStringLen < 0 { 1781 return ErrInvalidLengthApi 1782 } 1783 postIndex := iNdEx + intStringLen 1784 if postIndex < 0 { 1785 return ErrInvalidLengthApi 1786 } 1787 if postIndex > l { 1788 return io.ErrUnexpectedEOF 1789 } 1790 m.RequestTypeUrl = string(dAtA[iNdEx:postIndex]) 1791 iNdEx = postIndex 1792 case 3: 1793 if wireType != 0 { 1794 return fmt.Errorf("proto: wrong wireType = %d for field RequestStreaming", wireType) 1795 } 1796 var v int 1797 for shift := uint(0); ; shift += 7 { 1798 if shift >= 64 { 1799 return ErrIntOverflowApi 1800 } 1801 if iNdEx >= l { 1802 return io.ErrUnexpectedEOF 1803 } 1804 b := dAtA[iNdEx] 1805 iNdEx++ 1806 v |= int(b&0x7F) << shift 1807 if b < 0x80 { 1808 break 1809 } 1810 } 1811 m.RequestStreaming = bool(v != 0) 1812 case 4: 1813 if wireType != 2 { 1814 return fmt.Errorf("proto: wrong wireType = %d for field ResponseTypeUrl", wireType) 1815 } 1816 var stringLen uint64 1817 for shift := uint(0); ; shift += 7 { 1818 if shift >= 64 { 1819 return ErrIntOverflowApi 1820 } 1821 if iNdEx >= l { 1822 return io.ErrUnexpectedEOF 1823 } 1824 b := dAtA[iNdEx] 1825 iNdEx++ 1826 stringLen |= uint64(b&0x7F) << shift 1827 if b < 0x80 { 1828 break 1829 } 1830 } 1831 intStringLen := int(stringLen) 1832 if intStringLen < 0 { 1833 return ErrInvalidLengthApi 1834 } 1835 postIndex := iNdEx + intStringLen 1836 if postIndex < 0 { 1837 return ErrInvalidLengthApi 1838 } 1839 if postIndex > l { 1840 return io.ErrUnexpectedEOF 1841 } 1842 m.ResponseTypeUrl = string(dAtA[iNdEx:postIndex]) 1843 iNdEx = postIndex 1844 case 5: 1845 if wireType != 0 { 1846 return fmt.Errorf("proto: wrong wireType = %d for field ResponseStreaming", wireType) 1847 } 1848 var v int 1849 for shift := uint(0); ; shift += 7 { 1850 if shift >= 64 { 1851 return ErrIntOverflowApi 1852 } 1853 if iNdEx >= l { 1854 return io.ErrUnexpectedEOF 1855 } 1856 b := dAtA[iNdEx] 1857 iNdEx++ 1858 v |= int(b&0x7F) << shift 1859 if b < 0x80 { 1860 break 1861 } 1862 } 1863 m.ResponseStreaming = bool(v != 0) 1864 case 6: 1865 if wireType != 2 { 1866 return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) 1867 } 1868 var msglen int 1869 for shift := uint(0); ; shift += 7 { 1870 if shift >= 64 { 1871 return ErrIntOverflowApi 1872 } 1873 if iNdEx >= l { 1874 return io.ErrUnexpectedEOF 1875 } 1876 b := dAtA[iNdEx] 1877 iNdEx++ 1878 msglen |= int(b&0x7F) << shift 1879 if b < 0x80 { 1880 break 1881 } 1882 } 1883 if msglen < 0 { 1884 return ErrInvalidLengthApi 1885 } 1886 postIndex := iNdEx + msglen 1887 if postIndex < 0 { 1888 return ErrInvalidLengthApi 1889 } 1890 if postIndex > l { 1891 return io.ErrUnexpectedEOF 1892 } 1893 m.Options = append(m.Options, &Option{}) 1894 if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1895 return err 1896 } 1897 iNdEx = postIndex 1898 case 7: 1899 if wireType != 0 { 1900 return fmt.Errorf("proto: wrong wireType = %d for field Syntax", wireType) 1901 } 1902 m.Syntax = 0 1903 for shift := uint(0); ; shift += 7 { 1904 if shift >= 64 { 1905 return ErrIntOverflowApi 1906 } 1907 if iNdEx >= l { 1908 return io.ErrUnexpectedEOF 1909 } 1910 b := dAtA[iNdEx] 1911 iNdEx++ 1912 m.Syntax |= Syntax(b&0x7F) << shift 1913 if b < 0x80 { 1914 break 1915 } 1916 } 1917 default: 1918 iNdEx = preIndex 1919 skippy, err := skipApi(dAtA[iNdEx:]) 1920 if err != nil { 1921 return err 1922 } 1923 if skippy < 0 { 1924 return ErrInvalidLengthApi 1925 } 1926 if (iNdEx + skippy) < 0 { 1927 return ErrInvalidLengthApi 1928 } 1929 if (iNdEx + skippy) > l { 1930 return io.ErrUnexpectedEOF 1931 } 1932 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1933 iNdEx += skippy 1934 } 1935 } 1936 1937 if iNdEx > l { 1938 return io.ErrUnexpectedEOF 1939 } 1940 return nil 1941} 1942func (m *Mixin) Unmarshal(dAtA []byte) error { 1943 l := len(dAtA) 1944 iNdEx := 0 1945 for iNdEx < l { 1946 preIndex := iNdEx 1947 var wire uint64 1948 for shift := uint(0); ; shift += 7 { 1949 if shift >= 64 { 1950 return ErrIntOverflowApi 1951 } 1952 if iNdEx >= l { 1953 return io.ErrUnexpectedEOF 1954 } 1955 b := dAtA[iNdEx] 1956 iNdEx++ 1957 wire |= uint64(b&0x7F) << shift 1958 if b < 0x80 { 1959 break 1960 } 1961 } 1962 fieldNum := int32(wire >> 3) 1963 wireType := int(wire & 0x7) 1964 if wireType == 4 { 1965 return fmt.Errorf("proto: Mixin: wiretype end group for non-group") 1966 } 1967 if fieldNum <= 0 { 1968 return fmt.Errorf("proto: Mixin: illegal tag %d (wire type %d)", fieldNum, wire) 1969 } 1970 switch fieldNum { 1971 case 1: 1972 if wireType != 2 { 1973 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 1974 } 1975 var stringLen uint64 1976 for shift := uint(0); ; shift += 7 { 1977 if shift >= 64 { 1978 return ErrIntOverflowApi 1979 } 1980 if iNdEx >= l { 1981 return io.ErrUnexpectedEOF 1982 } 1983 b := dAtA[iNdEx] 1984 iNdEx++ 1985 stringLen |= uint64(b&0x7F) << shift 1986 if b < 0x80 { 1987 break 1988 } 1989 } 1990 intStringLen := int(stringLen) 1991 if intStringLen < 0 { 1992 return ErrInvalidLengthApi 1993 } 1994 postIndex := iNdEx + intStringLen 1995 if postIndex < 0 { 1996 return ErrInvalidLengthApi 1997 } 1998 if postIndex > l { 1999 return io.ErrUnexpectedEOF 2000 } 2001 m.Name = string(dAtA[iNdEx:postIndex]) 2002 iNdEx = postIndex 2003 case 2: 2004 if wireType != 2 { 2005 return fmt.Errorf("proto: wrong wireType = %d for field Root", wireType) 2006 } 2007 var stringLen uint64 2008 for shift := uint(0); ; shift += 7 { 2009 if shift >= 64 { 2010 return ErrIntOverflowApi 2011 } 2012 if iNdEx >= l { 2013 return io.ErrUnexpectedEOF 2014 } 2015 b := dAtA[iNdEx] 2016 iNdEx++ 2017 stringLen |= uint64(b&0x7F) << shift 2018 if b < 0x80 { 2019 break 2020 } 2021 } 2022 intStringLen := int(stringLen) 2023 if intStringLen < 0 { 2024 return ErrInvalidLengthApi 2025 } 2026 postIndex := iNdEx + intStringLen 2027 if postIndex < 0 { 2028 return ErrInvalidLengthApi 2029 } 2030 if postIndex > l { 2031 return io.ErrUnexpectedEOF 2032 } 2033 m.Root = string(dAtA[iNdEx:postIndex]) 2034 iNdEx = postIndex 2035 default: 2036 iNdEx = preIndex 2037 skippy, err := skipApi(dAtA[iNdEx:]) 2038 if err != nil { 2039 return err 2040 } 2041 if skippy < 0 { 2042 return ErrInvalidLengthApi 2043 } 2044 if (iNdEx + skippy) < 0 { 2045 return ErrInvalidLengthApi 2046 } 2047 if (iNdEx + skippy) > l { 2048 return io.ErrUnexpectedEOF 2049 } 2050 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 2051 iNdEx += skippy 2052 } 2053 } 2054 2055 if iNdEx > l { 2056 return io.ErrUnexpectedEOF 2057 } 2058 return nil 2059} 2060func skipApi(dAtA []byte) (n int, err error) { 2061 l := len(dAtA) 2062 iNdEx := 0 2063 depth := 0 2064 for iNdEx < l { 2065 var wire uint64 2066 for shift := uint(0); ; shift += 7 { 2067 if shift >= 64 { 2068 return 0, ErrIntOverflowApi 2069 } 2070 if iNdEx >= l { 2071 return 0, io.ErrUnexpectedEOF 2072 } 2073 b := dAtA[iNdEx] 2074 iNdEx++ 2075 wire |= (uint64(b) & 0x7F) << shift 2076 if b < 0x80 { 2077 break 2078 } 2079 } 2080 wireType := int(wire & 0x7) 2081 switch wireType { 2082 case 0: 2083 for shift := uint(0); ; shift += 7 { 2084 if shift >= 64 { 2085 return 0, ErrIntOverflowApi 2086 } 2087 if iNdEx >= l { 2088 return 0, io.ErrUnexpectedEOF 2089 } 2090 iNdEx++ 2091 if dAtA[iNdEx-1] < 0x80 { 2092 break 2093 } 2094 } 2095 case 1: 2096 iNdEx += 8 2097 case 2: 2098 var length int 2099 for shift := uint(0); ; shift += 7 { 2100 if shift >= 64 { 2101 return 0, ErrIntOverflowApi 2102 } 2103 if iNdEx >= l { 2104 return 0, io.ErrUnexpectedEOF 2105 } 2106 b := dAtA[iNdEx] 2107 iNdEx++ 2108 length |= (int(b) & 0x7F) << shift 2109 if b < 0x80 { 2110 break 2111 } 2112 } 2113 if length < 0 { 2114 return 0, ErrInvalidLengthApi 2115 } 2116 iNdEx += length 2117 case 3: 2118 depth++ 2119 case 4: 2120 if depth == 0 { 2121 return 0, ErrUnexpectedEndOfGroupApi 2122 } 2123 depth-- 2124 case 5: 2125 iNdEx += 4 2126 default: 2127 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 2128 } 2129 if iNdEx < 0 { 2130 return 0, ErrInvalidLengthApi 2131 } 2132 if depth == 0 { 2133 return iNdEx, nil 2134 } 2135 } 2136 return 0, io.ErrUnexpectedEOF 2137} 2138 2139var ( 2140 ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") 2141 ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") 2142 ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") 2143) 2144