github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/third_party/generated/envoyproxy/data-plane-api/envoy/api/v2/discovery.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: envoy/api/v2/discovery.proto 3 4 package v2 5 6 import ( 7 bytes "bytes" 8 fmt "fmt" 9 rpc "github.com/gogo/googleapis/google/rpc" 10 _ "github.com/gogo/protobuf/gogoproto" 11 proto "github.com/gogo/protobuf/proto" 12 github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" 13 types "github.com/gogo/protobuf/types" 14 core "go.aporeto.io/trireme-lib/third_party/generated/envoyproxy/data-plane-api/envoy/api/v2/core" 15 io "io" 16 math "math" 17 math_bits "math/bits" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var _ = proto.Marshal 22 var _ = fmt.Errorf 23 var _ = math.Inf 24 25 // This is a compile-time assertion to ensure that this generated file 26 // is compatible with the proto package it is being compiled against. 27 // A compilation error at this line likely means your copy of the 28 // proto package needs to be updated. 29 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 30 31 // A DiscoveryRequest requests a set of versioned resources of the same type for 32 // a given Envoy node on some API. 33 type DiscoveryRequest struct { 34 // The version_info provided in the request messages will be the version_info 35 // received with the most recent successfully processed response or empty on 36 // the first request. It is expected that no new request is sent after a 37 // response is received until the Envoy instance is ready to ACK/NACK the new 38 // configuration. ACK/NACK takes place by returning the new API config version 39 // as applied or the previous API config version respectively. Each type_url 40 // (see below) has an independent version associated with it. 41 VersionInfo string `protobuf:"bytes,1,opt,name=version_info,json=versionInfo,proto3" json:"version_info,omitempty"` 42 // The node making the request. 43 Node *core.Node `protobuf:"bytes,2,opt,name=node,proto3" json:"node,omitempty"` 44 // List of resources to subscribe to, e.g. list of cluster names or a route 45 // configuration name. If this is empty, all resources for the API are 46 // returned. LDS/CDS may have empty resource_names, which will cause all 47 // resources for the Envoy instance to be returned. The LDS and CDS responses 48 // will then imply a number of resources that need to be fetched via EDS/RDS, 49 // which will be explicitly enumerated in resource_names. 50 ResourceNames []string `protobuf:"bytes,3,rep,name=resource_names,json=resourceNames,proto3" json:"resource_names,omitempty"` 51 // Type of the resource that is being requested, e.g. 52 // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". This is implicit 53 // in requests made via singleton xDS APIs such as CDS, LDS, etc. but is 54 // required for ADS. 55 TypeUrl string `protobuf:"bytes,4,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` 56 // nonce corresponding to DiscoveryResponse being ACK/NACKed. See above 57 // discussion on version_info and the DiscoveryResponse nonce comment. This 58 // may be empty if no nonce is available, e.g. at startup or for non-stream 59 // xDS implementations. 60 ResponseNonce string `protobuf:"bytes,5,opt,name=response_nonce,json=responseNonce,proto3" json:"response_nonce,omitempty"` 61 // This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_DiscoveryResponse>` 62 // failed to update configuration. The *message* field in *error_details* provides the Envoy 63 // internal exception related to the failure. It is only intended for consumption during manual 64 // debugging, the string provided is not guaranteed to be stable across Envoy versions. 65 ErrorDetail *rpc.Status `protobuf:"bytes,6,opt,name=error_detail,json=errorDetail,proto3" json:"error_detail,omitempty"` 66 XXX_NoUnkeyedLiteral struct{} `json:"-"` 67 XXX_unrecognized []byte `json:"-"` 68 XXX_sizecache int32 `json:"-"` 69 } 70 71 func (m *DiscoveryRequest) Reset() { *m = DiscoveryRequest{} } 72 func (m *DiscoveryRequest) String() string { return proto.CompactTextString(m) } 73 func (*DiscoveryRequest) ProtoMessage() {} 74 func (*DiscoveryRequest) Descriptor() ([]byte, []int) { 75 return fileDescriptor_2c7365e287e5c035, []int{0} 76 } 77 func (m *DiscoveryRequest) XXX_Unmarshal(b []byte) error { 78 return m.Unmarshal(b) 79 } 80 func (m *DiscoveryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 81 b = b[:cap(b)] 82 n, err := m.MarshalTo(b) 83 if err != nil { 84 return nil, err 85 } 86 return b[:n], nil 87 } 88 func (m *DiscoveryRequest) XXX_Merge(src proto.Message) { 89 xxx_messageInfo_DiscoveryRequest.Merge(m, src) 90 } 91 func (m *DiscoveryRequest) XXX_Size() int { 92 return m.Size() 93 } 94 func (m *DiscoveryRequest) XXX_DiscardUnknown() { 95 xxx_messageInfo_DiscoveryRequest.DiscardUnknown(m) 96 } 97 98 var xxx_messageInfo_DiscoveryRequest proto.InternalMessageInfo 99 100 func (m *DiscoveryRequest) GetVersionInfo() string { 101 if m != nil { 102 return m.VersionInfo 103 } 104 return "" 105 } 106 107 func (m *DiscoveryRequest) GetNode() *core.Node { 108 if m != nil { 109 return m.Node 110 } 111 return nil 112 } 113 114 func (m *DiscoveryRequest) GetResourceNames() []string { 115 if m != nil { 116 return m.ResourceNames 117 } 118 return nil 119 } 120 121 func (m *DiscoveryRequest) GetTypeUrl() string { 122 if m != nil { 123 return m.TypeUrl 124 } 125 return "" 126 } 127 128 func (m *DiscoveryRequest) GetResponseNonce() string { 129 if m != nil { 130 return m.ResponseNonce 131 } 132 return "" 133 } 134 135 func (m *DiscoveryRequest) GetErrorDetail() *rpc.Status { 136 if m != nil { 137 return m.ErrorDetail 138 } 139 return nil 140 } 141 142 type DiscoveryResponse struct { 143 // The version of the response data. 144 VersionInfo string `protobuf:"bytes,1,opt,name=version_info,json=versionInfo,proto3" json:"version_info,omitempty"` 145 // The response resources. These resources are typed and depend on the API being called. 146 Resources []*types.Any `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` 147 // [#not-implemented-hide:] 148 // Canary is used to support two Envoy command line flags: 149 // 150 // * --terminate-on-canary-transition-failure. When set, Envoy is able to 151 // terminate if it detects that configuration is stuck at canary. Consider 152 // this example sequence of updates: 153 // - Management server applies a canary config successfully. 154 // - Management server rolls back to a production config. 155 // - Envoy rejects the new production config. 156 // Since there is no sensible way to continue receiving configuration 157 // updates, Envoy will then terminate and apply production config from a 158 // clean slate. 159 // * --dry-run-canary. When set, a canary response will never be applied, only 160 // validated via a dry run. 161 Canary bool `protobuf:"varint,3,opt,name=canary,proto3" json:"canary,omitempty"` 162 // Type URL for resources. Identifies the xDS API when muxing over ADS. 163 // Must be consistent with the type_url in the 'resources' repeated Any (if non-empty). 164 TypeUrl string `protobuf:"bytes,4,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` 165 // For gRPC based subscriptions, the nonce provides a way to explicitly ack a 166 // specific DiscoveryResponse in a following DiscoveryRequest. Additional 167 // messages may have been sent by Envoy to the management server for the 168 // previous version on the stream prior to this DiscoveryResponse, that were 169 // unprocessed at response send time. The nonce allows the management server 170 // to ignore any further DiscoveryRequests for the previous version until a 171 // DiscoveryRequest bearing the nonce. The nonce is optional and is not 172 // required for non-stream based xDS implementations. 173 Nonce string `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"` 174 // [#not-implemented-hide:] 175 // The control plane instance that sent the response. 176 ControlPlane *core.ControlPlane `protobuf:"bytes,6,opt,name=control_plane,json=controlPlane,proto3" json:"control_plane,omitempty"` 177 XXX_NoUnkeyedLiteral struct{} `json:"-"` 178 XXX_unrecognized []byte `json:"-"` 179 XXX_sizecache int32 `json:"-"` 180 } 181 182 func (m *DiscoveryResponse) Reset() { *m = DiscoveryResponse{} } 183 func (m *DiscoveryResponse) String() string { return proto.CompactTextString(m) } 184 func (*DiscoveryResponse) ProtoMessage() {} 185 func (*DiscoveryResponse) Descriptor() ([]byte, []int) { 186 return fileDescriptor_2c7365e287e5c035, []int{1} 187 } 188 func (m *DiscoveryResponse) XXX_Unmarshal(b []byte) error { 189 return m.Unmarshal(b) 190 } 191 func (m *DiscoveryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 192 b = b[:cap(b)] 193 n, err := m.MarshalTo(b) 194 if err != nil { 195 return nil, err 196 } 197 return b[:n], nil 198 } 199 func (m *DiscoveryResponse) XXX_Merge(src proto.Message) { 200 xxx_messageInfo_DiscoveryResponse.Merge(m, src) 201 } 202 func (m *DiscoveryResponse) XXX_Size() int { 203 return m.Size() 204 } 205 func (m *DiscoveryResponse) XXX_DiscardUnknown() { 206 xxx_messageInfo_DiscoveryResponse.DiscardUnknown(m) 207 } 208 209 var xxx_messageInfo_DiscoveryResponse proto.InternalMessageInfo 210 211 func (m *DiscoveryResponse) GetVersionInfo() string { 212 if m != nil { 213 return m.VersionInfo 214 } 215 return "" 216 } 217 218 func (m *DiscoveryResponse) GetResources() []*types.Any { 219 if m != nil { 220 return m.Resources 221 } 222 return nil 223 } 224 225 func (m *DiscoveryResponse) GetCanary() bool { 226 if m != nil { 227 return m.Canary 228 } 229 return false 230 } 231 232 func (m *DiscoveryResponse) GetTypeUrl() string { 233 if m != nil { 234 return m.TypeUrl 235 } 236 return "" 237 } 238 239 func (m *DiscoveryResponse) GetNonce() string { 240 if m != nil { 241 return m.Nonce 242 } 243 return "" 244 } 245 246 func (m *DiscoveryResponse) GetControlPlane() *core.ControlPlane { 247 if m != nil { 248 return m.ControlPlane 249 } 250 return nil 251 } 252 253 // DeltaDiscoveryRequest and DeltaDiscoveryResponse are used in a new gRPC 254 // endpoint for Delta xDS. 255 // 256 // With Delta xDS, the DeltaDiscoveryResponses do not need to include a full 257 // snapshot of the tracked resources. Instead, DeltaDiscoveryResponses are a 258 // diff to the state of a xDS client. 259 // In Delta XDS there are per-resource versions, which allow tracking state at 260 // the resource granularity. 261 // An xDS Delta session is always in the context of a gRPC bidirectional 262 // stream. This allows the xDS server to keep track of the state of xDS clients 263 // connected to it. 264 // 265 // In Delta xDS the nonce field is required and used to pair 266 // DeltaDiscoveryResponse to a DeltaDiscoveryRequest ACK or NACK. 267 // Optionally, a response message level system_version_info is present for 268 // debugging purposes only. 269 // 270 // DeltaDiscoveryRequest plays two independent roles. Any DeltaDiscoveryRequest 271 // can be either or both of: [1] informing the server of what resources the 272 // client has gained/lost interest in (using resource_names_subscribe and 273 // resource_names_unsubscribe), or [2] (N)ACKing an earlier resource update from 274 // the server (using response_nonce, with presence of error_detail making it a NACK). 275 // Additionally, the first message (for a given type_url) of a reconnected gRPC stream 276 // has a third role: informing the server of the resources (and their versions) 277 // that the client already possesses, using the initial_resource_versions field. 278 // 279 // As with state-of-the-world, when multiple resource types are multiplexed (ADS), 280 // all requests/acknowledgments/updates are logically walled off by type_url: 281 // a Cluster ACK exists in a completely separate world from a prior Route NACK. 282 // In particular, initial_resource_versions being sent at the "start" of every 283 // gRPC stream actually entails a message for each type_url, each with its own 284 // initial_resource_versions. 285 type DeltaDiscoveryRequest struct { 286 // The node making the request. 287 Node *core.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` 288 // Type of the resource that is being requested, e.g. 289 // "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment". 290 TypeUrl string `protobuf:"bytes,2,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` 291 // DeltaDiscoveryRequests allow the client to add or remove individual 292 // resources to the set of tracked resources in the context of a stream. 293 // All resource names in the resource_names_subscribe list are added to the 294 // set of tracked resources and all resource names in the resource_names_unsubscribe 295 // list are removed from the set of tracked resources. 296 // 297 // *Unlike* state-of-the-world xDS, an empty resource_names_subscribe or 298 // resource_names_unsubscribe list simply means that no resources are to be 299 // added or removed to the resource list. 300 // *Like* state-of-the-world xDS, the server must send updates for all tracked 301 // resources, but can also send updates for resources the client has not subscribed to. 302 // 303 // NOTE: the server must respond with all resources listed in resource_names_subscribe, 304 // even if it believes the client has the most recent version of them. The reason: 305 // the client may have dropped them, but then regained interest before it had a chance 306 // to send the unsubscribe message. See DeltaSubscriptionStateTest.RemoveThenAdd. 307 // 308 // These two fields can be set in any DeltaDiscoveryRequest, including ACKs 309 // and initial_resource_versions. 310 // 311 // A list of Resource names to add to the list of tracked resources. 312 ResourceNamesSubscribe []string `protobuf:"bytes,3,rep,name=resource_names_subscribe,json=resourceNamesSubscribe,proto3" json:"resource_names_subscribe,omitempty"` 313 // A list of Resource names to remove from the list of tracked resources. 314 ResourceNamesUnsubscribe []string `protobuf:"bytes,4,rep,name=resource_names_unsubscribe,json=resourceNamesUnsubscribe,proto3" json:"resource_names_unsubscribe,omitempty"` 315 // Informs the server of the versions of the resources the xDS client knows of, to enable the 316 // client to continue the same logical xDS session even in the face of gRPC stream reconnection. 317 // It will not be populated: [1] in the very first stream of a session, since the client will 318 // not yet have any resources, [2] in any message after the first in a stream (for a given 319 // type_url), since the server will already be correctly tracking the client's state. 320 // (In ADS, the first message *of each type_url* of a reconnected stream populates this map.) 321 // The map's keys are names of xDS resources known to the xDS client. 322 // The map's values are opaque resource versions. 323 InitialResourceVersions map[string]string `protobuf:"bytes,5,rep,name=initial_resource_versions,json=initialResourceVersions,proto3" json:"initial_resource_versions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 324 // When the DeltaDiscoveryRequest is a ACK or NACK message in response 325 // to a previous DeltaDiscoveryResponse, the response_nonce must be the 326 // nonce in the DeltaDiscoveryResponse. 327 // Otherwise response_nonce must be omitted. 328 ResponseNonce string `protobuf:"bytes,6,opt,name=response_nonce,json=responseNonce,proto3" json:"response_nonce,omitempty"` 329 // This is populated when the previous :ref:`DiscoveryResponse <envoy_api_msg_DiscoveryResponse>` 330 // failed to update configuration. The *message* field in *error_details* 331 // provides the Envoy internal exception related to the failure. 332 ErrorDetail *rpc.Status `protobuf:"bytes,7,opt,name=error_detail,json=errorDetail,proto3" json:"error_detail,omitempty"` 333 XXX_NoUnkeyedLiteral struct{} `json:"-"` 334 XXX_unrecognized []byte `json:"-"` 335 XXX_sizecache int32 `json:"-"` 336 } 337 338 func (m *DeltaDiscoveryRequest) Reset() { *m = DeltaDiscoveryRequest{} } 339 func (m *DeltaDiscoveryRequest) String() string { return proto.CompactTextString(m) } 340 func (*DeltaDiscoveryRequest) ProtoMessage() {} 341 func (*DeltaDiscoveryRequest) Descriptor() ([]byte, []int) { 342 return fileDescriptor_2c7365e287e5c035, []int{2} 343 } 344 func (m *DeltaDiscoveryRequest) XXX_Unmarshal(b []byte) error { 345 return m.Unmarshal(b) 346 } 347 func (m *DeltaDiscoveryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 348 b = b[:cap(b)] 349 n, err := m.MarshalTo(b) 350 if err != nil { 351 return nil, err 352 } 353 return b[:n], nil 354 } 355 func (m *DeltaDiscoveryRequest) XXX_Merge(src proto.Message) { 356 xxx_messageInfo_DeltaDiscoveryRequest.Merge(m, src) 357 } 358 func (m *DeltaDiscoveryRequest) XXX_Size() int { 359 return m.Size() 360 } 361 func (m *DeltaDiscoveryRequest) XXX_DiscardUnknown() { 362 xxx_messageInfo_DeltaDiscoveryRequest.DiscardUnknown(m) 363 } 364 365 var xxx_messageInfo_DeltaDiscoveryRequest proto.InternalMessageInfo 366 367 func (m *DeltaDiscoveryRequest) GetNode() *core.Node { 368 if m != nil { 369 return m.Node 370 } 371 return nil 372 } 373 374 func (m *DeltaDiscoveryRequest) GetTypeUrl() string { 375 if m != nil { 376 return m.TypeUrl 377 } 378 return "" 379 } 380 381 func (m *DeltaDiscoveryRequest) GetResourceNamesSubscribe() []string { 382 if m != nil { 383 return m.ResourceNamesSubscribe 384 } 385 return nil 386 } 387 388 func (m *DeltaDiscoveryRequest) GetResourceNamesUnsubscribe() []string { 389 if m != nil { 390 return m.ResourceNamesUnsubscribe 391 } 392 return nil 393 } 394 395 func (m *DeltaDiscoveryRequest) GetInitialResourceVersions() map[string]string { 396 if m != nil { 397 return m.InitialResourceVersions 398 } 399 return nil 400 } 401 402 func (m *DeltaDiscoveryRequest) GetResponseNonce() string { 403 if m != nil { 404 return m.ResponseNonce 405 } 406 return "" 407 } 408 409 func (m *DeltaDiscoveryRequest) GetErrorDetail() *rpc.Status { 410 if m != nil { 411 return m.ErrorDetail 412 } 413 return nil 414 } 415 416 type DeltaDiscoveryResponse struct { 417 // The version of the response data (used for debugging). 418 SystemVersionInfo string `protobuf:"bytes,1,opt,name=system_version_info,json=systemVersionInfo,proto3" json:"system_version_info,omitempty"` 419 // The response resources. These are typed resources, whose types must match 420 // the type_url field. 421 Resources []*Resource `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` 422 // Type URL for resources. Identifies the xDS API when muxing over ADS. 423 // Must be consistent with the type_url in the Any within 'resources' if 'resources' is non-empty. 424 TypeUrl string `protobuf:"bytes,4,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` 425 // Resources names of resources that have be deleted and to be removed from the xDS Client. 426 // Removed resources for missing resources can be ignored. 427 RemovedResources []string `protobuf:"bytes,6,rep,name=removed_resources,json=removedResources,proto3" json:"removed_resources,omitempty"` 428 // The nonce provides a way for DeltaDiscoveryRequests to uniquely 429 // reference a DeltaDiscoveryResponse when (N)ACKing. The nonce is required. 430 Nonce string `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"` 431 XXX_NoUnkeyedLiteral struct{} `json:"-"` 432 XXX_unrecognized []byte `json:"-"` 433 XXX_sizecache int32 `json:"-"` 434 } 435 436 func (m *DeltaDiscoveryResponse) Reset() { *m = DeltaDiscoveryResponse{} } 437 func (m *DeltaDiscoveryResponse) String() string { return proto.CompactTextString(m) } 438 func (*DeltaDiscoveryResponse) ProtoMessage() {} 439 func (*DeltaDiscoveryResponse) Descriptor() ([]byte, []int) { 440 return fileDescriptor_2c7365e287e5c035, []int{3} 441 } 442 func (m *DeltaDiscoveryResponse) XXX_Unmarshal(b []byte) error { 443 return m.Unmarshal(b) 444 } 445 func (m *DeltaDiscoveryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 446 b = b[:cap(b)] 447 n, err := m.MarshalTo(b) 448 if err != nil { 449 return nil, err 450 } 451 return b[:n], nil 452 } 453 func (m *DeltaDiscoveryResponse) XXX_Merge(src proto.Message) { 454 xxx_messageInfo_DeltaDiscoveryResponse.Merge(m, src) 455 } 456 func (m *DeltaDiscoveryResponse) XXX_Size() int { 457 return m.Size() 458 } 459 func (m *DeltaDiscoveryResponse) XXX_DiscardUnknown() { 460 xxx_messageInfo_DeltaDiscoveryResponse.DiscardUnknown(m) 461 } 462 463 var xxx_messageInfo_DeltaDiscoveryResponse proto.InternalMessageInfo 464 465 func (m *DeltaDiscoveryResponse) GetSystemVersionInfo() string { 466 if m != nil { 467 return m.SystemVersionInfo 468 } 469 return "" 470 } 471 472 func (m *DeltaDiscoveryResponse) GetResources() []*Resource { 473 if m != nil { 474 return m.Resources 475 } 476 return nil 477 } 478 479 func (m *DeltaDiscoveryResponse) GetTypeUrl() string { 480 if m != nil { 481 return m.TypeUrl 482 } 483 return "" 484 } 485 486 func (m *DeltaDiscoveryResponse) GetRemovedResources() []string { 487 if m != nil { 488 return m.RemovedResources 489 } 490 return nil 491 } 492 493 func (m *DeltaDiscoveryResponse) GetNonce() string { 494 if m != nil { 495 return m.Nonce 496 } 497 return "" 498 } 499 500 type Resource struct { 501 // The resource's name, to distinguish it from others of the same type of resource. 502 Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` 503 // [#not-implemented-hide:] 504 // The aliases are a list of other names that this resource can go by. 505 Aliases []string `protobuf:"bytes,4,rep,name=aliases,proto3" json:"aliases,omitempty"` 506 // The resource level version. It allows xDS to track the state of individual 507 // resources. 508 Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` 509 // The resource being tracked. 510 Resource *types.Any `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` 511 XXX_NoUnkeyedLiteral struct{} `json:"-"` 512 XXX_unrecognized []byte `json:"-"` 513 XXX_sizecache int32 `json:"-"` 514 } 515 516 func (m *Resource) Reset() { *m = Resource{} } 517 func (m *Resource) String() string { return proto.CompactTextString(m) } 518 func (*Resource) ProtoMessage() {} 519 func (*Resource) Descriptor() ([]byte, []int) { 520 return fileDescriptor_2c7365e287e5c035, []int{4} 521 } 522 func (m *Resource) XXX_Unmarshal(b []byte) error { 523 return m.Unmarshal(b) 524 } 525 func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 526 b = b[:cap(b)] 527 n, err := m.MarshalTo(b) 528 if err != nil { 529 return nil, err 530 } 531 return b[:n], nil 532 } 533 func (m *Resource) XXX_Merge(src proto.Message) { 534 xxx_messageInfo_Resource.Merge(m, src) 535 } 536 func (m *Resource) XXX_Size() int { 537 return m.Size() 538 } 539 func (m *Resource) XXX_DiscardUnknown() { 540 xxx_messageInfo_Resource.DiscardUnknown(m) 541 } 542 543 var xxx_messageInfo_Resource proto.InternalMessageInfo 544 545 func (m *Resource) GetName() string { 546 if m != nil { 547 return m.Name 548 } 549 return "" 550 } 551 552 func (m *Resource) GetAliases() []string { 553 if m != nil { 554 return m.Aliases 555 } 556 return nil 557 } 558 559 func (m *Resource) GetVersion() string { 560 if m != nil { 561 return m.Version 562 } 563 return "" 564 } 565 566 func (m *Resource) GetResource() *types.Any { 567 if m != nil { 568 return m.Resource 569 } 570 return nil 571 } 572 573 func init() { 574 proto.RegisterType((*DiscoveryRequest)(nil), "envoy.api.v2.DiscoveryRequest") 575 proto.RegisterType((*DiscoveryResponse)(nil), "envoy.api.v2.DiscoveryResponse") 576 proto.RegisterType((*DeltaDiscoveryRequest)(nil), "envoy.api.v2.DeltaDiscoveryRequest") 577 proto.RegisterMapType((map[string]string)(nil), "envoy.api.v2.DeltaDiscoveryRequest.InitialResourceVersionsEntry") 578 proto.RegisterType((*DeltaDiscoveryResponse)(nil), "envoy.api.v2.DeltaDiscoveryResponse") 579 proto.RegisterType((*Resource)(nil), "envoy.api.v2.Resource") 580 } 581 582 func init() { proto.RegisterFile("envoy/api/v2/discovery.proto", fileDescriptor_2c7365e287e5c035) } 583 584 var fileDescriptor_2c7365e287e5c035 = []byte{ 585 // 698 bytes of a gzipped FileDescriptorProto 586 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x6b, 0xdb, 0x4c, 587 0x10, 0x65, 0x6d, 0xc7, 0xb1, 0xd7, 0x4e, 0x48, 0xf6, 0xcb, 0xe7, 0x28, 0x26, 0xb8, 0xae, 0xa1, 588 0x60, 0x08, 0x48, 0xc5, 0x6d, 0x21, 0x94, 0x1e, 0xda, 0xd4, 0x2d, 0xa4, 0x87, 0x10, 0x14, 0x92, 589 0x43, 0x2f, 0x62, 0x2d, 0x4f, 0x8c, 0xa8, 0xb2, 0xab, 0xee, 0x4a, 0xa2, 0x82, 0x9e, 0x4a, 0x7f, 590 0x4c, 0x7f, 0x4a, 0x8f, 0x3d, 0xf6, 0xd0, 0x43, 0xf1, 0xbf, 0xe8, 0xa9, 0x45, 0xab, 0x95, 0x6d, 591 0x25, 0x22, 0xf8, 0xb6, 0xb3, 0xf3, 0xf6, 0x69, 0x66, 0xde, 0x1b, 0xe1, 0x43, 0x60, 0x31, 0x4f, 592 0x2c, 0x1a, 0x78, 0x56, 0x3c, 0xb2, 0xa6, 0x9e, 0x74, 0x79, 0x0c, 0x22, 0x31, 0x03, 0xc1, 0x43, 593 0x4e, 0xda, 0x2a, 0x6b, 0xd2, 0xc0, 0x33, 0xe3, 0x51, 0xb7, 0x88, 0x75, 0xb9, 0x00, 0x6b, 0x42, 594 0x25, 0x64, 0xd8, 0xee, 0xc1, 0x8c, 0xf3, 0x99, 0x0f, 0x96, 0x8a, 0x26, 0xd1, 0xb5, 0x45, 0x99, 595 0xa6, 0xe9, 0xee, 0xeb, 0x94, 0x08, 0x5c, 0x4b, 0x86, 0x34, 0x8c, 0xa4, 0x4e, 0xec, 0xcd, 0xf8, 596 0x8c, 0xab, 0xa3, 0x95, 0x9e, 0xb2, 0xdb, 0xc1, 0x97, 0x0a, 0xde, 0x19, 0xe7, 0x95, 0xd8, 0xf0, 597 0x31, 0x02, 0x19, 0x92, 0x87, 0xb8, 0x1d, 0x83, 0x90, 0x1e, 0x67, 0x8e, 0xc7, 0xae, 0xb9, 0x81, 598 0xfa, 0x68, 0xd8, 0xb4, 0x5b, 0xfa, 0xee, 0x94, 0x5d, 0x73, 0x72, 0x84, 0x6b, 0x8c, 0x4f, 0xc1, 599 0xa8, 0xf4, 0xd1, 0xb0, 0x35, 0xda, 0x37, 0x57, 0x8b, 0x37, 0xd3, 0x72, 0xcd, 0x33, 0x3e, 0x05, 600 0x5b, 0x81, 0xc8, 0x23, 0xbc, 0x2d, 0x40, 0xf2, 0x48, 0xb8, 0xe0, 0x30, 0x7a, 0x03, 0xd2, 0xa8, 601 0xf6, 0xab, 0xc3, 0xa6, 0xbd, 0x95, 0xdf, 0x9e, 0xa5, 0x97, 0xe4, 0x00, 0x37, 0xc2, 0x24, 0x00, 602 0x27, 0x12, 0xbe, 0x51, 0x53, 0x9f, 0xdc, 0x4c, 0xe3, 0x4b, 0xe1, 0x6b, 0x86, 0x80, 0x33, 0x09, 603 0x0e, 0xe3, 0xcc, 0x05, 0x63, 0x43, 0x01, 0xb6, 0xf2, 0xdb, 0xb3, 0xf4, 0x92, 0x3c, 0xc3, 0x6d, 604 0x10, 0x82, 0x0b, 0x67, 0x0a, 0x21, 0xf5, 0x7c, 0xa3, 0xae, 0xaa, 0x23, 0x66, 0x36, 0x13, 0x53, 605 0x04, 0xae, 0x79, 0xa1, 0x66, 0x62, 0xb7, 0x14, 0x6e, 0xac, 0x60, 0x83, 0x3f, 0x08, 0xef, 0xae, 606 0x0c, 0x21, 0x63, 0x5c, 0x67, 0x0a, 0x23, 0xdc, 0xcc, 0x5b, 0x90, 0x46, 0xa5, 0x5f, 0x1d, 0xb6, 607 0x46, 0x7b, 0xf9, 0xc7, 0x72, 0x6d, 0xcc, 0x57, 0x2c, 0xb1, 0x97, 0x30, 0xd2, 0xc1, 0x75, 0x97, 608 0x32, 0x2a, 0x12, 0xa3, 0xda, 0x47, 0xc3, 0x86, 0xad, 0xa3, 0xfb, 0xba, 0xdf, 0xc3, 0x1b, 0xab, 609 0x4d, 0x67, 0x01, 0x19, 0xe3, 0x2d, 0x97, 0xb3, 0x50, 0x70, 0xdf, 0x09, 0x7c, 0xca, 0x40, 0x77, 610 0xfb, 0xa0, 0x44, 0x8b, 0xd7, 0x19, 0xee, 0x3c, 0x85, 0xd9, 0x6d, 0x77, 0x25, 0x1a, 0xfc, 0xad, 611 0xe2, 0xff, 0xc7, 0xe0, 0x87, 0xf4, 0x8e, 0x0b, 0x72, 0x89, 0xd1, 0x3a, 0x12, 0xaf, 0x56, 0x5f, 612 0x29, 0x56, 0x7f, 0x8c, 0x8d, 0xa2, 0xfa, 0x8e, 0x8c, 0x26, 0xd2, 0x15, 0xde, 0x04, 0xb4, 0x0f, 613 0x3a, 0x05, 0x1f, 0x5c, 0xe4, 0x59, 0xf2, 0x02, 0x77, 0x6f, 0xbd, 0x8c, 0xd8, 0xf2, 0x6d, 0x4d, 614 0xbd, 0x35, 0x0a, 0x6f, 0x2f, 0x97, 0x79, 0xf2, 0x19, 0x1f, 0x78, 0xcc, 0x0b, 0x3d, 0xea, 0x3b, 615 0x0b, 0x16, 0x2d, 0x9e, 0x34, 0x36, 0x94, 0x58, 0x2f, 0x8b, 0x4d, 0x95, 0xce, 0xc1, 0x3c, 0xcd, 616 0x48, 0x6c, 0xcd, 0x71, 0xa5, 0x29, 0xde, 0xb0, 0x50, 0x24, 0xf6, 0xbe, 0x57, 0x9e, 0x2d, 0x71, 617 0x6c, 0x7d, 0x1d, 0xc7, 0x6e, 0xae, 0xe5, 0xd8, 0xee, 0x3b, 0x7c, 0x78, 0x5f, 0x59, 0x64, 0x07, 618 0x57, 0x3f, 0x40, 0xa2, 0x2d, 0x9b, 0x1e, 0x53, 0x0f, 0xc5, 0xd4, 0x8f, 0x40, 0xab, 0x93, 0x05, 619 0xcf, 0x2b, 0xc7, 0x68, 0xf0, 0x0b, 0xe1, 0xce, 0xed, 0xce, 0xf5, 0x0a, 0x98, 0xf8, 0x3f, 0x99, 620 0xc8, 0x10, 0x6e, 0x9c, 0x92, 0x4d, 0xd8, 0xcd, 0x52, 0x57, 0x2b, 0xfb, 0xf0, 0xf4, 0xee, 0x3e, 621 0x74, 0x8a, 0x23, 0xce, 0xcb, 0x5d, 0xdd, 0x88, 0x7b, 0x9c, 0x7f, 0x84, 0x77, 0x05, 0xdc, 0xf0, 622 0x18, 0xa6, 0xce, 0x92, 0xb8, 0xae, 0x84, 0xdf, 0xd1, 0x09, 0x7b, 0xc1, 0x53, 0xba, 0x26, 0x83, 623 0xaf, 0x08, 0x37, 0x72, 0x0c, 0x21, 0xb8, 0x96, 0x1a, 0x49, 0xad, 0x5e, 0xd3, 0x56, 0x67, 0x62, 624 0xe0, 0x4d, 0xea, 0x7b, 0x54, 0x82, 0xd4, 0x96, 0xca, 0xc3, 0x34, 0xa3, 0xfb, 0xd6, 0x2d, 0xe7, 625 0x21, 0x79, 0x8c, 0x1b, 0x79, 0x3d, 0xfa, 0x17, 0x58, 0xbe, 0xf7, 0x0b, 0xd4, 0xc9, 0xdb, 0x6f, 626 0xf3, 0x1e, 0xfa, 0x3e, 0xef, 0xa1, 0x1f, 0xf3, 0x1e, 0xfa, 0x39, 0xef, 0xa1, 0xdf, 0xf3, 0x1e, 627 0xc2, 0x5d, 0x8f, 0x67, 0xf3, 0x09, 0x04, 0xff, 0x94, 0x14, 0x46, 0x75, 0xb2, 0xbd, 0xd0, 0xe3, 628 0x3c, 0xa5, 0x3c, 0x47, 0xef, 0x2b, 0xf1, 0x68, 0x52, 0x57, 0xfc, 0x4f, 0xfe, 0x05, 0x00, 0x00, 629 0xff, 0xff, 0x85, 0x0a, 0x39, 0xfc, 0x4d, 0x06, 0x00, 0x00, 630 } 631 632 func (this *DiscoveryRequest) Equal(that interface{}) bool { 633 if that == nil { 634 return this == nil 635 } 636 637 that1, ok := that.(*DiscoveryRequest) 638 if !ok { 639 that2, ok := that.(DiscoveryRequest) 640 if ok { 641 that1 = &that2 642 } else { 643 return false 644 } 645 } 646 if that1 == nil { 647 return this == nil 648 } else if this == nil { 649 return false 650 } 651 if this.VersionInfo != that1.VersionInfo { 652 return false 653 } 654 if !this.Node.Equal(that1.Node) { 655 return false 656 } 657 if len(this.ResourceNames) != len(that1.ResourceNames) { 658 return false 659 } 660 for i := range this.ResourceNames { 661 if this.ResourceNames[i] != that1.ResourceNames[i] { 662 return false 663 } 664 } 665 if this.TypeUrl != that1.TypeUrl { 666 return false 667 } 668 if this.ResponseNonce != that1.ResponseNonce { 669 return false 670 } 671 if !this.ErrorDetail.Equal(that1.ErrorDetail) { 672 return false 673 } 674 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 675 return false 676 } 677 return true 678 } 679 func (this *DiscoveryResponse) Equal(that interface{}) bool { 680 if that == nil { 681 return this == nil 682 } 683 684 that1, ok := that.(*DiscoveryResponse) 685 if !ok { 686 that2, ok := that.(DiscoveryResponse) 687 if ok { 688 that1 = &that2 689 } else { 690 return false 691 } 692 } 693 if that1 == nil { 694 return this == nil 695 } else if this == nil { 696 return false 697 } 698 if this.VersionInfo != that1.VersionInfo { 699 return false 700 } 701 if len(this.Resources) != len(that1.Resources) { 702 return false 703 } 704 for i := range this.Resources { 705 if !this.Resources[i].Equal(that1.Resources[i]) { 706 return false 707 } 708 } 709 if this.Canary != that1.Canary { 710 return false 711 } 712 if this.TypeUrl != that1.TypeUrl { 713 return false 714 } 715 if this.Nonce != that1.Nonce { 716 return false 717 } 718 if !this.ControlPlane.Equal(that1.ControlPlane) { 719 return false 720 } 721 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 722 return false 723 } 724 return true 725 } 726 func (this *DeltaDiscoveryRequest) Equal(that interface{}) bool { 727 if that == nil { 728 return this == nil 729 } 730 731 that1, ok := that.(*DeltaDiscoveryRequest) 732 if !ok { 733 that2, ok := that.(DeltaDiscoveryRequest) 734 if ok { 735 that1 = &that2 736 } else { 737 return false 738 } 739 } 740 if that1 == nil { 741 return this == nil 742 } else if this == nil { 743 return false 744 } 745 if !this.Node.Equal(that1.Node) { 746 return false 747 } 748 if this.TypeUrl != that1.TypeUrl { 749 return false 750 } 751 if len(this.ResourceNamesSubscribe) != len(that1.ResourceNamesSubscribe) { 752 return false 753 } 754 for i := range this.ResourceNamesSubscribe { 755 if this.ResourceNamesSubscribe[i] != that1.ResourceNamesSubscribe[i] { 756 return false 757 } 758 } 759 if len(this.ResourceNamesUnsubscribe) != len(that1.ResourceNamesUnsubscribe) { 760 return false 761 } 762 for i := range this.ResourceNamesUnsubscribe { 763 if this.ResourceNamesUnsubscribe[i] != that1.ResourceNamesUnsubscribe[i] { 764 return false 765 } 766 } 767 if len(this.InitialResourceVersions) != len(that1.InitialResourceVersions) { 768 return false 769 } 770 for i := range this.InitialResourceVersions { 771 if this.InitialResourceVersions[i] != that1.InitialResourceVersions[i] { 772 return false 773 } 774 } 775 if this.ResponseNonce != that1.ResponseNonce { 776 return false 777 } 778 if !this.ErrorDetail.Equal(that1.ErrorDetail) { 779 return false 780 } 781 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 782 return false 783 } 784 return true 785 } 786 func (this *DeltaDiscoveryResponse) Equal(that interface{}) bool { 787 if that == nil { 788 return this == nil 789 } 790 791 that1, ok := that.(*DeltaDiscoveryResponse) 792 if !ok { 793 that2, ok := that.(DeltaDiscoveryResponse) 794 if ok { 795 that1 = &that2 796 } else { 797 return false 798 } 799 } 800 if that1 == nil { 801 return this == nil 802 } else if this == nil { 803 return false 804 } 805 if this.SystemVersionInfo != that1.SystemVersionInfo { 806 return false 807 } 808 if len(this.Resources) != len(that1.Resources) { 809 return false 810 } 811 for i := range this.Resources { 812 if !this.Resources[i].Equal(that1.Resources[i]) { 813 return false 814 } 815 } 816 if this.TypeUrl != that1.TypeUrl { 817 return false 818 } 819 if len(this.RemovedResources) != len(that1.RemovedResources) { 820 return false 821 } 822 for i := range this.RemovedResources { 823 if this.RemovedResources[i] != that1.RemovedResources[i] { 824 return false 825 } 826 } 827 if this.Nonce != that1.Nonce { 828 return false 829 } 830 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 831 return false 832 } 833 return true 834 } 835 func (this *Resource) Equal(that interface{}) bool { 836 if that == nil { 837 return this == nil 838 } 839 840 that1, ok := that.(*Resource) 841 if !ok { 842 that2, ok := that.(Resource) 843 if ok { 844 that1 = &that2 845 } else { 846 return false 847 } 848 } 849 if that1 == nil { 850 return this == nil 851 } else if this == nil { 852 return false 853 } 854 if this.Name != that1.Name { 855 return false 856 } 857 if len(this.Aliases) != len(that1.Aliases) { 858 return false 859 } 860 for i := range this.Aliases { 861 if this.Aliases[i] != that1.Aliases[i] { 862 return false 863 } 864 } 865 if this.Version != that1.Version { 866 return false 867 } 868 if !this.Resource.Equal(that1.Resource) { 869 return false 870 } 871 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 872 return false 873 } 874 return true 875 } 876 func (m *DiscoveryRequest) Marshal() (dAtA []byte, err error) { 877 size := m.Size() 878 dAtA = make([]byte, size) 879 n, err := m.MarshalTo(dAtA) 880 if err != nil { 881 return nil, err 882 } 883 return dAtA[:n], nil 884 } 885 886 func (m *DiscoveryRequest) MarshalTo(dAtA []byte) (int, error) { 887 var i int 888 _ = i 889 var l int 890 _ = l 891 if len(m.VersionInfo) > 0 { 892 dAtA[i] = 0xa 893 i++ 894 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.VersionInfo))) 895 i += copy(dAtA[i:], m.VersionInfo) 896 } 897 if m.Node != nil { 898 dAtA[i] = 0x12 899 i++ 900 i = encodeVarintDiscovery(dAtA, i, uint64(m.Node.Size())) 901 n1, err1 := m.Node.MarshalTo(dAtA[i:]) 902 if err1 != nil { 903 return 0, err1 904 } 905 i += n1 906 } 907 if len(m.ResourceNames) > 0 { 908 for _, s := range m.ResourceNames { 909 dAtA[i] = 0x1a 910 i++ 911 l = len(s) 912 for l >= 1<<7 { 913 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 914 l >>= 7 915 i++ 916 } 917 dAtA[i] = uint8(l) 918 i++ 919 i += copy(dAtA[i:], s) 920 } 921 } 922 if len(m.TypeUrl) > 0 { 923 dAtA[i] = 0x22 924 i++ 925 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.TypeUrl))) 926 i += copy(dAtA[i:], m.TypeUrl) 927 } 928 if len(m.ResponseNonce) > 0 { 929 dAtA[i] = 0x2a 930 i++ 931 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.ResponseNonce))) 932 i += copy(dAtA[i:], m.ResponseNonce) 933 } 934 if m.ErrorDetail != nil { 935 dAtA[i] = 0x32 936 i++ 937 i = encodeVarintDiscovery(dAtA, i, uint64(m.ErrorDetail.Size())) 938 n2, err2 := m.ErrorDetail.MarshalTo(dAtA[i:]) 939 if err2 != nil { 940 return 0, err2 941 } 942 i += n2 943 } 944 if m.XXX_unrecognized != nil { 945 i += copy(dAtA[i:], m.XXX_unrecognized) 946 } 947 return i, nil 948 } 949 950 func (m *DiscoveryResponse) Marshal() (dAtA []byte, err error) { 951 size := m.Size() 952 dAtA = make([]byte, size) 953 n, err := m.MarshalTo(dAtA) 954 if err != nil { 955 return nil, err 956 } 957 return dAtA[:n], nil 958 } 959 960 func (m *DiscoveryResponse) MarshalTo(dAtA []byte) (int, error) { 961 var i int 962 _ = i 963 var l int 964 _ = l 965 if len(m.VersionInfo) > 0 { 966 dAtA[i] = 0xa 967 i++ 968 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.VersionInfo))) 969 i += copy(dAtA[i:], m.VersionInfo) 970 } 971 if len(m.Resources) > 0 { 972 for _, msg := range m.Resources { 973 dAtA[i] = 0x12 974 i++ 975 i = encodeVarintDiscovery(dAtA, i, uint64(msg.Size())) 976 n, err := msg.MarshalTo(dAtA[i:]) 977 if err != nil { 978 return 0, err 979 } 980 i += n 981 } 982 } 983 if m.Canary { 984 dAtA[i] = 0x18 985 i++ 986 if m.Canary { 987 dAtA[i] = 1 988 } else { 989 dAtA[i] = 0 990 } 991 i++ 992 } 993 if len(m.TypeUrl) > 0 { 994 dAtA[i] = 0x22 995 i++ 996 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.TypeUrl))) 997 i += copy(dAtA[i:], m.TypeUrl) 998 } 999 if len(m.Nonce) > 0 { 1000 dAtA[i] = 0x2a 1001 i++ 1002 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.Nonce))) 1003 i += copy(dAtA[i:], m.Nonce) 1004 } 1005 if m.ControlPlane != nil { 1006 dAtA[i] = 0x32 1007 i++ 1008 i = encodeVarintDiscovery(dAtA, i, uint64(m.ControlPlane.Size())) 1009 n3, err3 := m.ControlPlane.MarshalTo(dAtA[i:]) 1010 if err3 != nil { 1011 return 0, err3 1012 } 1013 i += n3 1014 } 1015 if m.XXX_unrecognized != nil { 1016 i += copy(dAtA[i:], m.XXX_unrecognized) 1017 } 1018 return i, nil 1019 } 1020 1021 func (m *DeltaDiscoveryRequest) Marshal() (dAtA []byte, err error) { 1022 size := m.Size() 1023 dAtA = make([]byte, size) 1024 n, err := m.MarshalTo(dAtA) 1025 if err != nil { 1026 return nil, err 1027 } 1028 return dAtA[:n], nil 1029 } 1030 1031 func (m *DeltaDiscoveryRequest) MarshalTo(dAtA []byte) (int, error) { 1032 var i int 1033 _ = i 1034 var l int 1035 _ = l 1036 if m.Node != nil { 1037 dAtA[i] = 0xa 1038 i++ 1039 i = encodeVarintDiscovery(dAtA, i, uint64(m.Node.Size())) 1040 n4, err4 := m.Node.MarshalTo(dAtA[i:]) 1041 if err4 != nil { 1042 return 0, err4 1043 } 1044 i += n4 1045 } 1046 if len(m.TypeUrl) > 0 { 1047 dAtA[i] = 0x12 1048 i++ 1049 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.TypeUrl))) 1050 i += copy(dAtA[i:], m.TypeUrl) 1051 } 1052 if len(m.ResourceNamesSubscribe) > 0 { 1053 for _, s := range m.ResourceNamesSubscribe { 1054 dAtA[i] = 0x1a 1055 i++ 1056 l = len(s) 1057 for l >= 1<<7 { 1058 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 1059 l >>= 7 1060 i++ 1061 } 1062 dAtA[i] = uint8(l) 1063 i++ 1064 i += copy(dAtA[i:], s) 1065 } 1066 } 1067 if len(m.ResourceNamesUnsubscribe) > 0 { 1068 for _, s := range m.ResourceNamesUnsubscribe { 1069 dAtA[i] = 0x22 1070 i++ 1071 l = len(s) 1072 for l >= 1<<7 { 1073 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 1074 l >>= 7 1075 i++ 1076 } 1077 dAtA[i] = uint8(l) 1078 i++ 1079 i += copy(dAtA[i:], s) 1080 } 1081 } 1082 if len(m.InitialResourceVersions) > 0 { 1083 keysForInitialResourceVersions := make([]string, 0, len(m.InitialResourceVersions)) 1084 for k, _ := range m.InitialResourceVersions { 1085 keysForInitialResourceVersions = append(keysForInitialResourceVersions, string(k)) 1086 } 1087 github_com_gogo_protobuf_sortkeys.Strings(keysForInitialResourceVersions) 1088 for _, k := range keysForInitialResourceVersions { 1089 dAtA[i] = 0x2a 1090 i++ 1091 v := m.InitialResourceVersions[string(k)] 1092 mapSize := 1 + len(k) + sovDiscovery(uint64(len(k))) + 1 + len(v) + sovDiscovery(uint64(len(v))) 1093 i = encodeVarintDiscovery(dAtA, i, uint64(mapSize)) 1094 dAtA[i] = 0xa 1095 i++ 1096 i = encodeVarintDiscovery(dAtA, i, uint64(len(k))) 1097 i += copy(dAtA[i:], k) 1098 dAtA[i] = 0x12 1099 i++ 1100 i = encodeVarintDiscovery(dAtA, i, uint64(len(v))) 1101 i += copy(dAtA[i:], v) 1102 } 1103 } 1104 if len(m.ResponseNonce) > 0 { 1105 dAtA[i] = 0x32 1106 i++ 1107 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.ResponseNonce))) 1108 i += copy(dAtA[i:], m.ResponseNonce) 1109 } 1110 if m.ErrorDetail != nil { 1111 dAtA[i] = 0x3a 1112 i++ 1113 i = encodeVarintDiscovery(dAtA, i, uint64(m.ErrorDetail.Size())) 1114 n5, err5 := m.ErrorDetail.MarshalTo(dAtA[i:]) 1115 if err5 != nil { 1116 return 0, err5 1117 } 1118 i += n5 1119 } 1120 if m.XXX_unrecognized != nil { 1121 i += copy(dAtA[i:], m.XXX_unrecognized) 1122 } 1123 return i, nil 1124 } 1125 1126 func (m *DeltaDiscoveryResponse) Marshal() (dAtA []byte, err error) { 1127 size := m.Size() 1128 dAtA = make([]byte, size) 1129 n, err := m.MarshalTo(dAtA) 1130 if err != nil { 1131 return nil, err 1132 } 1133 return dAtA[:n], nil 1134 } 1135 1136 func (m *DeltaDiscoveryResponse) MarshalTo(dAtA []byte) (int, error) { 1137 var i int 1138 _ = i 1139 var l int 1140 _ = l 1141 if len(m.SystemVersionInfo) > 0 { 1142 dAtA[i] = 0xa 1143 i++ 1144 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.SystemVersionInfo))) 1145 i += copy(dAtA[i:], m.SystemVersionInfo) 1146 } 1147 if len(m.Resources) > 0 { 1148 for _, msg := range m.Resources { 1149 dAtA[i] = 0x12 1150 i++ 1151 i = encodeVarintDiscovery(dAtA, i, uint64(msg.Size())) 1152 n, err := msg.MarshalTo(dAtA[i:]) 1153 if err != nil { 1154 return 0, err 1155 } 1156 i += n 1157 } 1158 } 1159 if len(m.TypeUrl) > 0 { 1160 dAtA[i] = 0x22 1161 i++ 1162 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.TypeUrl))) 1163 i += copy(dAtA[i:], m.TypeUrl) 1164 } 1165 if len(m.Nonce) > 0 { 1166 dAtA[i] = 0x2a 1167 i++ 1168 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.Nonce))) 1169 i += copy(dAtA[i:], m.Nonce) 1170 } 1171 if len(m.RemovedResources) > 0 { 1172 for _, s := range m.RemovedResources { 1173 dAtA[i] = 0x32 1174 i++ 1175 l = len(s) 1176 for l >= 1<<7 { 1177 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 1178 l >>= 7 1179 i++ 1180 } 1181 dAtA[i] = uint8(l) 1182 i++ 1183 i += copy(dAtA[i:], s) 1184 } 1185 } 1186 if m.XXX_unrecognized != nil { 1187 i += copy(dAtA[i:], m.XXX_unrecognized) 1188 } 1189 return i, nil 1190 } 1191 1192 func (m *Resource) Marshal() (dAtA []byte, err error) { 1193 size := m.Size() 1194 dAtA = make([]byte, size) 1195 n, err := m.MarshalTo(dAtA) 1196 if err != nil { 1197 return nil, err 1198 } 1199 return dAtA[:n], nil 1200 } 1201 1202 func (m *Resource) MarshalTo(dAtA []byte) (int, error) { 1203 var i int 1204 _ = i 1205 var l int 1206 _ = l 1207 if len(m.Version) > 0 { 1208 dAtA[i] = 0xa 1209 i++ 1210 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.Version))) 1211 i += copy(dAtA[i:], m.Version) 1212 } 1213 if m.Resource != nil { 1214 dAtA[i] = 0x12 1215 i++ 1216 i = encodeVarintDiscovery(dAtA, i, uint64(m.Resource.Size())) 1217 n6, err6 := m.Resource.MarshalTo(dAtA[i:]) 1218 if err6 != nil { 1219 return 0, err6 1220 } 1221 i += n6 1222 } 1223 if len(m.Name) > 0 { 1224 dAtA[i] = 0x1a 1225 i++ 1226 i = encodeVarintDiscovery(dAtA, i, uint64(len(m.Name))) 1227 i += copy(dAtA[i:], m.Name) 1228 } 1229 if len(m.Aliases) > 0 { 1230 for _, s := range m.Aliases { 1231 dAtA[i] = 0x22 1232 i++ 1233 l = len(s) 1234 for l >= 1<<7 { 1235 dAtA[i] = uint8(uint64(l)&0x7f | 0x80) 1236 l >>= 7 1237 i++ 1238 } 1239 dAtA[i] = uint8(l) 1240 i++ 1241 i += copy(dAtA[i:], s) 1242 } 1243 } 1244 if m.XXX_unrecognized != nil { 1245 i += copy(dAtA[i:], m.XXX_unrecognized) 1246 } 1247 return i, nil 1248 } 1249 1250 func encodeVarintDiscovery(dAtA []byte, offset int, v uint64) int { 1251 for v >= 1<<7 { 1252 dAtA[offset] = uint8(v&0x7f | 0x80) 1253 v >>= 7 1254 offset++ 1255 } 1256 dAtA[offset] = uint8(v) 1257 return offset + 1 1258 } 1259 func (m *DiscoveryRequest) Size() (n int) { 1260 if m == nil { 1261 return 0 1262 } 1263 var l int 1264 _ = l 1265 l = len(m.VersionInfo) 1266 if l > 0 { 1267 n += 1 + l + sovDiscovery(uint64(l)) 1268 } 1269 if m.Node != nil { 1270 l = m.Node.Size() 1271 n += 1 + l + sovDiscovery(uint64(l)) 1272 } 1273 if len(m.ResourceNames) > 0 { 1274 for _, s := range m.ResourceNames { 1275 l = len(s) 1276 n += 1 + l + sovDiscovery(uint64(l)) 1277 } 1278 } 1279 l = len(m.TypeUrl) 1280 if l > 0 { 1281 n += 1 + l + sovDiscovery(uint64(l)) 1282 } 1283 l = len(m.ResponseNonce) 1284 if l > 0 { 1285 n += 1 + l + sovDiscovery(uint64(l)) 1286 } 1287 if m.ErrorDetail != nil { 1288 l = m.ErrorDetail.Size() 1289 n += 1 + l + sovDiscovery(uint64(l)) 1290 } 1291 if m.XXX_unrecognized != nil { 1292 n += len(m.XXX_unrecognized) 1293 } 1294 return n 1295 } 1296 1297 func (m *DiscoveryResponse) Size() (n int) { 1298 if m == nil { 1299 return 0 1300 } 1301 var l int 1302 _ = l 1303 l = len(m.VersionInfo) 1304 if l > 0 { 1305 n += 1 + l + sovDiscovery(uint64(l)) 1306 } 1307 if len(m.Resources) > 0 { 1308 for _, e := range m.Resources { 1309 l = e.Size() 1310 n += 1 + l + sovDiscovery(uint64(l)) 1311 } 1312 } 1313 if m.Canary { 1314 n += 2 1315 } 1316 l = len(m.TypeUrl) 1317 if l > 0 { 1318 n += 1 + l + sovDiscovery(uint64(l)) 1319 } 1320 l = len(m.Nonce) 1321 if l > 0 { 1322 n += 1 + l + sovDiscovery(uint64(l)) 1323 } 1324 if m.ControlPlane != nil { 1325 l = m.ControlPlane.Size() 1326 n += 1 + l + sovDiscovery(uint64(l)) 1327 } 1328 if m.XXX_unrecognized != nil { 1329 n += len(m.XXX_unrecognized) 1330 } 1331 return n 1332 } 1333 1334 func (m *DeltaDiscoveryRequest) Size() (n int) { 1335 if m == nil { 1336 return 0 1337 } 1338 var l int 1339 _ = l 1340 if m.Node != nil { 1341 l = m.Node.Size() 1342 n += 1 + l + sovDiscovery(uint64(l)) 1343 } 1344 l = len(m.TypeUrl) 1345 if l > 0 { 1346 n += 1 + l + sovDiscovery(uint64(l)) 1347 } 1348 if len(m.ResourceNamesSubscribe) > 0 { 1349 for _, s := range m.ResourceNamesSubscribe { 1350 l = len(s) 1351 n += 1 + l + sovDiscovery(uint64(l)) 1352 } 1353 } 1354 if len(m.ResourceNamesUnsubscribe) > 0 { 1355 for _, s := range m.ResourceNamesUnsubscribe { 1356 l = len(s) 1357 n += 1 + l + sovDiscovery(uint64(l)) 1358 } 1359 } 1360 if len(m.InitialResourceVersions) > 0 { 1361 for k, v := range m.InitialResourceVersions { 1362 _ = k 1363 _ = v 1364 mapEntrySize := 1 + len(k) + sovDiscovery(uint64(len(k))) + 1 + len(v) + sovDiscovery(uint64(len(v))) 1365 n += mapEntrySize + 1 + sovDiscovery(uint64(mapEntrySize)) 1366 } 1367 } 1368 l = len(m.ResponseNonce) 1369 if l > 0 { 1370 n += 1 + l + sovDiscovery(uint64(l)) 1371 } 1372 if m.ErrorDetail != nil { 1373 l = m.ErrorDetail.Size() 1374 n += 1 + l + sovDiscovery(uint64(l)) 1375 } 1376 if m.XXX_unrecognized != nil { 1377 n += len(m.XXX_unrecognized) 1378 } 1379 return n 1380 } 1381 1382 func (m *DeltaDiscoveryResponse) Size() (n int) { 1383 if m == nil { 1384 return 0 1385 } 1386 var l int 1387 _ = l 1388 l = len(m.SystemVersionInfo) 1389 if l > 0 { 1390 n += 1 + l + sovDiscovery(uint64(l)) 1391 } 1392 if len(m.Resources) > 0 { 1393 for _, e := range m.Resources { 1394 l = e.Size() 1395 n += 1 + l + sovDiscovery(uint64(l)) 1396 } 1397 } 1398 l = len(m.TypeUrl) 1399 if l > 0 { 1400 n += 1 + l + sovDiscovery(uint64(l)) 1401 } 1402 l = len(m.Nonce) 1403 if l > 0 { 1404 n += 1 + l + sovDiscovery(uint64(l)) 1405 } 1406 if len(m.RemovedResources) > 0 { 1407 for _, s := range m.RemovedResources { 1408 l = len(s) 1409 n += 1 + l + sovDiscovery(uint64(l)) 1410 } 1411 } 1412 if m.XXX_unrecognized != nil { 1413 n += len(m.XXX_unrecognized) 1414 } 1415 return n 1416 } 1417 1418 func (m *Resource) Size() (n int) { 1419 if m == nil { 1420 return 0 1421 } 1422 var l int 1423 _ = l 1424 l = len(m.Version) 1425 if l > 0 { 1426 n += 1 + l + sovDiscovery(uint64(l)) 1427 } 1428 if m.Resource != nil { 1429 l = m.Resource.Size() 1430 n += 1 + l + sovDiscovery(uint64(l)) 1431 } 1432 l = len(m.Name) 1433 if l > 0 { 1434 n += 1 + l + sovDiscovery(uint64(l)) 1435 } 1436 if len(m.Aliases) > 0 { 1437 for _, s := range m.Aliases { 1438 l = len(s) 1439 n += 1 + l + sovDiscovery(uint64(l)) 1440 } 1441 } 1442 if m.XXX_unrecognized != nil { 1443 n += len(m.XXX_unrecognized) 1444 } 1445 return n 1446 } 1447 1448 func sovDiscovery(x uint64) (n int) { 1449 return (math_bits.Len64(x|1) + 6) / 7 1450 } 1451 func sozDiscovery(x uint64) (n int) { 1452 return sovDiscovery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 1453 } 1454 func (m *DiscoveryRequest) Unmarshal(dAtA []byte) error { 1455 l := len(dAtA) 1456 iNdEx := 0 1457 for iNdEx < l { 1458 preIndex := iNdEx 1459 var wire uint64 1460 for shift := uint(0); ; shift += 7 { 1461 if shift >= 64 { 1462 return ErrIntOverflowDiscovery 1463 } 1464 if iNdEx >= l { 1465 return io.ErrUnexpectedEOF 1466 } 1467 b := dAtA[iNdEx] 1468 iNdEx++ 1469 wire |= uint64(b&0x7F) << shift 1470 if b < 0x80 { 1471 break 1472 } 1473 } 1474 fieldNum := int32(wire >> 3) 1475 wireType := int(wire & 0x7) 1476 if wireType == 4 { 1477 return fmt.Errorf("proto: DiscoveryRequest: wiretype end group for non-group") 1478 } 1479 if fieldNum <= 0 { 1480 return fmt.Errorf("proto: DiscoveryRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1481 } 1482 switch fieldNum { 1483 case 1: 1484 if wireType != 2 { 1485 return fmt.Errorf("proto: wrong wireType = %d for field VersionInfo", wireType) 1486 } 1487 var stringLen uint64 1488 for shift := uint(0); ; shift += 7 { 1489 if shift >= 64 { 1490 return ErrIntOverflowDiscovery 1491 } 1492 if iNdEx >= l { 1493 return io.ErrUnexpectedEOF 1494 } 1495 b := dAtA[iNdEx] 1496 iNdEx++ 1497 stringLen |= uint64(b&0x7F) << shift 1498 if b < 0x80 { 1499 break 1500 } 1501 } 1502 intStringLen := int(stringLen) 1503 if intStringLen < 0 { 1504 return ErrInvalidLengthDiscovery 1505 } 1506 postIndex := iNdEx + intStringLen 1507 if postIndex < 0 { 1508 return ErrInvalidLengthDiscovery 1509 } 1510 if postIndex > l { 1511 return io.ErrUnexpectedEOF 1512 } 1513 m.VersionInfo = string(dAtA[iNdEx:postIndex]) 1514 iNdEx = postIndex 1515 case 2: 1516 if wireType != 2 { 1517 return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) 1518 } 1519 var msglen int 1520 for shift := uint(0); ; shift += 7 { 1521 if shift >= 64 { 1522 return ErrIntOverflowDiscovery 1523 } 1524 if iNdEx >= l { 1525 return io.ErrUnexpectedEOF 1526 } 1527 b := dAtA[iNdEx] 1528 iNdEx++ 1529 msglen |= int(b&0x7F) << shift 1530 if b < 0x80 { 1531 break 1532 } 1533 } 1534 if msglen < 0 { 1535 return ErrInvalidLengthDiscovery 1536 } 1537 postIndex := iNdEx + msglen 1538 if postIndex < 0 { 1539 return ErrInvalidLengthDiscovery 1540 } 1541 if postIndex > l { 1542 return io.ErrUnexpectedEOF 1543 } 1544 if m.Node == nil { 1545 m.Node = &core.Node{} 1546 } 1547 if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1548 return err 1549 } 1550 iNdEx = postIndex 1551 case 3: 1552 if wireType != 2 { 1553 return fmt.Errorf("proto: wrong wireType = %d for field ResourceNames", wireType) 1554 } 1555 var stringLen uint64 1556 for shift := uint(0); ; shift += 7 { 1557 if shift >= 64 { 1558 return ErrIntOverflowDiscovery 1559 } 1560 if iNdEx >= l { 1561 return io.ErrUnexpectedEOF 1562 } 1563 b := dAtA[iNdEx] 1564 iNdEx++ 1565 stringLen |= uint64(b&0x7F) << shift 1566 if b < 0x80 { 1567 break 1568 } 1569 } 1570 intStringLen := int(stringLen) 1571 if intStringLen < 0 { 1572 return ErrInvalidLengthDiscovery 1573 } 1574 postIndex := iNdEx + intStringLen 1575 if postIndex < 0 { 1576 return ErrInvalidLengthDiscovery 1577 } 1578 if postIndex > l { 1579 return io.ErrUnexpectedEOF 1580 } 1581 m.ResourceNames = append(m.ResourceNames, string(dAtA[iNdEx:postIndex])) 1582 iNdEx = postIndex 1583 case 4: 1584 if wireType != 2 { 1585 return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) 1586 } 1587 var stringLen uint64 1588 for shift := uint(0); ; shift += 7 { 1589 if shift >= 64 { 1590 return ErrIntOverflowDiscovery 1591 } 1592 if iNdEx >= l { 1593 return io.ErrUnexpectedEOF 1594 } 1595 b := dAtA[iNdEx] 1596 iNdEx++ 1597 stringLen |= uint64(b&0x7F) << shift 1598 if b < 0x80 { 1599 break 1600 } 1601 } 1602 intStringLen := int(stringLen) 1603 if intStringLen < 0 { 1604 return ErrInvalidLengthDiscovery 1605 } 1606 postIndex := iNdEx + intStringLen 1607 if postIndex < 0 { 1608 return ErrInvalidLengthDiscovery 1609 } 1610 if postIndex > l { 1611 return io.ErrUnexpectedEOF 1612 } 1613 m.TypeUrl = string(dAtA[iNdEx:postIndex]) 1614 iNdEx = postIndex 1615 case 5: 1616 if wireType != 2 { 1617 return fmt.Errorf("proto: wrong wireType = %d for field ResponseNonce", wireType) 1618 } 1619 var stringLen uint64 1620 for shift := uint(0); ; shift += 7 { 1621 if shift >= 64 { 1622 return ErrIntOverflowDiscovery 1623 } 1624 if iNdEx >= l { 1625 return io.ErrUnexpectedEOF 1626 } 1627 b := dAtA[iNdEx] 1628 iNdEx++ 1629 stringLen |= uint64(b&0x7F) << shift 1630 if b < 0x80 { 1631 break 1632 } 1633 } 1634 intStringLen := int(stringLen) 1635 if intStringLen < 0 { 1636 return ErrInvalidLengthDiscovery 1637 } 1638 postIndex := iNdEx + intStringLen 1639 if postIndex < 0 { 1640 return ErrInvalidLengthDiscovery 1641 } 1642 if postIndex > l { 1643 return io.ErrUnexpectedEOF 1644 } 1645 m.ResponseNonce = string(dAtA[iNdEx:postIndex]) 1646 iNdEx = postIndex 1647 case 6: 1648 if wireType != 2 { 1649 return fmt.Errorf("proto: wrong wireType = %d for field ErrorDetail", wireType) 1650 } 1651 var msglen int 1652 for shift := uint(0); ; shift += 7 { 1653 if shift >= 64 { 1654 return ErrIntOverflowDiscovery 1655 } 1656 if iNdEx >= l { 1657 return io.ErrUnexpectedEOF 1658 } 1659 b := dAtA[iNdEx] 1660 iNdEx++ 1661 msglen |= int(b&0x7F) << shift 1662 if b < 0x80 { 1663 break 1664 } 1665 } 1666 if msglen < 0 { 1667 return ErrInvalidLengthDiscovery 1668 } 1669 postIndex := iNdEx + msglen 1670 if postIndex < 0 { 1671 return ErrInvalidLengthDiscovery 1672 } 1673 if postIndex > l { 1674 return io.ErrUnexpectedEOF 1675 } 1676 if m.ErrorDetail == nil { 1677 m.ErrorDetail = &rpc.Status{} 1678 } 1679 if err := m.ErrorDetail.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1680 return err 1681 } 1682 iNdEx = postIndex 1683 default: 1684 iNdEx = preIndex 1685 skippy, err := skipDiscovery(dAtA[iNdEx:]) 1686 if err != nil { 1687 return err 1688 } 1689 if skippy < 0 { 1690 return ErrInvalidLengthDiscovery 1691 } 1692 if (iNdEx + skippy) < 0 { 1693 return ErrInvalidLengthDiscovery 1694 } 1695 if (iNdEx + skippy) > l { 1696 return io.ErrUnexpectedEOF 1697 } 1698 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1699 iNdEx += skippy 1700 } 1701 } 1702 1703 if iNdEx > l { 1704 return io.ErrUnexpectedEOF 1705 } 1706 return nil 1707 } 1708 func (m *DiscoveryResponse) Unmarshal(dAtA []byte) error { 1709 l := len(dAtA) 1710 iNdEx := 0 1711 for iNdEx < l { 1712 preIndex := iNdEx 1713 var wire uint64 1714 for shift := uint(0); ; shift += 7 { 1715 if shift >= 64 { 1716 return ErrIntOverflowDiscovery 1717 } 1718 if iNdEx >= l { 1719 return io.ErrUnexpectedEOF 1720 } 1721 b := dAtA[iNdEx] 1722 iNdEx++ 1723 wire |= uint64(b&0x7F) << shift 1724 if b < 0x80 { 1725 break 1726 } 1727 } 1728 fieldNum := int32(wire >> 3) 1729 wireType := int(wire & 0x7) 1730 if wireType == 4 { 1731 return fmt.Errorf("proto: DiscoveryResponse: wiretype end group for non-group") 1732 } 1733 if fieldNum <= 0 { 1734 return fmt.Errorf("proto: DiscoveryResponse: illegal tag %d (wire type %d)", fieldNum, wire) 1735 } 1736 switch fieldNum { 1737 case 1: 1738 if wireType != 2 { 1739 return fmt.Errorf("proto: wrong wireType = %d for field VersionInfo", wireType) 1740 } 1741 var stringLen uint64 1742 for shift := uint(0); ; shift += 7 { 1743 if shift >= 64 { 1744 return ErrIntOverflowDiscovery 1745 } 1746 if iNdEx >= l { 1747 return io.ErrUnexpectedEOF 1748 } 1749 b := dAtA[iNdEx] 1750 iNdEx++ 1751 stringLen |= uint64(b&0x7F) << shift 1752 if b < 0x80 { 1753 break 1754 } 1755 } 1756 intStringLen := int(stringLen) 1757 if intStringLen < 0 { 1758 return ErrInvalidLengthDiscovery 1759 } 1760 postIndex := iNdEx + intStringLen 1761 if postIndex < 0 { 1762 return ErrInvalidLengthDiscovery 1763 } 1764 if postIndex > l { 1765 return io.ErrUnexpectedEOF 1766 } 1767 m.VersionInfo = string(dAtA[iNdEx:postIndex]) 1768 iNdEx = postIndex 1769 case 2: 1770 if wireType != 2 { 1771 return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) 1772 } 1773 var msglen int 1774 for shift := uint(0); ; shift += 7 { 1775 if shift >= 64 { 1776 return ErrIntOverflowDiscovery 1777 } 1778 if iNdEx >= l { 1779 return io.ErrUnexpectedEOF 1780 } 1781 b := dAtA[iNdEx] 1782 iNdEx++ 1783 msglen |= int(b&0x7F) << shift 1784 if b < 0x80 { 1785 break 1786 } 1787 } 1788 if msglen < 0 { 1789 return ErrInvalidLengthDiscovery 1790 } 1791 postIndex := iNdEx + msglen 1792 if postIndex < 0 { 1793 return ErrInvalidLengthDiscovery 1794 } 1795 if postIndex > l { 1796 return io.ErrUnexpectedEOF 1797 } 1798 m.Resources = append(m.Resources, &types.Any{}) 1799 if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1800 return err 1801 } 1802 iNdEx = postIndex 1803 case 3: 1804 if wireType != 0 { 1805 return fmt.Errorf("proto: wrong wireType = %d for field Canary", wireType) 1806 } 1807 var v int 1808 for shift := uint(0); ; shift += 7 { 1809 if shift >= 64 { 1810 return ErrIntOverflowDiscovery 1811 } 1812 if iNdEx >= l { 1813 return io.ErrUnexpectedEOF 1814 } 1815 b := dAtA[iNdEx] 1816 iNdEx++ 1817 v |= int(b&0x7F) << shift 1818 if b < 0x80 { 1819 break 1820 } 1821 } 1822 m.Canary = bool(v != 0) 1823 case 4: 1824 if wireType != 2 { 1825 return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) 1826 } 1827 var stringLen uint64 1828 for shift := uint(0); ; shift += 7 { 1829 if shift >= 64 { 1830 return ErrIntOverflowDiscovery 1831 } 1832 if iNdEx >= l { 1833 return io.ErrUnexpectedEOF 1834 } 1835 b := dAtA[iNdEx] 1836 iNdEx++ 1837 stringLen |= uint64(b&0x7F) << shift 1838 if b < 0x80 { 1839 break 1840 } 1841 } 1842 intStringLen := int(stringLen) 1843 if intStringLen < 0 { 1844 return ErrInvalidLengthDiscovery 1845 } 1846 postIndex := iNdEx + intStringLen 1847 if postIndex < 0 { 1848 return ErrInvalidLengthDiscovery 1849 } 1850 if postIndex > l { 1851 return io.ErrUnexpectedEOF 1852 } 1853 m.TypeUrl = string(dAtA[iNdEx:postIndex]) 1854 iNdEx = postIndex 1855 case 5: 1856 if wireType != 2 { 1857 return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) 1858 } 1859 var stringLen uint64 1860 for shift := uint(0); ; shift += 7 { 1861 if shift >= 64 { 1862 return ErrIntOverflowDiscovery 1863 } 1864 if iNdEx >= l { 1865 return io.ErrUnexpectedEOF 1866 } 1867 b := dAtA[iNdEx] 1868 iNdEx++ 1869 stringLen |= uint64(b&0x7F) << shift 1870 if b < 0x80 { 1871 break 1872 } 1873 } 1874 intStringLen := int(stringLen) 1875 if intStringLen < 0 { 1876 return ErrInvalidLengthDiscovery 1877 } 1878 postIndex := iNdEx + intStringLen 1879 if postIndex < 0 { 1880 return ErrInvalidLengthDiscovery 1881 } 1882 if postIndex > l { 1883 return io.ErrUnexpectedEOF 1884 } 1885 m.Nonce = string(dAtA[iNdEx:postIndex]) 1886 iNdEx = postIndex 1887 case 6: 1888 if wireType != 2 { 1889 return fmt.Errorf("proto: wrong wireType = %d for field ControlPlane", wireType) 1890 } 1891 var msglen int 1892 for shift := uint(0); ; shift += 7 { 1893 if shift >= 64 { 1894 return ErrIntOverflowDiscovery 1895 } 1896 if iNdEx >= l { 1897 return io.ErrUnexpectedEOF 1898 } 1899 b := dAtA[iNdEx] 1900 iNdEx++ 1901 msglen |= int(b&0x7F) << shift 1902 if b < 0x80 { 1903 break 1904 } 1905 } 1906 if msglen < 0 { 1907 return ErrInvalidLengthDiscovery 1908 } 1909 postIndex := iNdEx + msglen 1910 if postIndex < 0 { 1911 return ErrInvalidLengthDiscovery 1912 } 1913 if postIndex > l { 1914 return io.ErrUnexpectedEOF 1915 } 1916 if m.ControlPlane == nil { 1917 m.ControlPlane = &core.ControlPlane{} 1918 } 1919 if err := m.ControlPlane.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 1920 return err 1921 } 1922 iNdEx = postIndex 1923 default: 1924 iNdEx = preIndex 1925 skippy, err := skipDiscovery(dAtA[iNdEx:]) 1926 if err != nil { 1927 return err 1928 } 1929 if skippy < 0 { 1930 return ErrInvalidLengthDiscovery 1931 } 1932 if (iNdEx + skippy) < 0 { 1933 return ErrInvalidLengthDiscovery 1934 } 1935 if (iNdEx + skippy) > l { 1936 return io.ErrUnexpectedEOF 1937 } 1938 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 1939 iNdEx += skippy 1940 } 1941 } 1942 1943 if iNdEx > l { 1944 return io.ErrUnexpectedEOF 1945 } 1946 return nil 1947 } 1948 func (m *DeltaDiscoveryRequest) Unmarshal(dAtA []byte) error { 1949 l := len(dAtA) 1950 iNdEx := 0 1951 for iNdEx < l { 1952 preIndex := iNdEx 1953 var wire uint64 1954 for shift := uint(0); ; shift += 7 { 1955 if shift >= 64 { 1956 return ErrIntOverflowDiscovery 1957 } 1958 if iNdEx >= l { 1959 return io.ErrUnexpectedEOF 1960 } 1961 b := dAtA[iNdEx] 1962 iNdEx++ 1963 wire |= uint64(b&0x7F) << shift 1964 if b < 0x80 { 1965 break 1966 } 1967 } 1968 fieldNum := int32(wire >> 3) 1969 wireType := int(wire & 0x7) 1970 if wireType == 4 { 1971 return fmt.Errorf("proto: DeltaDiscoveryRequest: wiretype end group for non-group") 1972 } 1973 if fieldNum <= 0 { 1974 return fmt.Errorf("proto: DeltaDiscoveryRequest: illegal tag %d (wire type %d)", fieldNum, wire) 1975 } 1976 switch fieldNum { 1977 case 1: 1978 if wireType != 2 { 1979 return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) 1980 } 1981 var msglen int 1982 for shift := uint(0); ; shift += 7 { 1983 if shift >= 64 { 1984 return ErrIntOverflowDiscovery 1985 } 1986 if iNdEx >= l { 1987 return io.ErrUnexpectedEOF 1988 } 1989 b := dAtA[iNdEx] 1990 iNdEx++ 1991 msglen |= int(b&0x7F) << shift 1992 if b < 0x80 { 1993 break 1994 } 1995 } 1996 if msglen < 0 { 1997 return ErrInvalidLengthDiscovery 1998 } 1999 postIndex := iNdEx + msglen 2000 if postIndex < 0 { 2001 return ErrInvalidLengthDiscovery 2002 } 2003 if postIndex > l { 2004 return io.ErrUnexpectedEOF 2005 } 2006 if m.Node == nil { 2007 m.Node = &core.Node{} 2008 } 2009 if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2010 return err 2011 } 2012 iNdEx = postIndex 2013 case 2: 2014 if wireType != 2 { 2015 return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) 2016 } 2017 var stringLen uint64 2018 for shift := uint(0); ; shift += 7 { 2019 if shift >= 64 { 2020 return ErrIntOverflowDiscovery 2021 } 2022 if iNdEx >= l { 2023 return io.ErrUnexpectedEOF 2024 } 2025 b := dAtA[iNdEx] 2026 iNdEx++ 2027 stringLen |= uint64(b&0x7F) << shift 2028 if b < 0x80 { 2029 break 2030 } 2031 } 2032 intStringLen := int(stringLen) 2033 if intStringLen < 0 { 2034 return ErrInvalidLengthDiscovery 2035 } 2036 postIndex := iNdEx + intStringLen 2037 if postIndex < 0 { 2038 return ErrInvalidLengthDiscovery 2039 } 2040 if postIndex > l { 2041 return io.ErrUnexpectedEOF 2042 } 2043 m.TypeUrl = string(dAtA[iNdEx:postIndex]) 2044 iNdEx = postIndex 2045 case 3: 2046 if wireType != 2 { 2047 return fmt.Errorf("proto: wrong wireType = %d for field ResourceNamesSubscribe", wireType) 2048 } 2049 var stringLen uint64 2050 for shift := uint(0); ; shift += 7 { 2051 if shift >= 64 { 2052 return ErrIntOverflowDiscovery 2053 } 2054 if iNdEx >= l { 2055 return io.ErrUnexpectedEOF 2056 } 2057 b := dAtA[iNdEx] 2058 iNdEx++ 2059 stringLen |= uint64(b&0x7F) << shift 2060 if b < 0x80 { 2061 break 2062 } 2063 } 2064 intStringLen := int(stringLen) 2065 if intStringLen < 0 { 2066 return ErrInvalidLengthDiscovery 2067 } 2068 postIndex := iNdEx + intStringLen 2069 if postIndex < 0 { 2070 return ErrInvalidLengthDiscovery 2071 } 2072 if postIndex > l { 2073 return io.ErrUnexpectedEOF 2074 } 2075 m.ResourceNamesSubscribe = append(m.ResourceNamesSubscribe, string(dAtA[iNdEx:postIndex])) 2076 iNdEx = postIndex 2077 case 4: 2078 if wireType != 2 { 2079 return fmt.Errorf("proto: wrong wireType = %d for field ResourceNamesUnsubscribe", wireType) 2080 } 2081 var stringLen uint64 2082 for shift := uint(0); ; shift += 7 { 2083 if shift >= 64 { 2084 return ErrIntOverflowDiscovery 2085 } 2086 if iNdEx >= l { 2087 return io.ErrUnexpectedEOF 2088 } 2089 b := dAtA[iNdEx] 2090 iNdEx++ 2091 stringLen |= uint64(b&0x7F) << shift 2092 if b < 0x80 { 2093 break 2094 } 2095 } 2096 intStringLen := int(stringLen) 2097 if intStringLen < 0 { 2098 return ErrInvalidLengthDiscovery 2099 } 2100 postIndex := iNdEx + intStringLen 2101 if postIndex < 0 { 2102 return ErrInvalidLengthDiscovery 2103 } 2104 if postIndex > l { 2105 return io.ErrUnexpectedEOF 2106 } 2107 m.ResourceNamesUnsubscribe = append(m.ResourceNamesUnsubscribe, string(dAtA[iNdEx:postIndex])) 2108 iNdEx = postIndex 2109 case 5: 2110 if wireType != 2 { 2111 return fmt.Errorf("proto: wrong wireType = %d for field InitialResourceVersions", wireType) 2112 } 2113 var msglen int 2114 for shift := uint(0); ; shift += 7 { 2115 if shift >= 64 { 2116 return ErrIntOverflowDiscovery 2117 } 2118 if iNdEx >= l { 2119 return io.ErrUnexpectedEOF 2120 } 2121 b := dAtA[iNdEx] 2122 iNdEx++ 2123 msglen |= int(b&0x7F) << shift 2124 if b < 0x80 { 2125 break 2126 } 2127 } 2128 if msglen < 0 { 2129 return ErrInvalidLengthDiscovery 2130 } 2131 postIndex := iNdEx + msglen 2132 if postIndex < 0 { 2133 return ErrInvalidLengthDiscovery 2134 } 2135 if postIndex > l { 2136 return io.ErrUnexpectedEOF 2137 } 2138 if m.InitialResourceVersions == nil { 2139 m.InitialResourceVersions = make(map[string]string) 2140 } 2141 var mapkey string 2142 var mapvalue string 2143 for iNdEx < postIndex { 2144 entryPreIndex := iNdEx 2145 var wire uint64 2146 for shift := uint(0); ; shift += 7 { 2147 if shift >= 64 { 2148 return ErrIntOverflowDiscovery 2149 } 2150 if iNdEx >= l { 2151 return io.ErrUnexpectedEOF 2152 } 2153 b := dAtA[iNdEx] 2154 iNdEx++ 2155 wire |= uint64(b&0x7F) << shift 2156 if b < 0x80 { 2157 break 2158 } 2159 } 2160 fieldNum := int32(wire >> 3) 2161 if fieldNum == 1 { 2162 var stringLenmapkey uint64 2163 for shift := uint(0); ; shift += 7 { 2164 if shift >= 64 { 2165 return ErrIntOverflowDiscovery 2166 } 2167 if iNdEx >= l { 2168 return io.ErrUnexpectedEOF 2169 } 2170 b := dAtA[iNdEx] 2171 iNdEx++ 2172 stringLenmapkey |= uint64(b&0x7F) << shift 2173 if b < 0x80 { 2174 break 2175 } 2176 } 2177 intStringLenmapkey := int(stringLenmapkey) 2178 if intStringLenmapkey < 0 { 2179 return ErrInvalidLengthDiscovery 2180 } 2181 postStringIndexmapkey := iNdEx + intStringLenmapkey 2182 if postStringIndexmapkey < 0 { 2183 return ErrInvalidLengthDiscovery 2184 } 2185 if postStringIndexmapkey > l { 2186 return io.ErrUnexpectedEOF 2187 } 2188 mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) 2189 iNdEx = postStringIndexmapkey 2190 } else if fieldNum == 2 { 2191 var stringLenmapvalue uint64 2192 for shift := uint(0); ; shift += 7 { 2193 if shift >= 64 { 2194 return ErrIntOverflowDiscovery 2195 } 2196 if iNdEx >= l { 2197 return io.ErrUnexpectedEOF 2198 } 2199 b := dAtA[iNdEx] 2200 iNdEx++ 2201 stringLenmapvalue |= uint64(b&0x7F) << shift 2202 if b < 0x80 { 2203 break 2204 } 2205 } 2206 intStringLenmapvalue := int(stringLenmapvalue) 2207 if intStringLenmapvalue < 0 { 2208 return ErrInvalidLengthDiscovery 2209 } 2210 postStringIndexmapvalue := iNdEx + intStringLenmapvalue 2211 if postStringIndexmapvalue < 0 { 2212 return ErrInvalidLengthDiscovery 2213 } 2214 if postStringIndexmapvalue > l { 2215 return io.ErrUnexpectedEOF 2216 } 2217 mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) 2218 iNdEx = postStringIndexmapvalue 2219 } else { 2220 iNdEx = entryPreIndex 2221 skippy, err := skipDiscovery(dAtA[iNdEx:]) 2222 if err != nil { 2223 return err 2224 } 2225 if skippy < 0 { 2226 return ErrInvalidLengthDiscovery 2227 } 2228 if (iNdEx + skippy) > postIndex { 2229 return io.ErrUnexpectedEOF 2230 } 2231 iNdEx += skippy 2232 } 2233 } 2234 m.InitialResourceVersions[mapkey] = mapvalue 2235 iNdEx = postIndex 2236 case 6: 2237 if wireType != 2 { 2238 return fmt.Errorf("proto: wrong wireType = %d for field ResponseNonce", wireType) 2239 } 2240 var stringLen uint64 2241 for shift := uint(0); ; shift += 7 { 2242 if shift >= 64 { 2243 return ErrIntOverflowDiscovery 2244 } 2245 if iNdEx >= l { 2246 return io.ErrUnexpectedEOF 2247 } 2248 b := dAtA[iNdEx] 2249 iNdEx++ 2250 stringLen |= uint64(b&0x7F) << shift 2251 if b < 0x80 { 2252 break 2253 } 2254 } 2255 intStringLen := int(stringLen) 2256 if intStringLen < 0 { 2257 return ErrInvalidLengthDiscovery 2258 } 2259 postIndex := iNdEx + intStringLen 2260 if postIndex < 0 { 2261 return ErrInvalidLengthDiscovery 2262 } 2263 if postIndex > l { 2264 return io.ErrUnexpectedEOF 2265 } 2266 m.ResponseNonce = string(dAtA[iNdEx:postIndex]) 2267 iNdEx = postIndex 2268 case 7: 2269 if wireType != 2 { 2270 return fmt.Errorf("proto: wrong wireType = %d for field ErrorDetail", wireType) 2271 } 2272 var msglen int 2273 for shift := uint(0); ; shift += 7 { 2274 if shift >= 64 { 2275 return ErrIntOverflowDiscovery 2276 } 2277 if iNdEx >= l { 2278 return io.ErrUnexpectedEOF 2279 } 2280 b := dAtA[iNdEx] 2281 iNdEx++ 2282 msglen |= int(b&0x7F) << shift 2283 if b < 0x80 { 2284 break 2285 } 2286 } 2287 if msglen < 0 { 2288 return ErrInvalidLengthDiscovery 2289 } 2290 postIndex := iNdEx + msglen 2291 if postIndex < 0 { 2292 return ErrInvalidLengthDiscovery 2293 } 2294 if postIndex > l { 2295 return io.ErrUnexpectedEOF 2296 } 2297 if m.ErrorDetail == nil { 2298 m.ErrorDetail = &rpc.Status{} 2299 } 2300 if err := m.ErrorDetail.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2301 return err 2302 } 2303 iNdEx = postIndex 2304 default: 2305 iNdEx = preIndex 2306 skippy, err := skipDiscovery(dAtA[iNdEx:]) 2307 if err != nil { 2308 return err 2309 } 2310 if skippy < 0 { 2311 return ErrInvalidLengthDiscovery 2312 } 2313 if (iNdEx + skippy) < 0 { 2314 return ErrInvalidLengthDiscovery 2315 } 2316 if (iNdEx + skippy) > l { 2317 return io.ErrUnexpectedEOF 2318 } 2319 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 2320 iNdEx += skippy 2321 } 2322 } 2323 2324 if iNdEx > l { 2325 return io.ErrUnexpectedEOF 2326 } 2327 return nil 2328 } 2329 func (m *DeltaDiscoveryResponse) Unmarshal(dAtA []byte) error { 2330 l := len(dAtA) 2331 iNdEx := 0 2332 for iNdEx < l { 2333 preIndex := iNdEx 2334 var wire uint64 2335 for shift := uint(0); ; shift += 7 { 2336 if shift >= 64 { 2337 return ErrIntOverflowDiscovery 2338 } 2339 if iNdEx >= l { 2340 return io.ErrUnexpectedEOF 2341 } 2342 b := dAtA[iNdEx] 2343 iNdEx++ 2344 wire |= uint64(b&0x7F) << shift 2345 if b < 0x80 { 2346 break 2347 } 2348 } 2349 fieldNum := int32(wire >> 3) 2350 wireType := int(wire & 0x7) 2351 if wireType == 4 { 2352 return fmt.Errorf("proto: DeltaDiscoveryResponse: wiretype end group for non-group") 2353 } 2354 if fieldNum <= 0 { 2355 return fmt.Errorf("proto: DeltaDiscoveryResponse: illegal tag %d (wire type %d)", fieldNum, wire) 2356 } 2357 switch fieldNum { 2358 case 1: 2359 if wireType != 2 { 2360 return fmt.Errorf("proto: wrong wireType = %d for field SystemVersionInfo", wireType) 2361 } 2362 var stringLen uint64 2363 for shift := uint(0); ; shift += 7 { 2364 if shift >= 64 { 2365 return ErrIntOverflowDiscovery 2366 } 2367 if iNdEx >= l { 2368 return io.ErrUnexpectedEOF 2369 } 2370 b := dAtA[iNdEx] 2371 iNdEx++ 2372 stringLen |= uint64(b&0x7F) << shift 2373 if b < 0x80 { 2374 break 2375 } 2376 } 2377 intStringLen := int(stringLen) 2378 if intStringLen < 0 { 2379 return ErrInvalidLengthDiscovery 2380 } 2381 postIndex := iNdEx + intStringLen 2382 if postIndex < 0 { 2383 return ErrInvalidLengthDiscovery 2384 } 2385 if postIndex > l { 2386 return io.ErrUnexpectedEOF 2387 } 2388 m.SystemVersionInfo = string(dAtA[iNdEx:postIndex]) 2389 iNdEx = postIndex 2390 case 2: 2391 if wireType != 2 { 2392 return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) 2393 } 2394 var msglen int 2395 for shift := uint(0); ; shift += 7 { 2396 if shift >= 64 { 2397 return ErrIntOverflowDiscovery 2398 } 2399 if iNdEx >= l { 2400 return io.ErrUnexpectedEOF 2401 } 2402 b := dAtA[iNdEx] 2403 iNdEx++ 2404 msglen |= int(b&0x7F) << shift 2405 if b < 0x80 { 2406 break 2407 } 2408 } 2409 if msglen < 0 { 2410 return ErrInvalidLengthDiscovery 2411 } 2412 postIndex := iNdEx + msglen 2413 if postIndex < 0 { 2414 return ErrInvalidLengthDiscovery 2415 } 2416 if postIndex > l { 2417 return io.ErrUnexpectedEOF 2418 } 2419 m.Resources = append(m.Resources, &Resource{}) 2420 if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2421 return err 2422 } 2423 iNdEx = postIndex 2424 case 4: 2425 if wireType != 2 { 2426 return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) 2427 } 2428 var stringLen uint64 2429 for shift := uint(0); ; shift += 7 { 2430 if shift >= 64 { 2431 return ErrIntOverflowDiscovery 2432 } 2433 if iNdEx >= l { 2434 return io.ErrUnexpectedEOF 2435 } 2436 b := dAtA[iNdEx] 2437 iNdEx++ 2438 stringLen |= uint64(b&0x7F) << shift 2439 if b < 0x80 { 2440 break 2441 } 2442 } 2443 intStringLen := int(stringLen) 2444 if intStringLen < 0 { 2445 return ErrInvalidLengthDiscovery 2446 } 2447 postIndex := iNdEx + intStringLen 2448 if postIndex < 0 { 2449 return ErrInvalidLengthDiscovery 2450 } 2451 if postIndex > l { 2452 return io.ErrUnexpectedEOF 2453 } 2454 m.TypeUrl = string(dAtA[iNdEx:postIndex]) 2455 iNdEx = postIndex 2456 case 5: 2457 if wireType != 2 { 2458 return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) 2459 } 2460 var stringLen uint64 2461 for shift := uint(0); ; shift += 7 { 2462 if shift >= 64 { 2463 return ErrIntOverflowDiscovery 2464 } 2465 if iNdEx >= l { 2466 return io.ErrUnexpectedEOF 2467 } 2468 b := dAtA[iNdEx] 2469 iNdEx++ 2470 stringLen |= uint64(b&0x7F) << shift 2471 if b < 0x80 { 2472 break 2473 } 2474 } 2475 intStringLen := int(stringLen) 2476 if intStringLen < 0 { 2477 return ErrInvalidLengthDiscovery 2478 } 2479 postIndex := iNdEx + intStringLen 2480 if postIndex < 0 { 2481 return ErrInvalidLengthDiscovery 2482 } 2483 if postIndex > l { 2484 return io.ErrUnexpectedEOF 2485 } 2486 m.Nonce = string(dAtA[iNdEx:postIndex]) 2487 iNdEx = postIndex 2488 case 6: 2489 if wireType != 2 { 2490 return fmt.Errorf("proto: wrong wireType = %d for field RemovedResources", wireType) 2491 } 2492 var stringLen uint64 2493 for shift := uint(0); ; shift += 7 { 2494 if shift >= 64 { 2495 return ErrIntOverflowDiscovery 2496 } 2497 if iNdEx >= l { 2498 return io.ErrUnexpectedEOF 2499 } 2500 b := dAtA[iNdEx] 2501 iNdEx++ 2502 stringLen |= uint64(b&0x7F) << shift 2503 if b < 0x80 { 2504 break 2505 } 2506 } 2507 intStringLen := int(stringLen) 2508 if intStringLen < 0 { 2509 return ErrInvalidLengthDiscovery 2510 } 2511 postIndex := iNdEx + intStringLen 2512 if postIndex < 0 { 2513 return ErrInvalidLengthDiscovery 2514 } 2515 if postIndex > l { 2516 return io.ErrUnexpectedEOF 2517 } 2518 m.RemovedResources = append(m.RemovedResources, string(dAtA[iNdEx:postIndex])) 2519 iNdEx = postIndex 2520 default: 2521 iNdEx = preIndex 2522 skippy, err := skipDiscovery(dAtA[iNdEx:]) 2523 if err != nil { 2524 return err 2525 } 2526 if skippy < 0 { 2527 return ErrInvalidLengthDiscovery 2528 } 2529 if (iNdEx + skippy) < 0 { 2530 return ErrInvalidLengthDiscovery 2531 } 2532 if (iNdEx + skippy) > l { 2533 return io.ErrUnexpectedEOF 2534 } 2535 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 2536 iNdEx += skippy 2537 } 2538 } 2539 2540 if iNdEx > l { 2541 return io.ErrUnexpectedEOF 2542 } 2543 return nil 2544 } 2545 func (m *Resource) Unmarshal(dAtA []byte) error { 2546 l := len(dAtA) 2547 iNdEx := 0 2548 for iNdEx < l { 2549 preIndex := iNdEx 2550 var wire uint64 2551 for shift := uint(0); ; shift += 7 { 2552 if shift >= 64 { 2553 return ErrIntOverflowDiscovery 2554 } 2555 if iNdEx >= l { 2556 return io.ErrUnexpectedEOF 2557 } 2558 b := dAtA[iNdEx] 2559 iNdEx++ 2560 wire |= uint64(b&0x7F) << shift 2561 if b < 0x80 { 2562 break 2563 } 2564 } 2565 fieldNum := int32(wire >> 3) 2566 wireType := int(wire & 0x7) 2567 if wireType == 4 { 2568 return fmt.Errorf("proto: Resource: wiretype end group for non-group") 2569 } 2570 if fieldNum <= 0 { 2571 return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire) 2572 } 2573 switch fieldNum { 2574 case 1: 2575 if wireType != 2 { 2576 return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) 2577 } 2578 var stringLen uint64 2579 for shift := uint(0); ; shift += 7 { 2580 if shift >= 64 { 2581 return ErrIntOverflowDiscovery 2582 } 2583 if iNdEx >= l { 2584 return io.ErrUnexpectedEOF 2585 } 2586 b := dAtA[iNdEx] 2587 iNdEx++ 2588 stringLen |= uint64(b&0x7F) << shift 2589 if b < 0x80 { 2590 break 2591 } 2592 } 2593 intStringLen := int(stringLen) 2594 if intStringLen < 0 { 2595 return ErrInvalidLengthDiscovery 2596 } 2597 postIndex := iNdEx + intStringLen 2598 if postIndex < 0 { 2599 return ErrInvalidLengthDiscovery 2600 } 2601 if postIndex > l { 2602 return io.ErrUnexpectedEOF 2603 } 2604 m.Version = string(dAtA[iNdEx:postIndex]) 2605 iNdEx = postIndex 2606 case 2: 2607 if wireType != 2 { 2608 return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) 2609 } 2610 var msglen int 2611 for shift := uint(0); ; shift += 7 { 2612 if shift >= 64 { 2613 return ErrIntOverflowDiscovery 2614 } 2615 if iNdEx >= l { 2616 return io.ErrUnexpectedEOF 2617 } 2618 b := dAtA[iNdEx] 2619 iNdEx++ 2620 msglen |= int(b&0x7F) << shift 2621 if b < 0x80 { 2622 break 2623 } 2624 } 2625 if msglen < 0 { 2626 return ErrInvalidLengthDiscovery 2627 } 2628 postIndex := iNdEx + msglen 2629 if postIndex < 0 { 2630 return ErrInvalidLengthDiscovery 2631 } 2632 if postIndex > l { 2633 return io.ErrUnexpectedEOF 2634 } 2635 if m.Resource == nil { 2636 m.Resource = &types.Any{} 2637 } 2638 if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 2639 return err 2640 } 2641 iNdEx = postIndex 2642 case 3: 2643 if wireType != 2 { 2644 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 2645 } 2646 var stringLen uint64 2647 for shift := uint(0); ; shift += 7 { 2648 if shift >= 64 { 2649 return ErrIntOverflowDiscovery 2650 } 2651 if iNdEx >= l { 2652 return io.ErrUnexpectedEOF 2653 } 2654 b := dAtA[iNdEx] 2655 iNdEx++ 2656 stringLen |= uint64(b&0x7F) << shift 2657 if b < 0x80 { 2658 break 2659 } 2660 } 2661 intStringLen := int(stringLen) 2662 if intStringLen < 0 { 2663 return ErrInvalidLengthDiscovery 2664 } 2665 postIndex := iNdEx + intStringLen 2666 if postIndex < 0 { 2667 return ErrInvalidLengthDiscovery 2668 } 2669 if postIndex > l { 2670 return io.ErrUnexpectedEOF 2671 } 2672 m.Name = string(dAtA[iNdEx:postIndex]) 2673 iNdEx = postIndex 2674 case 4: 2675 if wireType != 2 { 2676 return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) 2677 } 2678 var stringLen uint64 2679 for shift := uint(0); ; shift += 7 { 2680 if shift >= 64 { 2681 return ErrIntOverflowDiscovery 2682 } 2683 if iNdEx >= l { 2684 return io.ErrUnexpectedEOF 2685 } 2686 b := dAtA[iNdEx] 2687 iNdEx++ 2688 stringLen |= uint64(b&0x7F) << shift 2689 if b < 0x80 { 2690 break 2691 } 2692 } 2693 intStringLen := int(stringLen) 2694 if intStringLen < 0 { 2695 return ErrInvalidLengthDiscovery 2696 } 2697 postIndex := iNdEx + intStringLen 2698 if postIndex < 0 { 2699 return ErrInvalidLengthDiscovery 2700 } 2701 if postIndex > l { 2702 return io.ErrUnexpectedEOF 2703 } 2704 m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) 2705 iNdEx = postIndex 2706 default: 2707 iNdEx = preIndex 2708 skippy, err := skipDiscovery(dAtA[iNdEx:]) 2709 if err != nil { 2710 return err 2711 } 2712 if skippy < 0 { 2713 return ErrInvalidLengthDiscovery 2714 } 2715 if (iNdEx + skippy) < 0 { 2716 return ErrInvalidLengthDiscovery 2717 } 2718 if (iNdEx + skippy) > l { 2719 return io.ErrUnexpectedEOF 2720 } 2721 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 2722 iNdEx += skippy 2723 } 2724 } 2725 2726 if iNdEx > l { 2727 return io.ErrUnexpectedEOF 2728 } 2729 return nil 2730 } 2731 func skipDiscovery(dAtA []byte) (n int, err error) { 2732 l := len(dAtA) 2733 iNdEx := 0 2734 for iNdEx < l { 2735 var wire uint64 2736 for shift := uint(0); ; shift += 7 { 2737 if shift >= 64 { 2738 return 0, ErrIntOverflowDiscovery 2739 } 2740 if iNdEx >= l { 2741 return 0, io.ErrUnexpectedEOF 2742 } 2743 b := dAtA[iNdEx] 2744 iNdEx++ 2745 wire |= (uint64(b) & 0x7F) << shift 2746 if b < 0x80 { 2747 break 2748 } 2749 } 2750 wireType := int(wire & 0x7) 2751 switch wireType { 2752 case 0: 2753 for shift := uint(0); ; shift += 7 { 2754 if shift >= 64 { 2755 return 0, ErrIntOverflowDiscovery 2756 } 2757 if iNdEx >= l { 2758 return 0, io.ErrUnexpectedEOF 2759 } 2760 iNdEx++ 2761 if dAtA[iNdEx-1] < 0x80 { 2762 break 2763 } 2764 } 2765 return iNdEx, nil 2766 case 1: 2767 iNdEx += 8 2768 return iNdEx, nil 2769 case 2: 2770 var length int 2771 for shift := uint(0); ; shift += 7 { 2772 if shift >= 64 { 2773 return 0, ErrIntOverflowDiscovery 2774 } 2775 if iNdEx >= l { 2776 return 0, io.ErrUnexpectedEOF 2777 } 2778 b := dAtA[iNdEx] 2779 iNdEx++ 2780 length |= (int(b) & 0x7F) << shift 2781 if b < 0x80 { 2782 break 2783 } 2784 } 2785 if length < 0 { 2786 return 0, ErrInvalidLengthDiscovery 2787 } 2788 iNdEx += length 2789 if iNdEx < 0 { 2790 return 0, ErrInvalidLengthDiscovery 2791 } 2792 return iNdEx, nil 2793 case 3: 2794 for { 2795 var innerWire uint64 2796 var start int = iNdEx 2797 for shift := uint(0); ; shift += 7 { 2798 if shift >= 64 { 2799 return 0, ErrIntOverflowDiscovery 2800 } 2801 if iNdEx >= l { 2802 return 0, io.ErrUnexpectedEOF 2803 } 2804 b := dAtA[iNdEx] 2805 iNdEx++ 2806 innerWire |= (uint64(b) & 0x7F) << shift 2807 if b < 0x80 { 2808 break 2809 } 2810 } 2811 innerWireType := int(innerWire & 0x7) 2812 if innerWireType == 4 { 2813 break 2814 } 2815 next, err := skipDiscovery(dAtA[start:]) 2816 if err != nil { 2817 return 0, err 2818 } 2819 iNdEx = start + next 2820 if iNdEx < 0 { 2821 return 0, ErrInvalidLengthDiscovery 2822 } 2823 } 2824 return iNdEx, nil 2825 case 4: 2826 return iNdEx, nil 2827 case 5: 2828 iNdEx += 4 2829 return iNdEx, nil 2830 default: 2831 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 2832 } 2833 } 2834 panic("unreachable") 2835 } 2836 2837 var ( 2838 ErrInvalidLengthDiscovery = fmt.Errorf("proto: negative length found during unmarshaling") 2839 ErrIntOverflowDiscovery = fmt.Errorf("proto: integer overflow") 2840 )