github.com/kaisenlinux/docker@v0.0.0-20230510090727-ea55db55fac7/swarmkit/api/raft.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/docker/swarmkit/api/raft.proto 3 4 package api 5 6 import ( 7 context "context" 8 fmt "fmt" 9 raftpb "github.com/coreos/etcd/raft/raftpb" 10 github_com_docker_swarmkit_api_deepcopy "github.com/docker/swarmkit/api/deepcopy" 11 raftselector "github.com/docker/swarmkit/manager/raftselector" 12 proto "github.com/gogo/protobuf/proto" 13 grpc "google.golang.org/grpc" 14 codes "google.golang.org/grpc/codes" 15 metadata "google.golang.org/grpc/metadata" 16 peer "google.golang.org/grpc/peer" 17 status "google.golang.org/grpc/status" 18 io "io" 19 math "math" 20 reflect "reflect" 21 strings "strings" 22 rafttime "time" 23 ) 24 25 // Reference imports to suppress errors if they are not otherwise used. 26 var _ = proto.Marshal 27 var _ = fmt.Errorf 28 var _ = math.Inf 29 30 // This is a compile-time assertion to ensure that this generated file 31 // is compatible with the proto package it is being compiled against. 32 // A compilation error at this line likely means your copy of the 33 // proto package needs to be updated. 34 const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package 35 36 // StoreActionKind defines the operation to take on the store for the target of 37 // a storage action. 38 type StoreActionKind int32 39 40 const ( 41 StoreActionKindUnknown StoreActionKind = 0 42 StoreActionKindCreate StoreActionKind = 1 43 StoreActionKindUpdate StoreActionKind = 2 44 StoreActionKindRemove StoreActionKind = 3 45 ) 46 47 var StoreActionKind_name = map[int32]string{ 48 0: "UNKNOWN", 49 1: "STORE_ACTION_CREATE", 50 2: "STORE_ACTION_UPDATE", 51 3: "STORE_ACTION_REMOVE", 52 } 53 54 var StoreActionKind_value = map[string]int32{ 55 "UNKNOWN": 0, 56 "STORE_ACTION_CREATE": 1, 57 "STORE_ACTION_UPDATE": 2, 58 "STORE_ACTION_REMOVE": 3, 59 } 60 61 func (x StoreActionKind) String() string { 62 return proto.EnumName(StoreActionKind_name, int32(x)) 63 } 64 65 func (StoreActionKind) EnumDescriptor() ([]byte, []int) { 66 return fileDescriptor_d2c32e1e3c930c15, []int{0} 67 } 68 69 type RaftMember struct { 70 // RaftID specifies the internal ID used by the manager in a raft context, it can never be modified 71 // and is used only for information purposes 72 RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"` 73 // NodeID is the node's ID. 74 NodeID string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` 75 // Addr specifies the address of the member 76 Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"` 77 // Status provides the current status of the manager from the perspective of another manager. 78 Status RaftMemberStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status"` 79 } 80 81 func (m *RaftMember) Reset() { *m = RaftMember{} } 82 func (*RaftMember) ProtoMessage() {} 83 func (*RaftMember) Descriptor() ([]byte, []int) { 84 return fileDescriptor_d2c32e1e3c930c15, []int{0} 85 } 86 func (m *RaftMember) XXX_Unmarshal(b []byte) error { 87 return m.Unmarshal(b) 88 } 89 func (m *RaftMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 90 if deterministic { 91 return xxx_messageInfo_RaftMember.Marshal(b, m, deterministic) 92 } else { 93 b = b[:cap(b)] 94 n, err := m.MarshalTo(b) 95 if err != nil { 96 return nil, err 97 } 98 return b[:n], nil 99 } 100 } 101 func (m *RaftMember) XXX_Merge(src proto.Message) { 102 xxx_messageInfo_RaftMember.Merge(m, src) 103 } 104 func (m *RaftMember) XXX_Size() int { 105 return m.Size() 106 } 107 func (m *RaftMember) XXX_DiscardUnknown() { 108 xxx_messageInfo_RaftMember.DiscardUnknown(m) 109 } 110 111 var xxx_messageInfo_RaftMember proto.InternalMessageInfo 112 113 type JoinRequest struct { 114 // Addr specifies the address of the member 115 Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` 116 } 117 118 func (m *JoinRequest) Reset() { *m = JoinRequest{} } 119 func (*JoinRequest) ProtoMessage() {} 120 func (*JoinRequest) Descriptor() ([]byte, []int) { 121 return fileDescriptor_d2c32e1e3c930c15, []int{1} 122 } 123 func (m *JoinRequest) XXX_Unmarshal(b []byte) error { 124 return m.Unmarshal(b) 125 } 126 func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 127 if deterministic { 128 return xxx_messageInfo_JoinRequest.Marshal(b, m, deterministic) 129 } else { 130 b = b[:cap(b)] 131 n, err := m.MarshalTo(b) 132 if err != nil { 133 return nil, err 134 } 135 return b[:n], nil 136 } 137 } 138 func (m *JoinRequest) XXX_Merge(src proto.Message) { 139 xxx_messageInfo_JoinRequest.Merge(m, src) 140 } 141 func (m *JoinRequest) XXX_Size() int { 142 return m.Size() 143 } 144 func (m *JoinRequest) XXX_DiscardUnknown() { 145 xxx_messageInfo_JoinRequest.DiscardUnknown(m) 146 } 147 148 var xxx_messageInfo_JoinRequest proto.InternalMessageInfo 149 150 type JoinResponse struct { 151 // RaftID is the ID assigned to the new member. 152 RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"` 153 // Members is the membership set of the cluster. 154 Members []*RaftMember `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` 155 // RemovedMembers is a list of members that have been removed from 156 // the cluster, so the new node can avoid communicating with them. 157 RemovedMembers []uint64 `protobuf:"varint,3,rep,name=removed_members,json=removedMembers,proto3" json:"removed_members,omitempty"` 158 } 159 160 func (m *JoinResponse) Reset() { *m = JoinResponse{} } 161 func (*JoinResponse) ProtoMessage() {} 162 func (*JoinResponse) Descriptor() ([]byte, []int) { 163 return fileDescriptor_d2c32e1e3c930c15, []int{2} 164 } 165 func (m *JoinResponse) XXX_Unmarshal(b []byte) error { 166 return m.Unmarshal(b) 167 } 168 func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 169 if deterministic { 170 return xxx_messageInfo_JoinResponse.Marshal(b, m, deterministic) 171 } else { 172 b = b[:cap(b)] 173 n, err := m.MarshalTo(b) 174 if err != nil { 175 return nil, err 176 } 177 return b[:n], nil 178 } 179 } 180 func (m *JoinResponse) XXX_Merge(src proto.Message) { 181 xxx_messageInfo_JoinResponse.Merge(m, src) 182 } 183 func (m *JoinResponse) XXX_Size() int { 184 return m.Size() 185 } 186 func (m *JoinResponse) XXX_DiscardUnknown() { 187 xxx_messageInfo_JoinResponse.DiscardUnknown(m) 188 } 189 190 var xxx_messageInfo_JoinResponse proto.InternalMessageInfo 191 192 type LeaveRequest struct { 193 Node *RaftMember `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` 194 } 195 196 func (m *LeaveRequest) Reset() { *m = LeaveRequest{} } 197 func (*LeaveRequest) ProtoMessage() {} 198 func (*LeaveRequest) Descriptor() ([]byte, []int) { 199 return fileDescriptor_d2c32e1e3c930c15, []int{3} 200 } 201 func (m *LeaveRequest) XXX_Unmarshal(b []byte) error { 202 return m.Unmarshal(b) 203 } 204 func (m *LeaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 205 if deterministic { 206 return xxx_messageInfo_LeaveRequest.Marshal(b, m, deterministic) 207 } else { 208 b = b[:cap(b)] 209 n, err := m.MarshalTo(b) 210 if err != nil { 211 return nil, err 212 } 213 return b[:n], nil 214 } 215 } 216 func (m *LeaveRequest) XXX_Merge(src proto.Message) { 217 xxx_messageInfo_LeaveRequest.Merge(m, src) 218 } 219 func (m *LeaveRequest) XXX_Size() int { 220 return m.Size() 221 } 222 func (m *LeaveRequest) XXX_DiscardUnknown() { 223 xxx_messageInfo_LeaveRequest.DiscardUnknown(m) 224 } 225 226 var xxx_messageInfo_LeaveRequest proto.InternalMessageInfo 227 228 type LeaveResponse struct { 229 } 230 231 func (m *LeaveResponse) Reset() { *m = LeaveResponse{} } 232 func (*LeaveResponse) ProtoMessage() {} 233 func (*LeaveResponse) Descriptor() ([]byte, []int) { 234 return fileDescriptor_d2c32e1e3c930c15, []int{4} 235 } 236 func (m *LeaveResponse) XXX_Unmarshal(b []byte) error { 237 return m.Unmarshal(b) 238 } 239 func (m *LeaveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 240 if deterministic { 241 return xxx_messageInfo_LeaveResponse.Marshal(b, m, deterministic) 242 } else { 243 b = b[:cap(b)] 244 n, err := m.MarshalTo(b) 245 if err != nil { 246 return nil, err 247 } 248 return b[:n], nil 249 } 250 } 251 func (m *LeaveResponse) XXX_Merge(src proto.Message) { 252 xxx_messageInfo_LeaveResponse.Merge(m, src) 253 } 254 func (m *LeaveResponse) XXX_Size() int { 255 return m.Size() 256 } 257 func (m *LeaveResponse) XXX_DiscardUnknown() { 258 xxx_messageInfo_LeaveResponse.DiscardUnknown(m) 259 } 260 261 var xxx_messageInfo_LeaveResponse proto.InternalMessageInfo 262 263 type ProcessRaftMessageRequest struct { 264 Message *raftpb.Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 265 } 266 267 func (m *ProcessRaftMessageRequest) Reset() { *m = ProcessRaftMessageRequest{} } 268 func (*ProcessRaftMessageRequest) ProtoMessage() {} 269 func (*ProcessRaftMessageRequest) Descriptor() ([]byte, []int) { 270 return fileDescriptor_d2c32e1e3c930c15, []int{5} 271 } 272 func (m *ProcessRaftMessageRequest) XXX_Unmarshal(b []byte) error { 273 return m.Unmarshal(b) 274 } 275 func (m *ProcessRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 276 if deterministic { 277 return xxx_messageInfo_ProcessRaftMessageRequest.Marshal(b, m, deterministic) 278 } else { 279 b = b[:cap(b)] 280 n, err := m.MarshalTo(b) 281 if err != nil { 282 return nil, err 283 } 284 return b[:n], nil 285 } 286 } 287 func (m *ProcessRaftMessageRequest) XXX_Merge(src proto.Message) { 288 xxx_messageInfo_ProcessRaftMessageRequest.Merge(m, src) 289 } 290 func (m *ProcessRaftMessageRequest) XXX_Size() int { 291 return m.Size() 292 } 293 func (m *ProcessRaftMessageRequest) XXX_DiscardUnknown() { 294 xxx_messageInfo_ProcessRaftMessageRequest.DiscardUnknown(m) 295 } 296 297 var xxx_messageInfo_ProcessRaftMessageRequest proto.InternalMessageInfo 298 299 type ProcessRaftMessageResponse struct { 300 } 301 302 func (m *ProcessRaftMessageResponse) Reset() { *m = ProcessRaftMessageResponse{} } 303 func (*ProcessRaftMessageResponse) ProtoMessage() {} 304 func (*ProcessRaftMessageResponse) Descriptor() ([]byte, []int) { 305 return fileDescriptor_d2c32e1e3c930c15, []int{6} 306 } 307 func (m *ProcessRaftMessageResponse) XXX_Unmarshal(b []byte) error { 308 return m.Unmarshal(b) 309 } 310 func (m *ProcessRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 311 if deterministic { 312 return xxx_messageInfo_ProcessRaftMessageResponse.Marshal(b, m, deterministic) 313 } else { 314 b = b[:cap(b)] 315 n, err := m.MarshalTo(b) 316 if err != nil { 317 return nil, err 318 } 319 return b[:n], nil 320 } 321 } 322 func (m *ProcessRaftMessageResponse) XXX_Merge(src proto.Message) { 323 xxx_messageInfo_ProcessRaftMessageResponse.Merge(m, src) 324 } 325 func (m *ProcessRaftMessageResponse) XXX_Size() int { 326 return m.Size() 327 } 328 func (m *ProcessRaftMessageResponse) XXX_DiscardUnknown() { 329 xxx_messageInfo_ProcessRaftMessageResponse.DiscardUnknown(m) 330 } 331 332 var xxx_messageInfo_ProcessRaftMessageResponse proto.InternalMessageInfo 333 334 // Raft message streaming request. 335 type StreamRaftMessageRequest struct { 336 Message *raftpb.Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 337 } 338 339 func (m *StreamRaftMessageRequest) Reset() { *m = StreamRaftMessageRequest{} } 340 func (*StreamRaftMessageRequest) ProtoMessage() {} 341 func (*StreamRaftMessageRequest) Descriptor() ([]byte, []int) { 342 return fileDescriptor_d2c32e1e3c930c15, []int{7} 343 } 344 func (m *StreamRaftMessageRequest) XXX_Unmarshal(b []byte) error { 345 return m.Unmarshal(b) 346 } 347 func (m *StreamRaftMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 348 if deterministic { 349 return xxx_messageInfo_StreamRaftMessageRequest.Marshal(b, m, deterministic) 350 } else { 351 b = b[:cap(b)] 352 n, err := m.MarshalTo(b) 353 if err != nil { 354 return nil, err 355 } 356 return b[:n], nil 357 } 358 } 359 func (m *StreamRaftMessageRequest) XXX_Merge(src proto.Message) { 360 xxx_messageInfo_StreamRaftMessageRequest.Merge(m, src) 361 } 362 func (m *StreamRaftMessageRequest) XXX_Size() int { 363 return m.Size() 364 } 365 func (m *StreamRaftMessageRequest) XXX_DiscardUnknown() { 366 xxx_messageInfo_StreamRaftMessageRequest.DiscardUnknown(m) 367 } 368 369 var xxx_messageInfo_StreamRaftMessageRequest proto.InternalMessageInfo 370 371 // Raft message streaming response. 372 type StreamRaftMessageResponse struct { 373 } 374 375 func (m *StreamRaftMessageResponse) Reset() { *m = StreamRaftMessageResponse{} } 376 func (*StreamRaftMessageResponse) ProtoMessage() {} 377 func (*StreamRaftMessageResponse) Descriptor() ([]byte, []int) { 378 return fileDescriptor_d2c32e1e3c930c15, []int{8} 379 } 380 func (m *StreamRaftMessageResponse) XXX_Unmarshal(b []byte) error { 381 return m.Unmarshal(b) 382 } 383 func (m *StreamRaftMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 384 if deterministic { 385 return xxx_messageInfo_StreamRaftMessageResponse.Marshal(b, m, deterministic) 386 } else { 387 b = b[:cap(b)] 388 n, err := m.MarshalTo(b) 389 if err != nil { 390 return nil, err 391 } 392 return b[:n], nil 393 } 394 } 395 func (m *StreamRaftMessageResponse) XXX_Merge(src proto.Message) { 396 xxx_messageInfo_StreamRaftMessageResponse.Merge(m, src) 397 } 398 func (m *StreamRaftMessageResponse) XXX_Size() int { 399 return m.Size() 400 } 401 func (m *StreamRaftMessageResponse) XXX_DiscardUnknown() { 402 xxx_messageInfo_StreamRaftMessageResponse.DiscardUnknown(m) 403 } 404 405 var xxx_messageInfo_StreamRaftMessageResponse proto.InternalMessageInfo 406 407 type ResolveAddressRequest struct { 408 // raft_id is the ID to resolve to an address. 409 RaftID uint64 `protobuf:"varint,1,opt,name=raft_id,json=raftId,proto3" json:"raft_id,omitempty"` 410 } 411 412 func (m *ResolveAddressRequest) Reset() { *m = ResolveAddressRequest{} } 413 func (*ResolveAddressRequest) ProtoMessage() {} 414 func (*ResolveAddressRequest) Descriptor() ([]byte, []int) { 415 return fileDescriptor_d2c32e1e3c930c15, []int{9} 416 } 417 func (m *ResolveAddressRequest) XXX_Unmarshal(b []byte) error { 418 return m.Unmarshal(b) 419 } 420 func (m *ResolveAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 421 if deterministic { 422 return xxx_messageInfo_ResolveAddressRequest.Marshal(b, m, deterministic) 423 } else { 424 b = b[:cap(b)] 425 n, err := m.MarshalTo(b) 426 if err != nil { 427 return nil, err 428 } 429 return b[:n], nil 430 } 431 } 432 func (m *ResolveAddressRequest) XXX_Merge(src proto.Message) { 433 xxx_messageInfo_ResolveAddressRequest.Merge(m, src) 434 } 435 func (m *ResolveAddressRequest) XXX_Size() int { 436 return m.Size() 437 } 438 func (m *ResolveAddressRequest) XXX_DiscardUnknown() { 439 xxx_messageInfo_ResolveAddressRequest.DiscardUnknown(m) 440 } 441 442 var xxx_messageInfo_ResolveAddressRequest proto.InternalMessageInfo 443 444 type ResolveAddressResponse struct { 445 // Addr specifies the address of the member 446 Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` 447 } 448 449 func (m *ResolveAddressResponse) Reset() { *m = ResolveAddressResponse{} } 450 func (*ResolveAddressResponse) ProtoMessage() {} 451 func (*ResolveAddressResponse) Descriptor() ([]byte, []int) { 452 return fileDescriptor_d2c32e1e3c930c15, []int{10} 453 } 454 func (m *ResolveAddressResponse) XXX_Unmarshal(b []byte) error { 455 return m.Unmarshal(b) 456 } 457 func (m *ResolveAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 458 if deterministic { 459 return xxx_messageInfo_ResolveAddressResponse.Marshal(b, m, deterministic) 460 } else { 461 b = b[:cap(b)] 462 n, err := m.MarshalTo(b) 463 if err != nil { 464 return nil, err 465 } 466 return b[:n], nil 467 } 468 } 469 func (m *ResolveAddressResponse) XXX_Merge(src proto.Message) { 470 xxx_messageInfo_ResolveAddressResponse.Merge(m, src) 471 } 472 func (m *ResolveAddressResponse) XXX_Size() int { 473 return m.Size() 474 } 475 func (m *ResolveAddressResponse) XXX_DiscardUnknown() { 476 xxx_messageInfo_ResolveAddressResponse.DiscardUnknown(m) 477 } 478 479 var xxx_messageInfo_ResolveAddressResponse proto.InternalMessageInfo 480 481 // Contains one of many protobuf encoded objects to replicate 482 // over the raft backend with a request ID to track when the 483 // action is effectively applied 484 type InternalRaftRequest struct { 485 ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` 486 Action []StoreAction `protobuf:"bytes,2,rep,name=action,proto3" json:"action"` 487 } 488 489 func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } 490 func (*InternalRaftRequest) ProtoMessage() {} 491 func (*InternalRaftRequest) Descriptor() ([]byte, []int) { 492 return fileDescriptor_d2c32e1e3c930c15, []int{11} 493 } 494 func (m *InternalRaftRequest) XXX_Unmarshal(b []byte) error { 495 return m.Unmarshal(b) 496 } 497 func (m *InternalRaftRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 498 if deterministic { 499 return xxx_messageInfo_InternalRaftRequest.Marshal(b, m, deterministic) 500 } else { 501 b = b[:cap(b)] 502 n, err := m.MarshalTo(b) 503 if err != nil { 504 return nil, err 505 } 506 return b[:n], nil 507 } 508 } 509 func (m *InternalRaftRequest) XXX_Merge(src proto.Message) { 510 xxx_messageInfo_InternalRaftRequest.Merge(m, src) 511 } 512 func (m *InternalRaftRequest) XXX_Size() int { 513 return m.Size() 514 } 515 func (m *InternalRaftRequest) XXX_DiscardUnknown() { 516 xxx_messageInfo_InternalRaftRequest.DiscardUnknown(m) 517 } 518 519 var xxx_messageInfo_InternalRaftRequest proto.InternalMessageInfo 520 521 // StoreAction defines a target and operation to apply on the storage system. 522 type StoreAction struct { 523 Action StoreActionKind `protobuf:"varint,1,opt,name=action,proto3,enum=docker.swarmkit.v1.StoreActionKind" json:"action,omitempty"` 524 // Types that are valid to be assigned to Target: 525 // *StoreAction_Node 526 // *StoreAction_Service 527 // *StoreAction_Task 528 // *StoreAction_Network 529 // *StoreAction_Cluster 530 // *StoreAction_Secret 531 // *StoreAction_Resource 532 // *StoreAction_Extension 533 // *StoreAction_Config 534 Target isStoreAction_Target `protobuf_oneof:"target"` 535 } 536 537 func (m *StoreAction) Reset() { *m = StoreAction{} } 538 func (*StoreAction) ProtoMessage() {} 539 func (*StoreAction) Descriptor() ([]byte, []int) { 540 return fileDescriptor_d2c32e1e3c930c15, []int{12} 541 } 542 func (m *StoreAction) XXX_Unmarshal(b []byte) error { 543 return m.Unmarshal(b) 544 } 545 func (m *StoreAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 546 if deterministic { 547 return xxx_messageInfo_StoreAction.Marshal(b, m, deterministic) 548 } else { 549 b = b[:cap(b)] 550 n, err := m.MarshalTo(b) 551 if err != nil { 552 return nil, err 553 } 554 return b[:n], nil 555 } 556 } 557 func (m *StoreAction) XXX_Merge(src proto.Message) { 558 xxx_messageInfo_StoreAction.Merge(m, src) 559 } 560 func (m *StoreAction) XXX_Size() int { 561 return m.Size() 562 } 563 func (m *StoreAction) XXX_DiscardUnknown() { 564 xxx_messageInfo_StoreAction.DiscardUnknown(m) 565 } 566 567 var xxx_messageInfo_StoreAction proto.InternalMessageInfo 568 569 type isStoreAction_Target interface { 570 isStoreAction_Target() 571 MarshalTo([]byte) (int, error) 572 Size() int 573 } 574 575 type StoreAction_Node struct { 576 Node *Node `protobuf:"bytes,2,opt,name=node,proto3,oneof"` 577 } 578 type StoreAction_Service struct { 579 Service *Service `protobuf:"bytes,3,opt,name=service,proto3,oneof"` 580 } 581 type StoreAction_Task struct { 582 Task *Task `protobuf:"bytes,4,opt,name=task,proto3,oneof"` 583 } 584 type StoreAction_Network struct { 585 Network *Network `protobuf:"bytes,5,opt,name=network,proto3,oneof"` 586 } 587 type StoreAction_Cluster struct { 588 Cluster *Cluster `protobuf:"bytes,6,opt,name=cluster,proto3,oneof"` 589 } 590 type StoreAction_Secret struct { 591 Secret *Secret `protobuf:"bytes,7,opt,name=secret,proto3,oneof"` 592 } 593 type StoreAction_Resource struct { 594 Resource *Resource `protobuf:"bytes,8,opt,name=resource,proto3,oneof"` 595 } 596 type StoreAction_Extension struct { 597 Extension *Extension `protobuf:"bytes,9,opt,name=extension,proto3,oneof"` 598 } 599 type StoreAction_Config struct { 600 Config *Config `protobuf:"bytes,10,opt,name=config,proto3,oneof"` 601 } 602 603 func (*StoreAction_Node) isStoreAction_Target() {} 604 func (*StoreAction_Service) isStoreAction_Target() {} 605 func (*StoreAction_Task) isStoreAction_Target() {} 606 func (*StoreAction_Network) isStoreAction_Target() {} 607 func (*StoreAction_Cluster) isStoreAction_Target() {} 608 func (*StoreAction_Secret) isStoreAction_Target() {} 609 func (*StoreAction_Resource) isStoreAction_Target() {} 610 func (*StoreAction_Extension) isStoreAction_Target() {} 611 func (*StoreAction_Config) isStoreAction_Target() {} 612 613 func (m *StoreAction) GetTarget() isStoreAction_Target { 614 if m != nil { 615 return m.Target 616 } 617 return nil 618 } 619 620 func (m *StoreAction) GetNode() *Node { 621 if x, ok := m.GetTarget().(*StoreAction_Node); ok { 622 return x.Node 623 } 624 return nil 625 } 626 627 func (m *StoreAction) GetService() *Service { 628 if x, ok := m.GetTarget().(*StoreAction_Service); ok { 629 return x.Service 630 } 631 return nil 632 } 633 634 func (m *StoreAction) GetTask() *Task { 635 if x, ok := m.GetTarget().(*StoreAction_Task); ok { 636 return x.Task 637 } 638 return nil 639 } 640 641 func (m *StoreAction) GetNetwork() *Network { 642 if x, ok := m.GetTarget().(*StoreAction_Network); ok { 643 return x.Network 644 } 645 return nil 646 } 647 648 func (m *StoreAction) GetCluster() *Cluster { 649 if x, ok := m.GetTarget().(*StoreAction_Cluster); ok { 650 return x.Cluster 651 } 652 return nil 653 } 654 655 func (m *StoreAction) GetSecret() *Secret { 656 if x, ok := m.GetTarget().(*StoreAction_Secret); ok { 657 return x.Secret 658 } 659 return nil 660 } 661 662 func (m *StoreAction) GetResource() *Resource { 663 if x, ok := m.GetTarget().(*StoreAction_Resource); ok { 664 return x.Resource 665 } 666 return nil 667 } 668 669 func (m *StoreAction) GetExtension() *Extension { 670 if x, ok := m.GetTarget().(*StoreAction_Extension); ok { 671 return x.Extension 672 } 673 return nil 674 } 675 676 func (m *StoreAction) GetConfig() *Config { 677 if x, ok := m.GetTarget().(*StoreAction_Config); ok { 678 return x.Config 679 } 680 return nil 681 } 682 683 // XXX_OneofFuncs is for the internal use of the proto package. 684 func (*StoreAction) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 685 return _StoreAction_OneofMarshaler, _StoreAction_OneofUnmarshaler, _StoreAction_OneofSizer, []interface{}{ 686 (*StoreAction_Node)(nil), 687 (*StoreAction_Service)(nil), 688 (*StoreAction_Task)(nil), 689 (*StoreAction_Network)(nil), 690 (*StoreAction_Cluster)(nil), 691 (*StoreAction_Secret)(nil), 692 (*StoreAction_Resource)(nil), 693 (*StoreAction_Extension)(nil), 694 (*StoreAction_Config)(nil), 695 } 696 } 697 698 func _StoreAction_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 699 m := msg.(*StoreAction) 700 // target 701 switch x := m.Target.(type) { 702 case *StoreAction_Node: 703 _ = b.EncodeVarint(2<<3 | proto.WireBytes) 704 if err := b.EncodeMessage(x.Node); err != nil { 705 return err 706 } 707 case *StoreAction_Service: 708 _ = b.EncodeVarint(3<<3 | proto.WireBytes) 709 if err := b.EncodeMessage(x.Service); err != nil { 710 return err 711 } 712 case *StoreAction_Task: 713 _ = b.EncodeVarint(4<<3 | proto.WireBytes) 714 if err := b.EncodeMessage(x.Task); err != nil { 715 return err 716 } 717 case *StoreAction_Network: 718 _ = b.EncodeVarint(5<<3 | proto.WireBytes) 719 if err := b.EncodeMessage(x.Network); err != nil { 720 return err 721 } 722 case *StoreAction_Cluster: 723 _ = b.EncodeVarint(6<<3 | proto.WireBytes) 724 if err := b.EncodeMessage(x.Cluster); err != nil { 725 return err 726 } 727 case *StoreAction_Secret: 728 _ = b.EncodeVarint(7<<3 | proto.WireBytes) 729 if err := b.EncodeMessage(x.Secret); err != nil { 730 return err 731 } 732 case *StoreAction_Resource: 733 _ = b.EncodeVarint(8<<3 | proto.WireBytes) 734 if err := b.EncodeMessage(x.Resource); err != nil { 735 return err 736 } 737 case *StoreAction_Extension: 738 _ = b.EncodeVarint(9<<3 | proto.WireBytes) 739 if err := b.EncodeMessage(x.Extension); err != nil { 740 return err 741 } 742 case *StoreAction_Config: 743 _ = b.EncodeVarint(10<<3 | proto.WireBytes) 744 if err := b.EncodeMessage(x.Config); err != nil { 745 return err 746 } 747 case nil: 748 default: 749 return fmt.Errorf("StoreAction.Target has unexpected type %T", x) 750 } 751 return nil 752 } 753 754 func _StoreAction_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 755 m := msg.(*StoreAction) 756 switch tag { 757 case 2: // target.node 758 if wire != proto.WireBytes { 759 return true, proto.ErrInternalBadWireType 760 } 761 msg := new(Node) 762 err := b.DecodeMessage(msg) 763 m.Target = &StoreAction_Node{msg} 764 return true, err 765 case 3: // target.service 766 if wire != proto.WireBytes { 767 return true, proto.ErrInternalBadWireType 768 } 769 msg := new(Service) 770 err := b.DecodeMessage(msg) 771 m.Target = &StoreAction_Service{msg} 772 return true, err 773 case 4: // target.task 774 if wire != proto.WireBytes { 775 return true, proto.ErrInternalBadWireType 776 } 777 msg := new(Task) 778 err := b.DecodeMessage(msg) 779 m.Target = &StoreAction_Task{msg} 780 return true, err 781 case 5: // target.network 782 if wire != proto.WireBytes { 783 return true, proto.ErrInternalBadWireType 784 } 785 msg := new(Network) 786 err := b.DecodeMessage(msg) 787 m.Target = &StoreAction_Network{msg} 788 return true, err 789 case 6: // target.cluster 790 if wire != proto.WireBytes { 791 return true, proto.ErrInternalBadWireType 792 } 793 msg := new(Cluster) 794 err := b.DecodeMessage(msg) 795 m.Target = &StoreAction_Cluster{msg} 796 return true, err 797 case 7: // target.secret 798 if wire != proto.WireBytes { 799 return true, proto.ErrInternalBadWireType 800 } 801 msg := new(Secret) 802 err := b.DecodeMessage(msg) 803 m.Target = &StoreAction_Secret{msg} 804 return true, err 805 case 8: // target.resource 806 if wire != proto.WireBytes { 807 return true, proto.ErrInternalBadWireType 808 } 809 msg := new(Resource) 810 err := b.DecodeMessage(msg) 811 m.Target = &StoreAction_Resource{msg} 812 return true, err 813 case 9: // target.extension 814 if wire != proto.WireBytes { 815 return true, proto.ErrInternalBadWireType 816 } 817 msg := new(Extension) 818 err := b.DecodeMessage(msg) 819 m.Target = &StoreAction_Extension{msg} 820 return true, err 821 case 10: // target.config 822 if wire != proto.WireBytes { 823 return true, proto.ErrInternalBadWireType 824 } 825 msg := new(Config) 826 err := b.DecodeMessage(msg) 827 m.Target = &StoreAction_Config{msg} 828 return true, err 829 default: 830 return false, nil 831 } 832 } 833 834 func _StoreAction_OneofSizer(msg proto.Message) (n int) { 835 m := msg.(*StoreAction) 836 // target 837 switch x := m.Target.(type) { 838 case *StoreAction_Node: 839 s := proto.Size(x.Node) 840 n += 1 // tag and wire 841 n += proto.SizeVarint(uint64(s)) 842 n += s 843 case *StoreAction_Service: 844 s := proto.Size(x.Service) 845 n += 1 // tag and wire 846 n += proto.SizeVarint(uint64(s)) 847 n += s 848 case *StoreAction_Task: 849 s := proto.Size(x.Task) 850 n += 1 // tag and wire 851 n += proto.SizeVarint(uint64(s)) 852 n += s 853 case *StoreAction_Network: 854 s := proto.Size(x.Network) 855 n += 1 // tag and wire 856 n += proto.SizeVarint(uint64(s)) 857 n += s 858 case *StoreAction_Cluster: 859 s := proto.Size(x.Cluster) 860 n += 1 // tag and wire 861 n += proto.SizeVarint(uint64(s)) 862 n += s 863 case *StoreAction_Secret: 864 s := proto.Size(x.Secret) 865 n += 1 // tag and wire 866 n += proto.SizeVarint(uint64(s)) 867 n += s 868 case *StoreAction_Resource: 869 s := proto.Size(x.Resource) 870 n += 1 // tag and wire 871 n += proto.SizeVarint(uint64(s)) 872 n += s 873 case *StoreAction_Extension: 874 s := proto.Size(x.Extension) 875 n += 1 // tag and wire 876 n += proto.SizeVarint(uint64(s)) 877 n += s 878 case *StoreAction_Config: 879 s := proto.Size(x.Config) 880 n += 1 // tag and wire 881 n += proto.SizeVarint(uint64(s)) 882 n += s 883 case nil: 884 default: 885 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 886 } 887 return n 888 } 889 890 func init() { 891 proto.RegisterEnum("docker.swarmkit.v1.StoreActionKind", StoreActionKind_name, StoreActionKind_value) 892 proto.RegisterType((*RaftMember)(nil), "docker.swarmkit.v1.RaftMember") 893 proto.RegisterType((*JoinRequest)(nil), "docker.swarmkit.v1.JoinRequest") 894 proto.RegisterType((*JoinResponse)(nil), "docker.swarmkit.v1.JoinResponse") 895 proto.RegisterType((*LeaveRequest)(nil), "docker.swarmkit.v1.LeaveRequest") 896 proto.RegisterType((*LeaveResponse)(nil), "docker.swarmkit.v1.LeaveResponse") 897 proto.RegisterType((*ProcessRaftMessageRequest)(nil), "docker.swarmkit.v1.ProcessRaftMessageRequest") 898 proto.RegisterType((*ProcessRaftMessageResponse)(nil), "docker.swarmkit.v1.ProcessRaftMessageResponse") 899 proto.RegisterType((*StreamRaftMessageRequest)(nil), "docker.swarmkit.v1.StreamRaftMessageRequest") 900 proto.RegisterType((*StreamRaftMessageResponse)(nil), "docker.swarmkit.v1.StreamRaftMessageResponse") 901 proto.RegisterType((*ResolveAddressRequest)(nil), "docker.swarmkit.v1.ResolveAddressRequest") 902 proto.RegisterType((*ResolveAddressResponse)(nil), "docker.swarmkit.v1.ResolveAddressResponse") 903 proto.RegisterType((*InternalRaftRequest)(nil), "docker.swarmkit.v1.InternalRaftRequest") 904 proto.RegisterType((*StoreAction)(nil), "docker.swarmkit.v1.StoreAction") 905 } 906 907 func init() { 908 proto.RegisterFile("github.com/docker/swarmkit/api/raft.proto", fileDescriptor_d2c32e1e3c930c15) 909 } 910 911 var fileDescriptor_d2c32e1e3c930c15 = []byte{ 912 // 1028 bytes of a gzipped FileDescriptorProto 913 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x41, 0x73, 0xdb, 0x44, 914 0x14, 0xc7, 0x25, 0x5b, 0x75, 0x9a, 0x97, 0x36, 0x09, 0x5b, 0x12, 0x14, 0xb5, 0x28, 0xae, 0xda, 915 0x19, 0x9c, 0x90, 0xc8, 0x83, 0x61, 0xa6, 0x4c, 0xa1, 0x87, 0x38, 0xf1, 0x4c, 0x4c, 0x5a, 0xa7, 916 0xa3, 0x24, 0xd0, 0x5b, 0x90, 0xa5, 0x8d, 0x2b, 0x1c, 0x6b, 0xcd, 0xee, 0x3a, 0x81, 0x0b, 0xd3, 917 0x23, 0xe4, 0xc4, 0x0d, 0x86, 0x99, 0x0e, 0x07, 0x38, 0xf7, 0x03, 0xf0, 0x01, 0x98, 0x0c, 0xa7, 918 0xde, 0xe8, 0x29, 0x43, 0x9d, 0x3b, 0x7c, 0x05, 0x66, 0x57, 0x52, 0x12, 0x6c, 0xd9, 0xf1, 0x81, 919 0x4b, 0xb2, 0xa3, 0xfd, 0xfd, 0xdf, 0xff, 0xed, 0xee, 0xdb, 0xb7, 0x86, 0x85, 0x46, 0xc0, 0x9f, 920 0x76, 0xea, 0xb6, 0x47, 0x5a, 0x45, 0x9f, 0x78, 0x4d, 0x4c, 0x8b, 0xec, 0xd0, 0xa5, 0xad, 0x66, 921 0xc0, 0x8b, 0x6e, 0x3b, 0x28, 0x52, 0x77, 0x8f, 0xdb, 0x6d, 0x4a, 0x38, 0x41, 0x28, 0x9a, 0xb7, 922 0x93, 0x79, 0xfb, 0xe0, 0x3d, 0x63, 0xe9, 0x12, 0x39, 0xa9, 0x7f, 0x81, 0x3d, 0xce, 0xa2, 0x08, 923 0xc6, 0xe2, 0x25, 0x34, 0xff, 0xba, 0x8d, 0x13, 0x76, 0xf9, 0x02, 0xeb, 0x11, 0x8a, 0x09, 0x2b, 924 0x62, 0xee, 0xf9, 0x32, 0x21, 0xf9, 0xa7, 0x5d, 0xbf, 0x90, 0x9c, 0xf1, 0x66, 0x83, 0x34, 0x88, 925 0x1c, 0x16, 0xc5, 0x28, 0xfe, 0x7a, 0x6f, 0x88, 0xa1, 0x24, 0xea, 0x9d, 0xbd, 0x62, 0x7b, 0xbf, 926 0xd3, 0x08, 0xc2, 0xf8, 0x5f, 0x24, 0xb4, 0x5e, 0xa8, 0x00, 0x8e, 0xbb, 0xc7, 0x1f, 0xe1, 0x56, 927 0x1d, 0x53, 0x74, 0x07, 0xc6, 0x84, 0xd7, 0x6e, 0xe0, 0xeb, 0x6a, 0x5e, 0x2d, 0x68, 0x65, 0xe8, 928 0x9e, 0xcc, 0xe7, 0x04, 0x50, 0x5d, 0x73, 0x72, 0x62, 0xaa, 0xea, 0x0b, 0x28, 0x24, 0x3e, 0x16, 929 0x50, 0x26, 0xaf, 0x16, 0xc6, 0x23, 0xa8, 0x46, 0x7c, 0x2c, 0x20, 0x31, 0x55, 0xf5, 0x11, 0x02, 930 0xcd, 0xf5, 0x7d, 0xaa, 0x67, 0x05, 0xe1, 0xc8, 0x31, 0x2a, 0x43, 0x8e, 0x71, 0x97, 0x77, 0x98, 931 0xae, 0xe5, 0xd5, 0xc2, 0x44, 0xe9, 0xae, 0xdd, 0xbf, 0xd3, 0xf6, 0x79, 0x36, 0x5b, 0x92, 0x2d, 932 0x6b, 0xc7, 0x27, 0xf3, 0x8a, 0x13, 0x2b, 0xad, 0xdb, 0x30, 0xf1, 0x09, 0x09, 0x42, 0x07, 0x7f, 933 0xd9, 0xc1, 0x8c, 0x9f, 0xd9, 0xa8, 0xe7, 0x36, 0xd6, 0x4f, 0x2a, 0x5c, 0x8b, 0x18, 0xd6, 0x26, 934 0x21, 0xc3, 0xa3, 0xad, 0xea, 0x43, 0x18, 0x6b, 0x49, 0x5b, 0xa6, 0x67, 0xf2, 0xd9, 0xc2, 0x44, 935 0xc9, 0x1c, 0x9e, 0x9d, 0x93, 0xe0, 0xe8, 0x5d, 0x98, 0xa2, 0xb8, 0x45, 0x0e, 0xb0, 0xbf, 0x9b, 936 0x44, 0xc8, 0xe6, 0xb3, 0x05, 0xad, 0x9c, 0x99, 0x56, 0x9c, 0xc9, 0x78, 0x2a, 0x12, 0x31, 0xab, 937 0x0c, 0xd7, 0x1e, 0x62, 0xf7, 0x00, 0x27, 0x0b, 0x28, 0x81, 0x26, 0x76, 0x4c, 0x26, 0x76, 0xb9, 938 0xa7, 0x64, 0xad, 0x29, 0xb8, 0x1e, 0xc7, 0x88, 0x16, 0x68, 0x3d, 0x84, 0xb9, 0xc7, 0x94, 0x78, 939 0x98, 0xb1, 0x88, 0x65, 0xcc, 0x6d, 0x9c, 0x39, 0x2c, 0x88, 0x85, 0xc9, 0x2f, 0xb1, 0xc9, 0x94, 940 0x1d, 0x95, 0x95, 0x9d, 0x80, 0xc9, 0xfc, 0x7d, 0xed, 0xd9, 0x0f, 0x96, 0x62, 0xdd, 0x02, 0x23, 941 0x2d, 0x5a, 0xec, 0xb5, 0x01, 0xfa, 0x16, 0xa7, 0xd8, 0x6d, 0xfd, 0x1f, 0x56, 0x37, 0x61, 0x2e, 942 0x25, 0x58, 0xec, 0xf4, 0x31, 0xcc, 0x38, 0x98, 0x91, 0xfd, 0x03, 0xbc, 0xe2, 0xfb, 0x54, 0xa4, 943 0x13, 0xdb, 0x8c, 0x72, 0x9e, 0xd6, 0x12, 0xcc, 0xf6, 0xaa, 0xe3, 0x72, 0x48, 0xab, 0x99, 0x7d, 944 0xb8, 0x51, 0x0d, 0x39, 0xa6, 0xa1, 0xbb, 0x2f, 0xe2, 0x24, 0x4e, 0xb3, 0x90, 0x39, 0x33, 0xc9, 945 0x75, 0x4f, 0xe6, 0x33, 0xd5, 0x35, 0x27, 0x13, 0xf8, 0xe8, 0x01, 0xe4, 0x5c, 0x8f, 0x07, 0x24, 946 0x8c, 0x6b, 0x65, 0x3e, 0xed, 0xdc, 0xb6, 0x38, 0xa1, 0x78, 0x45, 0x62, 0x49, 0x11, 0x47, 0x22, 947 0xeb, 0x77, 0x0d, 0x26, 0x2e, 0xcc, 0xa2, 0x8f, 0xce, 0xc2, 0x09, 0xab, 0xc9, 0xd2, 0x9d, 0x4b, 948 0xc2, 0x6d, 0x04, 0xa1, 0x9f, 0x04, 0x43, 0x76, 0x5c, 0x41, 0x19, 0xb9, 0xe3, 0x7a, 0x9a, 0x54, 949 0xdc, 0xcd, 0x75, 0x25, 0xaa, 0x1e, 0x74, 0x0f, 0xc6, 0x18, 0xa6, 0x07, 0x81, 0x87, 0xe5, 0xe5, 950 0x9c, 0x28, 0xdd, 0x4c, 0x75, 0x8b, 0x90, 0x75, 0xc5, 0x49, 0x68, 0x61, 0xc4, 0x5d, 0xd6, 0x8c, 951 0x2f, 0x6f, 0xaa, 0xd1, 0xb6, 0xcb, 0x9a, 0xc2, 0x48, 0x70, 0xc2, 0x28, 0xc4, 0xfc, 0x90, 0xd0, 952 0xa6, 0x7e, 0x65, 0xb0, 0x51, 0x2d, 0x42, 0x84, 0x51, 0x4c, 0x0b, 0xa1, 0xb7, 0xdf, 0x61, 0x1c, 953 0x53, 0x3d, 0x37, 0x58, 0xb8, 0x1a, 0x21, 0x42, 0x18, 0xd3, 0xe8, 0x03, 0xc8, 0x31, 0xec, 0x51, 954 0xcc, 0xf5, 0x31, 0xa9, 0x33, 0xd2, 0x57, 0x26, 0x88, 0x75, 0xd1, 0x52, 0xe4, 0x08, 0xdd, 0x87, 955 0xab, 0x14, 0x33, 0xd2, 0xa1, 0x1e, 0xd6, 0xaf, 0x4a, 0xdd, 0xad, 0xd4, 0x6b, 0x18, 0x33, 0xeb, 956 0x8a, 0x73, 0xc6, 0xa3, 0x07, 0x30, 0x8e, 0xbf, 0xe2, 0x38, 0x64, 0xe2, 0xf0, 0xc6, 0xa5, 0xf8, 957 0xed, 0x34, 0x71, 0x25, 0x81, 0xd6, 0x15, 0xe7, 0x5c, 0x21, 0x12, 0xf6, 0x48, 0xb8, 0x17, 0x34, 958 0x74, 0x18, 0x9c, 0xf0, 0xaa, 0x24, 0x44, 0xc2, 0x11, 0x5b, 0xbe, 0x0a, 0x39, 0xee, 0xd2, 0x06, 959 0xe6, 0x8b, 0xff, 0xa8, 0x30, 0xd5, 0x53, 0x17, 0xe8, 0x1d, 0x18, 0xdb, 0xa9, 0x6d, 0xd4, 0x36, 960 0x3f, 0xab, 0x4d, 0x2b, 0x86, 0x71, 0xf4, 0x3c, 0x3f, 0xdb, 0x43, 0xec, 0x84, 0xcd, 0x90, 0x1c, 961 0x86, 0xa8, 0x04, 0x37, 0xb6, 0xb6, 0x37, 0x9d, 0xca, 0xee, 0xca, 0xea, 0x76, 0x75, 0xb3, 0xb6, 962 0xbb, 0xea, 0x54, 0x56, 0xb6, 0x2b, 0xd3, 0xaa, 0x31, 0x77, 0xf4, 0x3c, 0x3f, 0xd3, 0x23, 0x5a, 963 0xa5, 0xd8, 0xe5, 0xb8, 0x4f, 0xb3, 0xf3, 0x78, 0x4d, 0x68, 0x32, 0xa9, 0x9a, 0x9d, 0xb6, 0x9f, 964 0xa6, 0x71, 0x2a, 0x8f, 0x36, 0x3f, 0xad, 0x4c, 0x67, 0x53, 0x35, 0x8e, 0x6c, 0x97, 0xc6, 0x5b, 965 0xdf, 0xfe, 0x62, 0x2a, 0xbf, 0xfd, 0x6a, 0xf6, 0xae, 0xae, 0xf4, 0x73, 0x16, 0x34, 0x71, 0x43, 966 0xd1, 0x91, 0x0a, 0xa8, 0xbf, 0x4d, 0xa1, 0xe5, 0xb4, 0x1d, 0x1c, 0xd8, 0x1c, 0x0d, 0x7b, 0x54, 967 0x3c, 0xee, 0x49, 0x33, 0x7f, 0xbc, 0xf8, 0xfb, 0xc7, 0xcc, 0x14, 0x5c, 0x97, 0xfc, 0x72, 0xcb, 968 0x0d, 0xdd, 0x06, 0xa6, 0xe8, 0x3b, 0x15, 0xde, 0xe8, 0x6b, 0x64, 0x68, 0x29, 0xfd, 0x1a, 0xa7, 969 0x37, 0x4f, 0x63, 0x79, 0x44, 0x7a, 0x68, 0x26, 0x05, 0x15, 0x7d, 0x03, 0x93, 0xff, 0x6d, 0x7c, 970 0x68, 0x61, 0x50, 0x39, 0xf7, 0xb5, 0x56, 0x63, 0x71, 0x14, 0x74, 0x68, 0x06, 0xa5, 0x3f, 0x55, 971 0x98, 0x3c, 0x7f, 0xb2, 0xd8, 0xd3, 0xa0, 0x8d, 0x3e, 0x07, 0x4d, 0x3c, 0xc8, 0x28, 0xb5, 0x4d, 972 0x5e, 0x78, 0xce, 0x8d, 0xfc, 0x60, 0x60, 0xf8, 0x01, 0x78, 0x70, 0x45, 0x3e, 0x89, 0x28, 0x35, 973 0xc2, 0xc5, 0x17, 0xd7, 0xb8, 0x3d, 0x84, 0x18, 0x6a, 0x52, 0xbe, 0x7b, 0xfc, 0xda, 0x54, 0x5e, 974 0xbd, 0x36, 0x95, 0x67, 0x5d, 0x53, 0x3d, 0xee, 0x9a, 0xea, 0xcb, 0xae, 0xa9, 0xfe, 0xd5, 0x35, 975 0xd5, 0xef, 0x4f, 0x4d, 0xe5, 0xe5, 0xa9, 0xa9, 0xbc, 0x3a, 0x35, 0x95, 0x27, 0xd9, 0x27, 0x5a, 976 0x3d, 0x27, 0x7f, 0x5d, 0xbd, 0xff, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x42, 0x09, 0xd0, 977 0x76, 0x0a, 0x00, 0x00, 978 } 979 980 type authenticatedWrapperRaftServer struct { 981 local RaftServer 982 authorize func(context.Context, []string) error 983 } 984 985 func NewAuthenticatedWrapperRaftServer(local RaftServer, authorize func(context.Context, []string) error) RaftServer { 986 return &authenticatedWrapperRaftServer{ 987 local: local, 988 authorize: authorize, 989 } 990 } 991 992 func (p *authenticatedWrapperRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) { 993 994 if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { 995 return nil, err 996 } 997 return p.local.ProcessRaftMessage(ctx, r) 998 } 999 1000 func (p *authenticatedWrapperRaftServer) StreamRaftMessage(stream Raft_StreamRaftMessageServer) error { 1001 1002 if err := p.authorize(stream.Context(), []string{"swarm-manager"}); err != nil { 1003 return err 1004 } 1005 return p.local.StreamRaftMessage(stream) 1006 } 1007 1008 func (p *authenticatedWrapperRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) { 1009 1010 if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { 1011 return nil, err 1012 } 1013 return p.local.ResolveAddress(ctx, r) 1014 } 1015 1016 type authenticatedWrapperRaftMembershipServer struct { 1017 local RaftMembershipServer 1018 authorize func(context.Context, []string) error 1019 } 1020 1021 func NewAuthenticatedWrapperRaftMembershipServer(local RaftMembershipServer, authorize func(context.Context, []string) error) RaftMembershipServer { 1022 return &authenticatedWrapperRaftMembershipServer{ 1023 local: local, 1024 authorize: authorize, 1025 } 1026 } 1027 1028 func (p *authenticatedWrapperRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) { 1029 1030 if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { 1031 return nil, err 1032 } 1033 return p.local.Join(ctx, r) 1034 } 1035 1036 func (p *authenticatedWrapperRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) { 1037 1038 if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil { 1039 return nil, err 1040 } 1041 return p.local.Leave(ctx, r) 1042 } 1043 1044 func (m *RaftMember) Copy() *RaftMember { 1045 if m == nil { 1046 return nil 1047 } 1048 o := &RaftMember{} 1049 o.CopyFrom(m) 1050 return o 1051 } 1052 1053 func (m *RaftMember) CopyFrom(src interface{}) { 1054 1055 o := src.(*RaftMember) 1056 *m = *o 1057 github_com_docker_swarmkit_api_deepcopy.Copy(&m.Status, &o.Status) 1058 } 1059 1060 func (m *JoinRequest) Copy() *JoinRequest { 1061 if m == nil { 1062 return nil 1063 } 1064 o := &JoinRequest{} 1065 o.CopyFrom(m) 1066 return o 1067 } 1068 1069 func (m *JoinRequest) CopyFrom(src interface{}) { 1070 1071 o := src.(*JoinRequest) 1072 *m = *o 1073 } 1074 1075 func (m *JoinResponse) Copy() *JoinResponse { 1076 if m == nil { 1077 return nil 1078 } 1079 o := &JoinResponse{} 1080 o.CopyFrom(m) 1081 return o 1082 } 1083 1084 func (m *JoinResponse) CopyFrom(src interface{}) { 1085 1086 o := src.(*JoinResponse) 1087 *m = *o 1088 if o.Members != nil { 1089 m.Members = make([]*RaftMember, len(o.Members)) 1090 for i := range m.Members { 1091 m.Members[i] = &RaftMember{} 1092 github_com_docker_swarmkit_api_deepcopy.Copy(m.Members[i], o.Members[i]) 1093 } 1094 } 1095 1096 if o.RemovedMembers != nil { 1097 m.RemovedMembers = make([]uint64, len(o.RemovedMembers)) 1098 copy(m.RemovedMembers, o.RemovedMembers) 1099 } 1100 1101 } 1102 1103 func (m *LeaveRequest) Copy() *LeaveRequest { 1104 if m == nil { 1105 return nil 1106 } 1107 o := &LeaveRequest{} 1108 o.CopyFrom(m) 1109 return o 1110 } 1111 1112 func (m *LeaveRequest) CopyFrom(src interface{}) { 1113 1114 o := src.(*LeaveRequest) 1115 *m = *o 1116 if o.Node != nil { 1117 m.Node = &RaftMember{} 1118 github_com_docker_swarmkit_api_deepcopy.Copy(m.Node, o.Node) 1119 } 1120 } 1121 1122 func (m *LeaveResponse) Copy() *LeaveResponse { 1123 if m == nil { 1124 return nil 1125 } 1126 o := &LeaveResponse{} 1127 o.CopyFrom(m) 1128 return o 1129 } 1130 1131 func (m *LeaveResponse) CopyFrom(src interface{}) {} 1132 func (m *ProcessRaftMessageResponse) Copy() *ProcessRaftMessageResponse { 1133 if m == nil { 1134 return nil 1135 } 1136 o := &ProcessRaftMessageResponse{} 1137 o.CopyFrom(m) 1138 return o 1139 } 1140 1141 func (m *ProcessRaftMessageResponse) CopyFrom(src interface{}) {} 1142 func (m *StreamRaftMessageResponse) Copy() *StreamRaftMessageResponse { 1143 if m == nil { 1144 return nil 1145 } 1146 o := &StreamRaftMessageResponse{} 1147 o.CopyFrom(m) 1148 return o 1149 } 1150 1151 func (m *StreamRaftMessageResponse) CopyFrom(src interface{}) {} 1152 func (m *ResolveAddressRequest) Copy() *ResolveAddressRequest { 1153 if m == nil { 1154 return nil 1155 } 1156 o := &ResolveAddressRequest{} 1157 o.CopyFrom(m) 1158 return o 1159 } 1160 1161 func (m *ResolveAddressRequest) CopyFrom(src interface{}) { 1162 1163 o := src.(*ResolveAddressRequest) 1164 *m = *o 1165 } 1166 1167 func (m *ResolveAddressResponse) Copy() *ResolveAddressResponse { 1168 if m == nil { 1169 return nil 1170 } 1171 o := &ResolveAddressResponse{} 1172 o.CopyFrom(m) 1173 return o 1174 } 1175 1176 func (m *ResolveAddressResponse) CopyFrom(src interface{}) { 1177 1178 o := src.(*ResolveAddressResponse) 1179 *m = *o 1180 } 1181 1182 func (m *InternalRaftRequest) Copy() *InternalRaftRequest { 1183 if m == nil { 1184 return nil 1185 } 1186 o := &InternalRaftRequest{} 1187 o.CopyFrom(m) 1188 return o 1189 } 1190 1191 func (m *InternalRaftRequest) CopyFrom(src interface{}) { 1192 1193 o := src.(*InternalRaftRequest) 1194 *m = *o 1195 if o.Action != nil { 1196 m.Action = make([]StoreAction, len(o.Action)) 1197 for i := range m.Action { 1198 github_com_docker_swarmkit_api_deepcopy.Copy(&m.Action[i], &o.Action[i]) 1199 } 1200 } 1201 1202 } 1203 1204 func (m *StoreAction) Copy() *StoreAction { 1205 if m == nil { 1206 return nil 1207 } 1208 o := &StoreAction{} 1209 o.CopyFrom(m) 1210 return o 1211 } 1212 1213 func (m *StoreAction) CopyFrom(src interface{}) { 1214 1215 o := src.(*StoreAction) 1216 *m = *o 1217 if o.Target != nil { 1218 switch o.Target.(type) { 1219 case *StoreAction_Node: 1220 v := StoreAction_Node{ 1221 Node: &Node{}, 1222 } 1223 github_com_docker_swarmkit_api_deepcopy.Copy(v.Node, o.GetNode()) 1224 m.Target = &v 1225 case *StoreAction_Service: 1226 v := StoreAction_Service{ 1227 Service: &Service{}, 1228 } 1229 github_com_docker_swarmkit_api_deepcopy.Copy(v.Service, o.GetService()) 1230 m.Target = &v 1231 case *StoreAction_Task: 1232 v := StoreAction_Task{ 1233 Task: &Task{}, 1234 } 1235 github_com_docker_swarmkit_api_deepcopy.Copy(v.Task, o.GetTask()) 1236 m.Target = &v 1237 case *StoreAction_Network: 1238 v := StoreAction_Network{ 1239 Network: &Network{}, 1240 } 1241 github_com_docker_swarmkit_api_deepcopy.Copy(v.Network, o.GetNetwork()) 1242 m.Target = &v 1243 case *StoreAction_Cluster: 1244 v := StoreAction_Cluster{ 1245 Cluster: &Cluster{}, 1246 } 1247 github_com_docker_swarmkit_api_deepcopy.Copy(v.Cluster, o.GetCluster()) 1248 m.Target = &v 1249 case *StoreAction_Secret: 1250 v := StoreAction_Secret{ 1251 Secret: &Secret{}, 1252 } 1253 github_com_docker_swarmkit_api_deepcopy.Copy(v.Secret, o.GetSecret()) 1254 m.Target = &v 1255 case *StoreAction_Resource: 1256 v := StoreAction_Resource{ 1257 Resource: &Resource{}, 1258 } 1259 github_com_docker_swarmkit_api_deepcopy.Copy(v.Resource, o.GetResource()) 1260 m.Target = &v 1261 case *StoreAction_Extension: 1262 v := StoreAction_Extension{ 1263 Extension: &Extension{}, 1264 } 1265 github_com_docker_swarmkit_api_deepcopy.Copy(v.Extension, o.GetExtension()) 1266 m.Target = &v 1267 case *StoreAction_Config: 1268 v := StoreAction_Config{ 1269 Config: &Config{}, 1270 } 1271 github_com_docker_swarmkit_api_deepcopy.Copy(v.Config, o.GetConfig()) 1272 m.Target = &v 1273 } 1274 } 1275 1276 } 1277 1278 // Reference imports to suppress errors if they are not otherwise used. 1279 var _ context.Context 1280 var _ grpc.ClientConn 1281 1282 // This is a compile-time assertion to ensure that this generated file 1283 // is compatible with the grpc package it is being compiled against. 1284 const _ = grpc.SupportPackageIsVersion4 1285 1286 // RaftClient is the client API for Raft service. 1287 // 1288 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 1289 type RaftClient interface { 1290 // ProcessRaftMessage sends a raft message to be processed on a raft member, it is 1291 // called from the RaftMember willing to send a message to its destination ('To' field) 1292 ProcessRaftMessage(ctx context.Context, in *ProcessRaftMessageRequest, opts ...grpc.CallOption) (*ProcessRaftMessageResponse, error) 1293 // StreamRaftMessage accepts a stream of raft messages of type StreamRaftMessageRequest 1294 // to be processed on a raft member, returning a StreamRaftMessageResponse 1295 // when processing of the streamed messages is complete. A single stream corresponds 1296 // to a single raft message, which may be disassembled and streamed as individual messages. 1297 // It is called from the Raft leader, which uses it to stream messages to a raft member. 1298 StreamRaftMessage(ctx context.Context, opts ...grpc.CallOption) (Raft_StreamRaftMessageClient, error) 1299 // ResolveAddress returns the address where the node with the given ID can be reached. 1300 ResolveAddress(ctx context.Context, in *ResolveAddressRequest, opts ...grpc.CallOption) (*ResolveAddressResponse, error) 1301 } 1302 1303 type raftClient struct { 1304 cc *grpc.ClientConn 1305 } 1306 1307 func NewRaftClient(cc *grpc.ClientConn) RaftClient { 1308 return &raftClient{cc} 1309 } 1310 1311 func (c *raftClient) ProcessRaftMessage(ctx context.Context, in *ProcessRaftMessageRequest, opts ...grpc.CallOption) (*ProcessRaftMessageResponse, error) { 1312 out := new(ProcessRaftMessageResponse) 1313 err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ProcessRaftMessage", in, out, opts...) 1314 if err != nil { 1315 return nil, err 1316 } 1317 return out, nil 1318 } 1319 1320 func (c *raftClient) StreamRaftMessage(ctx context.Context, opts ...grpc.CallOption) (Raft_StreamRaftMessageClient, error) { 1321 stream, err := c.cc.NewStream(ctx, &_Raft_serviceDesc.Streams[0], "/docker.swarmkit.v1.Raft/StreamRaftMessage", opts...) 1322 if err != nil { 1323 return nil, err 1324 } 1325 x := &raftStreamRaftMessageClient{stream} 1326 return x, nil 1327 } 1328 1329 type Raft_StreamRaftMessageClient interface { 1330 Send(*StreamRaftMessageRequest) error 1331 CloseAndRecv() (*StreamRaftMessageResponse, error) 1332 grpc.ClientStream 1333 } 1334 1335 type raftStreamRaftMessageClient struct { 1336 grpc.ClientStream 1337 } 1338 1339 func (x *raftStreamRaftMessageClient) Send(m *StreamRaftMessageRequest) error { 1340 return x.ClientStream.SendMsg(m) 1341 } 1342 1343 func (x *raftStreamRaftMessageClient) CloseAndRecv() (*StreamRaftMessageResponse, error) { 1344 if err := x.ClientStream.CloseSend(); err != nil { 1345 return nil, err 1346 } 1347 m := new(StreamRaftMessageResponse) 1348 if err := x.ClientStream.RecvMsg(m); err != nil { 1349 return nil, err 1350 } 1351 return m, nil 1352 } 1353 1354 func (c *raftClient) ResolveAddress(ctx context.Context, in *ResolveAddressRequest, opts ...grpc.CallOption) (*ResolveAddressResponse, error) { 1355 out := new(ResolveAddressResponse) 1356 err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ResolveAddress", in, out, opts...) 1357 if err != nil { 1358 return nil, err 1359 } 1360 return out, nil 1361 } 1362 1363 // RaftServer is the server API for Raft service. 1364 type RaftServer interface { 1365 // ProcessRaftMessage sends a raft message to be processed on a raft member, it is 1366 // called from the RaftMember willing to send a message to its destination ('To' field) 1367 ProcessRaftMessage(context.Context, *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) 1368 // StreamRaftMessage accepts a stream of raft messages of type StreamRaftMessageRequest 1369 // to be processed on a raft member, returning a StreamRaftMessageResponse 1370 // when processing of the streamed messages is complete. A single stream corresponds 1371 // to a single raft message, which may be disassembled and streamed as individual messages. 1372 // It is called from the Raft leader, which uses it to stream messages to a raft member. 1373 StreamRaftMessage(Raft_StreamRaftMessageServer) error 1374 // ResolveAddress returns the address where the node with the given ID can be reached. 1375 ResolveAddress(context.Context, *ResolveAddressRequest) (*ResolveAddressResponse, error) 1376 } 1377 1378 func RegisterRaftServer(s *grpc.Server, srv RaftServer) { 1379 s.RegisterService(&_Raft_serviceDesc, srv) 1380 } 1381 1382 func _Raft_ProcessRaftMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1383 in := new(ProcessRaftMessageRequest) 1384 if err := dec(in); err != nil { 1385 return nil, err 1386 } 1387 if interceptor == nil { 1388 return srv.(RaftServer).ProcessRaftMessage(ctx, in) 1389 } 1390 info := &grpc.UnaryServerInfo{ 1391 Server: srv, 1392 FullMethod: "/docker.swarmkit.v1.Raft/ProcessRaftMessage", 1393 } 1394 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1395 return srv.(RaftServer).ProcessRaftMessage(ctx, req.(*ProcessRaftMessageRequest)) 1396 } 1397 return interceptor(ctx, in, info, handler) 1398 } 1399 1400 func _Raft_StreamRaftMessage_Handler(srv interface{}, stream grpc.ServerStream) error { 1401 return srv.(RaftServer).StreamRaftMessage(&raftStreamRaftMessageServer{stream}) 1402 } 1403 1404 type Raft_StreamRaftMessageServer interface { 1405 SendAndClose(*StreamRaftMessageResponse) error 1406 Recv() (*StreamRaftMessageRequest, error) 1407 grpc.ServerStream 1408 } 1409 1410 type raftStreamRaftMessageServer struct { 1411 grpc.ServerStream 1412 } 1413 1414 func (x *raftStreamRaftMessageServer) SendAndClose(m *StreamRaftMessageResponse) error { 1415 return x.ServerStream.SendMsg(m) 1416 } 1417 1418 func (x *raftStreamRaftMessageServer) Recv() (*StreamRaftMessageRequest, error) { 1419 m := new(StreamRaftMessageRequest) 1420 if err := x.ServerStream.RecvMsg(m); err != nil { 1421 return nil, err 1422 } 1423 return m, nil 1424 } 1425 1426 func _Raft_ResolveAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1427 in := new(ResolveAddressRequest) 1428 if err := dec(in); err != nil { 1429 return nil, err 1430 } 1431 if interceptor == nil { 1432 return srv.(RaftServer).ResolveAddress(ctx, in) 1433 } 1434 info := &grpc.UnaryServerInfo{ 1435 Server: srv, 1436 FullMethod: "/docker.swarmkit.v1.Raft/ResolveAddress", 1437 } 1438 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1439 return srv.(RaftServer).ResolveAddress(ctx, req.(*ResolveAddressRequest)) 1440 } 1441 return interceptor(ctx, in, info, handler) 1442 } 1443 1444 var _Raft_serviceDesc = grpc.ServiceDesc{ 1445 ServiceName: "docker.swarmkit.v1.Raft", 1446 HandlerType: (*RaftServer)(nil), 1447 Methods: []grpc.MethodDesc{ 1448 { 1449 MethodName: "ProcessRaftMessage", 1450 Handler: _Raft_ProcessRaftMessage_Handler, 1451 }, 1452 { 1453 MethodName: "ResolveAddress", 1454 Handler: _Raft_ResolveAddress_Handler, 1455 }, 1456 }, 1457 Streams: []grpc.StreamDesc{ 1458 { 1459 StreamName: "StreamRaftMessage", 1460 Handler: _Raft_StreamRaftMessage_Handler, 1461 ClientStreams: true, 1462 }, 1463 }, 1464 Metadata: "github.com/docker/swarmkit/api/raft.proto", 1465 } 1466 1467 // RaftMembershipClient is the client API for RaftMembership service. 1468 // 1469 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 1470 type RaftMembershipClient interface { 1471 // Join adds a RaftMember to the raft cluster. 1472 Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) 1473 // Leave removes a RaftMember from the raft cluster. 1474 Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*LeaveResponse, error) 1475 } 1476 1477 type raftMembershipClient struct { 1478 cc *grpc.ClientConn 1479 } 1480 1481 func NewRaftMembershipClient(cc *grpc.ClientConn) RaftMembershipClient { 1482 return &raftMembershipClient{cc} 1483 } 1484 1485 func (c *raftMembershipClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) { 1486 out := new(JoinResponse) 1487 err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Join", in, out, opts...) 1488 if err != nil { 1489 return nil, err 1490 } 1491 return out, nil 1492 } 1493 1494 func (c *raftMembershipClient) Leave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*LeaveResponse, error) { 1495 out := new(LeaveResponse) 1496 err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Leave", in, out, opts...) 1497 if err != nil { 1498 return nil, err 1499 } 1500 return out, nil 1501 } 1502 1503 // RaftMembershipServer is the server API for RaftMembership service. 1504 type RaftMembershipServer interface { 1505 // Join adds a RaftMember to the raft cluster. 1506 Join(context.Context, *JoinRequest) (*JoinResponse, error) 1507 // Leave removes a RaftMember from the raft cluster. 1508 Leave(context.Context, *LeaveRequest) (*LeaveResponse, error) 1509 } 1510 1511 func RegisterRaftMembershipServer(s *grpc.Server, srv RaftMembershipServer) { 1512 s.RegisterService(&_RaftMembership_serviceDesc, srv) 1513 } 1514 1515 func _RaftMembership_Join_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1516 in := new(JoinRequest) 1517 if err := dec(in); err != nil { 1518 return nil, err 1519 } 1520 if interceptor == nil { 1521 return srv.(RaftMembershipServer).Join(ctx, in) 1522 } 1523 info := &grpc.UnaryServerInfo{ 1524 Server: srv, 1525 FullMethod: "/docker.swarmkit.v1.RaftMembership/Join", 1526 } 1527 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1528 return srv.(RaftMembershipServer).Join(ctx, req.(*JoinRequest)) 1529 } 1530 return interceptor(ctx, in, info, handler) 1531 } 1532 1533 func _RaftMembership_Leave_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1534 in := new(LeaveRequest) 1535 if err := dec(in); err != nil { 1536 return nil, err 1537 } 1538 if interceptor == nil { 1539 return srv.(RaftMembershipServer).Leave(ctx, in) 1540 } 1541 info := &grpc.UnaryServerInfo{ 1542 Server: srv, 1543 FullMethod: "/docker.swarmkit.v1.RaftMembership/Leave", 1544 } 1545 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1546 return srv.(RaftMembershipServer).Leave(ctx, req.(*LeaveRequest)) 1547 } 1548 return interceptor(ctx, in, info, handler) 1549 } 1550 1551 var _RaftMembership_serviceDesc = grpc.ServiceDesc{ 1552 ServiceName: "docker.swarmkit.v1.RaftMembership", 1553 HandlerType: (*RaftMembershipServer)(nil), 1554 Methods: []grpc.MethodDesc{ 1555 { 1556 MethodName: "Join", 1557 Handler: _RaftMembership_Join_Handler, 1558 }, 1559 { 1560 MethodName: "Leave", 1561 Handler: _RaftMembership_Leave_Handler, 1562 }, 1563 }, 1564 Streams: []grpc.StreamDesc{}, 1565 Metadata: "github.com/docker/swarmkit/api/raft.proto", 1566 } 1567 1568 func (m *RaftMember) Marshal() (dAtA []byte, err error) { 1569 size := m.Size() 1570 dAtA = make([]byte, size) 1571 n, err := m.MarshalTo(dAtA) 1572 if err != nil { 1573 return nil, err 1574 } 1575 return dAtA[:n], nil 1576 } 1577 1578 func (m *RaftMember) MarshalTo(dAtA []byte) (int, error) { 1579 var i int 1580 _ = i 1581 var l int 1582 _ = l 1583 if m.RaftID != 0 { 1584 dAtA[i] = 0x8 1585 i++ 1586 i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) 1587 } 1588 if len(m.NodeID) > 0 { 1589 dAtA[i] = 0x12 1590 i++ 1591 i = encodeVarintRaft(dAtA, i, uint64(len(m.NodeID))) 1592 i += copy(dAtA[i:], m.NodeID) 1593 } 1594 if len(m.Addr) > 0 { 1595 dAtA[i] = 0x1a 1596 i++ 1597 i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) 1598 i += copy(dAtA[i:], m.Addr) 1599 } 1600 dAtA[i] = 0x22 1601 i++ 1602 i = encodeVarintRaft(dAtA, i, uint64(m.Status.Size())) 1603 n1, err := m.Status.MarshalTo(dAtA[i:]) 1604 if err != nil { 1605 return 0, err 1606 } 1607 i += n1 1608 return i, nil 1609 } 1610 1611 func (m *JoinRequest) Marshal() (dAtA []byte, err error) { 1612 size := m.Size() 1613 dAtA = make([]byte, size) 1614 n, err := m.MarshalTo(dAtA) 1615 if err != nil { 1616 return nil, err 1617 } 1618 return dAtA[:n], nil 1619 } 1620 1621 func (m *JoinRequest) MarshalTo(dAtA []byte) (int, error) { 1622 var i int 1623 _ = i 1624 var l int 1625 _ = l 1626 if len(m.Addr) > 0 { 1627 dAtA[i] = 0xa 1628 i++ 1629 i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) 1630 i += copy(dAtA[i:], m.Addr) 1631 } 1632 return i, nil 1633 } 1634 1635 func (m *JoinResponse) Marshal() (dAtA []byte, err error) { 1636 size := m.Size() 1637 dAtA = make([]byte, size) 1638 n, err := m.MarshalTo(dAtA) 1639 if err != nil { 1640 return nil, err 1641 } 1642 return dAtA[:n], nil 1643 } 1644 1645 func (m *JoinResponse) MarshalTo(dAtA []byte) (int, error) { 1646 var i int 1647 _ = i 1648 var l int 1649 _ = l 1650 if m.RaftID != 0 { 1651 dAtA[i] = 0x8 1652 i++ 1653 i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) 1654 } 1655 if len(m.Members) > 0 { 1656 for _, msg := range m.Members { 1657 dAtA[i] = 0x12 1658 i++ 1659 i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) 1660 n, err := msg.MarshalTo(dAtA[i:]) 1661 if err != nil { 1662 return 0, err 1663 } 1664 i += n 1665 } 1666 } 1667 if len(m.RemovedMembers) > 0 { 1668 for _, num := range m.RemovedMembers { 1669 dAtA[i] = 0x18 1670 i++ 1671 i = encodeVarintRaft(dAtA, i, uint64(num)) 1672 } 1673 } 1674 return i, nil 1675 } 1676 1677 func (m *LeaveRequest) Marshal() (dAtA []byte, err error) { 1678 size := m.Size() 1679 dAtA = make([]byte, size) 1680 n, err := m.MarshalTo(dAtA) 1681 if err != nil { 1682 return nil, err 1683 } 1684 return dAtA[:n], nil 1685 } 1686 1687 func (m *LeaveRequest) MarshalTo(dAtA []byte) (int, error) { 1688 var i int 1689 _ = i 1690 var l int 1691 _ = l 1692 if m.Node != nil { 1693 dAtA[i] = 0xa 1694 i++ 1695 i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size())) 1696 n2, err := m.Node.MarshalTo(dAtA[i:]) 1697 if err != nil { 1698 return 0, err 1699 } 1700 i += n2 1701 } 1702 return i, nil 1703 } 1704 1705 func (m *LeaveResponse) Marshal() (dAtA []byte, err error) { 1706 size := m.Size() 1707 dAtA = make([]byte, size) 1708 n, err := m.MarshalTo(dAtA) 1709 if err != nil { 1710 return nil, err 1711 } 1712 return dAtA[:n], nil 1713 } 1714 1715 func (m *LeaveResponse) MarshalTo(dAtA []byte) (int, error) { 1716 var i int 1717 _ = i 1718 var l int 1719 _ = l 1720 return i, nil 1721 } 1722 1723 func (m *ProcessRaftMessageRequest) Marshal() (dAtA []byte, err error) { 1724 size := m.Size() 1725 dAtA = make([]byte, size) 1726 n, err := m.MarshalTo(dAtA) 1727 if err != nil { 1728 return nil, err 1729 } 1730 return dAtA[:n], nil 1731 } 1732 1733 func (m *ProcessRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { 1734 var i int 1735 _ = i 1736 var l int 1737 _ = l 1738 if m.Message != nil { 1739 dAtA[i] = 0xa 1740 i++ 1741 i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size())) 1742 n3, err := m.Message.MarshalTo(dAtA[i:]) 1743 if err != nil { 1744 return 0, err 1745 } 1746 i += n3 1747 } 1748 return i, nil 1749 } 1750 1751 func (m *ProcessRaftMessageResponse) Marshal() (dAtA []byte, err error) { 1752 size := m.Size() 1753 dAtA = make([]byte, size) 1754 n, err := m.MarshalTo(dAtA) 1755 if err != nil { 1756 return nil, err 1757 } 1758 return dAtA[:n], nil 1759 } 1760 1761 func (m *ProcessRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { 1762 var i int 1763 _ = i 1764 var l int 1765 _ = l 1766 return i, nil 1767 } 1768 1769 func (m *StreamRaftMessageRequest) Marshal() (dAtA []byte, err error) { 1770 size := m.Size() 1771 dAtA = make([]byte, size) 1772 n, err := m.MarshalTo(dAtA) 1773 if err != nil { 1774 return nil, err 1775 } 1776 return dAtA[:n], nil 1777 } 1778 1779 func (m *StreamRaftMessageRequest) MarshalTo(dAtA []byte) (int, error) { 1780 var i int 1781 _ = i 1782 var l int 1783 _ = l 1784 if m.Message != nil { 1785 dAtA[i] = 0xa 1786 i++ 1787 i = encodeVarintRaft(dAtA, i, uint64(m.Message.Size())) 1788 n4, err := m.Message.MarshalTo(dAtA[i:]) 1789 if err != nil { 1790 return 0, err 1791 } 1792 i += n4 1793 } 1794 return i, nil 1795 } 1796 1797 func (m *StreamRaftMessageResponse) Marshal() (dAtA []byte, err error) { 1798 size := m.Size() 1799 dAtA = make([]byte, size) 1800 n, err := m.MarshalTo(dAtA) 1801 if err != nil { 1802 return nil, err 1803 } 1804 return dAtA[:n], nil 1805 } 1806 1807 func (m *StreamRaftMessageResponse) MarshalTo(dAtA []byte) (int, error) { 1808 var i int 1809 _ = i 1810 var l int 1811 _ = l 1812 return i, nil 1813 } 1814 1815 func (m *ResolveAddressRequest) Marshal() (dAtA []byte, err error) { 1816 size := m.Size() 1817 dAtA = make([]byte, size) 1818 n, err := m.MarshalTo(dAtA) 1819 if err != nil { 1820 return nil, err 1821 } 1822 return dAtA[:n], nil 1823 } 1824 1825 func (m *ResolveAddressRequest) MarshalTo(dAtA []byte) (int, error) { 1826 var i int 1827 _ = i 1828 var l int 1829 _ = l 1830 if m.RaftID != 0 { 1831 dAtA[i] = 0x8 1832 i++ 1833 i = encodeVarintRaft(dAtA, i, uint64(m.RaftID)) 1834 } 1835 return i, nil 1836 } 1837 1838 func (m *ResolveAddressResponse) Marshal() (dAtA []byte, err error) { 1839 size := m.Size() 1840 dAtA = make([]byte, size) 1841 n, err := m.MarshalTo(dAtA) 1842 if err != nil { 1843 return nil, err 1844 } 1845 return dAtA[:n], nil 1846 } 1847 1848 func (m *ResolveAddressResponse) MarshalTo(dAtA []byte) (int, error) { 1849 var i int 1850 _ = i 1851 var l int 1852 _ = l 1853 if len(m.Addr) > 0 { 1854 dAtA[i] = 0xa 1855 i++ 1856 i = encodeVarintRaft(dAtA, i, uint64(len(m.Addr))) 1857 i += copy(dAtA[i:], m.Addr) 1858 } 1859 return i, nil 1860 } 1861 1862 func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { 1863 size := m.Size() 1864 dAtA = make([]byte, size) 1865 n, err := m.MarshalTo(dAtA) 1866 if err != nil { 1867 return nil, err 1868 } 1869 return dAtA[:n], nil 1870 } 1871 1872 func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { 1873 var i int 1874 _ = i 1875 var l int 1876 _ = l 1877 if m.ID != 0 { 1878 dAtA[i] = 0x8 1879 i++ 1880 i = encodeVarintRaft(dAtA, i, uint64(m.ID)) 1881 } 1882 if len(m.Action) > 0 { 1883 for _, msg := range m.Action { 1884 dAtA[i] = 0x12 1885 i++ 1886 i = encodeVarintRaft(dAtA, i, uint64(msg.Size())) 1887 n, err := msg.MarshalTo(dAtA[i:]) 1888 if err != nil { 1889 return 0, err 1890 } 1891 i += n 1892 } 1893 } 1894 return i, nil 1895 } 1896 1897 func (m *StoreAction) Marshal() (dAtA []byte, err error) { 1898 size := m.Size() 1899 dAtA = make([]byte, size) 1900 n, err := m.MarshalTo(dAtA) 1901 if err != nil { 1902 return nil, err 1903 } 1904 return dAtA[:n], nil 1905 } 1906 1907 func (m *StoreAction) MarshalTo(dAtA []byte) (int, error) { 1908 var i int 1909 _ = i 1910 var l int 1911 _ = l 1912 if m.Action != 0 { 1913 dAtA[i] = 0x8 1914 i++ 1915 i = encodeVarintRaft(dAtA, i, uint64(m.Action)) 1916 } 1917 if m.Target != nil { 1918 nn5, err := m.Target.MarshalTo(dAtA[i:]) 1919 if err != nil { 1920 return 0, err 1921 } 1922 i += nn5 1923 } 1924 return i, nil 1925 } 1926 1927 func (m *StoreAction_Node) MarshalTo(dAtA []byte) (int, error) { 1928 i := 0 1929 if m.Node != nil { 1930 dAtA[i] = 0x12 1931 i++ 1932 i = encodeVarintRaft(dAtA, i, uint64(m.Node.Size())) 1933 n6, err := m.Node.MarshalTo(dAtA[i:]) 1934 if err != nil { 1935 return 0, err 1936 } 1937 i += n6 1938 } 1939 return i, nil 1940 } 1941 func (m *StoreAction_Service) MarshalTo(dAtA []byte) (int, error) { 1942 i := 0 1943 if m.Service != nil { 1944 dAtA[i] = 0x1a 1945 i++ 1946 i = encodeVarintRaft(dAtA, i, uint64(m.Service.Size())) 1947 n7, err := m.Service.MarshalTo(dAtA[i:]) 1948 if err != nil { 1949 return 0, err 1950 } 1951 i += n7 1952 } 1953 return i, nil 1954 } 1955 func (m *StoreAction_Task) MarshalTo(dAtA []byte) (int, error) { 1956 i := 0 1957 if m.Task != nil { 1958 dAtA[i] = 0x22 1959 i++ 1960 i = encodeVarintRaft(dAtA, i, uint64(m.Task.Size())) 1961 n8, err := m.Task.MarshalTo(dAtA[i:]) 1962 if err != nil { 1963 return 0, err 1964 } 1965 i += n8 1966 } 1967 return i, nil 1968 } 1969 func (m *StoreAction_Network) MarshalTo(dAtA []byte) (int, error) { 1970 i := 0 1971 if m.Network != nil { 1972 dAtA[i] = 0x2a 1973 i++ 1974 i = encodeVarintRaft(dAtA, i, uint64(m.Network.Size())) 1975 n9, err := m.Network.MarshalTo(dAtA[i:]) 1976 if err != nil { 1977 return 0, err 1978 } 1979 i += n9 1980 } 1981 return i, nil 1982 } 1983 func (m *StoreAction_Cluster) MarshalTo(dAtA []byte) (int, error) { 1984 i := 0 1985 if m.Cluster != nil { 1986 dAtA[i] = 0x32 1987 i++ 1988 i = encodeVarintRaft(dAtA, i, uint64(m.Cluster.Size())) 1989 n10, err := m.Cluster.MarshalTo(dAtA[i:]) 1990 if err != nil { 1991 return 0, err 1992 } 1993 i += n10 1994 } 1995 return i, nil 1996 } 1997 func (m *StoreAction_Secret) MarshalTo(dAtA []byte) (int, error) { 1998 i := 0 1999 if m.Secret != nil { 2000 dAtA[i] = 0x3a 2001 i++ 2002 i = encodeVarintRaft(dAtA, i, uint64(m.Secret.Size())) 2003 n11, err := m.Secret.MarshalTo(dAtA[i:]) 2004 if err != nil { 2005 return 0, err 2006 } 2007 i += n11 2008 } 2009 return i, nil 2010 } 2011 func (m *StoreAction_Resource) MarshalTo(dAtA []byte) (int, error) { 2012 i := 0 2013 if m.Resource != nil { 2014 dAtA[i] = 0x42 2015 i++ 2016 i = encodeVarintRaft(dAtA, i, uint64(m.Resource.Size())) 2017 n12, err := m.Resource.MarshalTo(dAtA[i:]) 2018 if err != nil { 2019 return 0, err 2020 } 2021 i += n12 2022 } 2023 return i, nil 2024 } 2025 func (m *StoreAction_Extension) MarshalTo(dAtA []byte) (int, error) { 2026 i := 0 2027 if m.Extension != nil { 2028 dAtA[i] = 0x4a 2029 i++ 2030 i = encodeVarintRaft(dAtA, i, uint64(m.Extension.Size())) 2031 n13, err := m.Extension.MarshalTo(dAtA[i:]) 2032 if err != nil { 2033 return 0, err 2034 } 2035 i += n13 2036 } 2037 return i, nil 2038 } 2039 func (m *StoreAction_Config) MarshalTo(dAtA []byte) (int, error) { 2040 i := 0 2041 if m.Config != nil { 2042 dAtA[i] = 0x52 2043 i++ 2044 i = encodeVarintRaft(dAtA, i, uint64(m.Config.Size())) 2045 n14, err := m.Config.MarshalTo(dAtA[i:]) 2046 if err != nil { 2047 return 0, err 2048 } 2049 i += n14 2050 } 2051 return i, nil 2052 } 2053 func encodeVarintRaft(dAtA []byte, offset int, v uint64) int { 2054 for v >= 1<<7 { 2055 dAtA[offset] = uint8(v&0x7f | 0x80) 2056 v >>= 7 2057 offset++ 2058 } 2059 dAtA[offset] = uint8(v) 2060 return offset + 1 2061 } 2062 2063 type raftProxyRaftServer struct { 2064 local RaftServer 2065 connSelector raftselector.ConnProvider 2066 localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) 2067 } 2068 2069 func NewRaftProxyRaftServer(local RaftServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftServer { 2070 redirectChecker := func(ctx context.Context) (context.Context, error) { 2071 p, ok := peer.FromContext(ctx) 2072 if !ok { 2073 return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") 2074 } 2075 addr := p.Addr.String() 2076 md, ok := metadata.FromIncomingContext(ctx) 2077 if ok && len(md["redirect"]) != 0 { 2078 return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) 2079 } 2080 if !ok { 2081 md = metadata.New(map[string]string{}) 2082 } 2083 md["redirect"] = append(md["redirect"], addr) 2084 return metadata.NewOutgoingContext(ctx, md), nil 2085 } 2086 remoteMods := []func(context.Context) (context.Context, error){redirectChecker} 2087 remoteMods = append(remoteMods, remoteCtxMod) 2088 2089 var localMods []func(context.Context) (context.Context, error) 2090 if localCtxMod != nil { 2091 localMods = []func(context.Context) (context.Context, error){localCtxMod} 2092 } 2093 2094 return &raftProxyRaftServer{ 2095 local: local, 2096 connSelector: connSelector, 2097 localCtxMods: localMods, 2098 remoteCtxMods: remoteMods, 2099 } 2100 } 2101 func (p *raftProxyRaftServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { 2102 var err error 2103 for _, mod := range ctxMods { 2104 ctx, err = mod(ctx) 2105 if err != nil { 2106 return ctx, err 2107 } 2108 } 2109 return ctx, nil 2110 } 2111 func (p *raftProxyRaftServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { 2112 ticker := rafttime.NewTicker(500 * rafttime.Millisecond) 2113 defer ticker.Stop() 2114 for { 2115 select { 2116 case <-ticker.C: 2117 conn, err := p.connSelector.LeaderConn(ctx) 2118 if err != nil { 2119 return nil, err 2120 } 2121 2122 client := NewHealthClient(conn) 2123 2124 resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) 2125 if err != nil || resp.Status != HealthCheckResponse_SERVING { 2126 continue 2127 } 2128 return conn, nil 2129 case <-ctx.Done(): 2130 return nil, ctx.Err() 2131 } 2132 } 2133 } 2134 2135 func (p *raftProxyRaftServer) ProcessRaftMessage(ctx context.Context, r *ProcessRaftMessageRequest) (*ProcessRaftMessageResponse, error) { 2136 2137 conn, err := p.connSelector.LeaderConn(ctx) 2138 if err != nil { 2139 if err == raftselector.ErrIsLeader { 2140 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 2141 if err != nil { 2142 return nil, err 2143 } 2144 return p.local.ProcessRaftMessage(ctx, r) 2145 } 2146 return nil, err 2147 } 2148 modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) 2149 if err != nil { 2150 return nil, err 2151 } 2152 2153 resp, err := NewRaftClient(conn).ProcessRaftMessage(modCtx, r) 2154 if err != nil { 2155 if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { 2156 return resp, err 2157 } 2158 conn, err := p.pollNewLeaderConn(ctx) 2159 if err != nil { 2160 if err == raftselector.ErrIsLeader { 2161 return p.local.ProcessRaftMessage(ctx, r) 2162 } 2163 return nil, err 2164 } 2165 return NewRaftClient(conn).ProcessRaftMessage(modCtx, r) 2166 } 2167 return resp, err 2168 } 2169 2170 type Raft_StreamRaftMessageServerWrapper struct { 2171 Raft_StreamRaftMessageServer 2172 ctx context.Context 2173 } 2174 2175 func (s Raft_StreamRaftMessageServerWrapper) Context() context.Context { 2176 return s.ctx 2177 } 2178 2179 func (p *raftProxyRaftServer) StreamRaftMessage(stream Raft_StreamRaftMessageServer) error { 2180 ctx := stream.Context() 2181 conn, err := p.connSelector.LeaderConn(ctx) 2182 if err != nil { 2183 if err == raftselector.ErrIsLeader { 2184 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 2185 if err != nil { 2186 return err 2187 } 2188 streamWrapper := Raft_StreamRaftMessageServerWrapper{ 2189 Raft_StreamRaftMessageServer: stream, 2190 ctx: ctx, 2191 } 2192 return p.local.StreamRaftMessage(streamWrapper) 2193 } 2194 return err 2195 } 2196 ctx, err = p.runCtxMods(ctx, p.remoteCtxMods) 2197 if err != nil { 2198 return err 2199 } 2200 clientStream, err := NewRaftClient(conn).StreamRaftMessage(ctx) 2201 2202 if err != nil { 2203 return err 2204 } 2205 2206 for { 2207 msg, err := stream.Recv() 2208 if err == io.EOF { 2209 break 2210 } 2211 if err != nil { 2212 return err 2213 } 2214 if err := clientStream.Send(msg); err != nil { 2215 return err 2216 } 2217 } 2218 2219 reply, err := clientStream.CloseAndRecv() 2220 if err != nil { 2221 return err 2222 } 2223 2224 return stream.SendAndClose(reply) 2225 } 2226 2227 func (p *raftProxyRaftServer) ResolveAddress(ctx context.Context, r *ResolveAddressRequest) (*ResolveAddressResponse, error) { 2228 2229 conn, err := p.connSelector.LeaderConn(ctx) 2230 if err != nil { 2231 if err == raftselector.ErrIsLeader { 2232 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 2233 if err != nil { 2234 return nil, err 2235 } 2236 return p.local.ResolveAddress(ctx, r) 2237 } 2238 return nil, err 2239 } 2240 modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) 2241 if err != nil { 2242 return nil, err 2243 } 2244 2245 resp, err := NewRaftClient(conn).ResolveAddress(modCtx, r) 2246 if err != nil { 2247 if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { 2248 return resp, err 2249 } 2250 conn, err := p.pollNewLeaderConn(ctx) 2251 if err != nil { 2252 if err == raftselector.ErrIsLeader { 2253 return p.local.ResolveAddress(ctx, r) 2254 } 2255 return nil, err 2256 } 2257 return NewRaftClient(conn).ResolveAddress(modCtx, r) 2258 } 2259 return resp, err 2260 } 2261 2262 type raftProxyRaftMembershipServer struct { 2263 local RaftMembershipServer 2264 connSelector raftselector.ConnProvider 2265 localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error) 2266 } 2267 2268 func NewRaftProxyRaftMembershipServer(local RaftMembershipServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftMembershipServer { 2269 redirectChecker := func(ctx context.Context) (context.Context, error) { 2270 p, ok := peer.FromContext(ctx) 2271 if !ok { 2272 return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context") 2273 } 2274 addr := p.Addr.String() 2275 md, ok := metadata.FromIncomingContext(ctx) 2276 if ok && len(md["redirect"]) != 0 { 2277 return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"]) 2278 } 2279 if !ok { 2280 md = metadata.New(map[string]string{}) 2281 } 2282 md["redirect"] = append(md["redirect"], addr) 2283 return metadata.NewOutgoingContext(ctx, md), nil 2284 } 2285 remoteMods := []func(context.Context) (context.Context, error){redirectChecker} 2286 remoteMods = append(remoteMods, remoteCtxMod) 2287 2288 var localMods []func(context.Context) (context.Context, error) 2289 if localCtxMod != nil { 2290 localMods = []func(context.Context) (context.Context, error){localCtxMod} 2291 } 2292 2293 return &raftProxyRaftMembershipServer{ 2294 local: local, 2295 connSelector: connSelector, 2296 localCtxMods: localMods, 2297 remoteCtxMods: remoteMods, 2298 } 2299 } 2300 func (p *raftProxyRaftMembershipServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) { 2301 var err error 2302 for _, mod := range ctxMods { 2303 ctx, err = mod(ctx) 2304 if err != nil { 2305 return ctx, err 2306 } 2307 } 2308 return ctx, nil 2309 } 2310 func (p *raftProxyRaftMembershipServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) { 2311 ticker := rafttime.NewTicker(500 * rafttime.Millisecond) 2312 defer ticker.Stop() 2313 for { 2314 select { 2315 case <-ticker.C: 2316 conn, err := p.connSelector.LeaderConn(ctx) 2317 if err != nil { 2318 return nil, err 2319 } 2320 2321 client := NewHealthClient(conn) 2322 2323 resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"}) 2324 if err != nil || resp.Status != HealthCheckResponse_SERVING { 2325 continue 2326 } 2327 return conn, nil 2328 case <-ctx.Done(): 2329 return nil, ctx.Err() 2330 } 2331 } 2332 } 2333 2334 func (p *raftProxyRaftMembershipServer) Join(ctx context.Context, r *JoinRequest) (*JoinResponse, error) { 2335 2336 conn, err := p.connSelector.LeaderConn(ctx) 2337 if err != nil { 2338 if err == raftselector.ErrIsLeader { 2339 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 2340 if err != nil { 2341 return nil, err 2342 } 2343 return p.local.Join(ctx, r) 2344 } 2345 return nil, err 2346 } 2347 modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) 2348 if err != nil { 2349 return nil, err 2350 } 2351 2352 resp, err := NewRaftMembershipClient(conn).Join(modCtx, r) 2353 if err != nil { 2354 if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { 2355 return resp, err 2356 } 2357 conn, err := p.pollNewLeaderConn(ctx) 2358 if err != nil { 2359 if err == raftselector.ErrIsLeader { 2360 return p.local.Join(ctx, r) 2361 } 2362 return nil, err 2363 } 2364 return NewRaftMembershipClient(conn).Join(modCtx, r) 2365 } 2366 return resp, err 2367 } 2368 2369 func (p *raftProxyRaftMembershipServer) Leave(ctx context.Context, r *LeaveRequest) (*LeaveResponse, error) { 2370 2371 conn, err := p.connSelector.LeaderConn(ctx) 2372 if err != nil { 2373 if err == raftselector.ErrIsLeader { 2374 ctx, err = p.runCtxMods(ctx, p.localCtxMods) 2375 if err != nil { 2376 return nil, err 2377 } 2378 return p.local.Leave(ctx, r) 2379 } 2380 return nil, err 2381 } 2382 modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods) 2383 if err != nil { 2384 return nil, err 2385 } 2386 2387 resp, err := NewRaftMembershipClient(conn).Leave(modCtx, r) 2388 if err != nil { 2389 if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") { 2390 return resp, err 2391 } 2392 conn, err := p.pollNewLeaderConn(ctx) 2393 if err != nil { 2394 if err == raftselector.ErrIsLeader { 2395 return p.local.Leave(ctx, r) 2396 } 2397 return nil, err 2398 } 2399 return NewRaftMembershipClient(conn).Leave(modCtx, r) 2400 } 2401 return resp, err 2402 } 2403 2404 func (m *RaftMember) Size() (n int) { 2405 if m == nil { 2406 return 0 2407 } 2408 var l int 2409 _ = l 2410 if m.RaftID != 0 { 2411 n += 1 + sovRaft(uint64(m.RaftID)) 2412 } 2413 l = len(m.NodeID) 2414 if l > 0 { 2415 n += 1 + l + sovRaft(uint64(l)) 2416 } 2417 l = len(m.Addr) 2418 if l > 0 { 2419 n += 1 + l + sovRaft(uint64(l)) 2420 } 2421 l = m.Status.Size() 2422 n += 1 + l + sovRaft(uint64(l)) 2423 return n 2424 } 2425 2426 func (m *JoinRequest) Size() (n int) { 2427 if m == nil { 2428 return 0 2429 } 2430 var l int 2431 _ = l 2432 l = len(m.Addr) 2433 if l > 0 { 2434 n += 1 + l + sovRaft(uint64(l)) 2435 } 2436 return n 2437 } 2438 2439 func (m *JoinResponse) Size() (n int) { 2440 if m == nil { 2441 return 0 2442 } 2443 var l int 2444 _ = l 2445 if m.RaftID != 0 { 2446 n += 1 + sovRaft(uint64(m.RaftID)) 2447 } 2448 if len(m.Members) > 0 { 2449 for _, e := range m.Members { 2450 l = e.Size() 2451 n += 1 + l + sovRaft(uint64(l)) 2452 } 2453 } 2454 if len(m.RemovedMembers) > 0 { 2455 for _, e := range m.RemovedMembers { 2456 n += 1 + sovRaft(uint64(e)) 2457 } 2458 } 2459 return n 2460 } 2461 2462 func (m *LeaveRequest) Size() (n int) { 2463 if m == nil { 2464 return 0 2465 } 2466 var l int 2467 _ = l 2468 if m.Node != nil { 2469 l = m.Node.Size() 2470 n += 1 + l + sovRaft(uint64(l)) 2471 } 2472 return n 2473 } 2474 2475 func (m *LeaveResponse) Size() (n int) { 2476 if m == nil { 2477 return 0 2478 } 2479 var l int 2480 _ = l 2481 return n 2482 } 2483 2484 func (m *ProcessRaftMessageRequest) Size() (n int) { 2485 if m == nil { 2486 return 0 2487 } 2488 var l int 2489 _ = l 2490 if m.Message != nil { 2491 l = m.Message.Size() 2492 n += 1 + l + sovRaft(uint64(l)) 2493 } 2494 return n 2495 } 2496 2497 func (m *ProcessRaftMessageResponse) Size() (n int) { 2498 if m == nil { 2499 return 0 2500 } 2501 var l int 2502 _ = l 2503 return n 2504 } 2505 2506 func (m *StreamRaftMessageRequest) Size() (n int) { 2507 if m == nil { 2508 return 0 2509 } 2510 var l int 2511 _ = l 2512 if m.Message != nil { 2513 l = m.Message.Size() 2514 n += 1 + l + sovRaft(uint64(l)) 2515 } 2516 return n 2517 } 2518 2519 func (m *StreamRaftMessageResponse) Size() (n int) { 2520 if m == nil { 2521 return 0 2522 } 2523 var l int 2524 _ = l 2525 return n 2526 } 2527 2528 func (m *ResolveAddressRequest) Size() (n int) { 2529 if m == nil { 2530 return 0 2531 } 2532 var l int 2533 _ = l 2534 if m.RaftID != 0 { 2535 n += 1 + sovRaft(uint64(m.RaftID)) 2536 } 2537 return n 2538 } 2539 2540 func (m *ResolveAddressResponse) Size() (n int) { 2541 if m == nil { 2542 return 0 2543 } 2544 var l int 2545 _ = l 2546 l = len(m.Addr) 2547 if l > 0 { 2548 n += 1 + l + sovRaft(uint64(l)) 2549 } 2550 return n 2551 } 2552 2553 func (m *InternalRaftRequest) Size() (n int) { 2554 if m == nil { 2555 return 0 2556 } 2557 var l int 2558 _ = l 2559 if m.ID != 0 { 2560 n += 1 + sovRaft(uint64(m.ID)) 2561 } 2562 if len(m.Action) > 0 { 2563 for _, e := range m.Action { 2564 l = e.Size() 2565 n += 1 + l + sovRaft(uint64(l)) 2566 } 2567 } 2568 return n 2569 } 2570 2571 func (m *StoreAction) Size() (n int) { 2572 if m == nil { 2573 return 0 2574 } 2575 var l int 2576 _ = l 2577 if m.Action != 0 { 2578 n += 1 + sovRaft(uint64(m.Action)) 2579 } 2580 if m.Target != nil { 2581 n += m.Target.Size() 2582 } 2583 return n 2584 } 2585 2586 func (m *StoreAction_Node) Size() (n int) { 2587 if m == nil { 2588 return 0 2589 } 2590 var l int 2591 _ = l 2592 if m.Node != nil { 2593 l = m.Node.Size() 2594 n += 1 + l + sovRaft(uint64(l)) 2595 } 2596 return n 2597 } 2598 func (m *StoreAction_Service) Size() (n int) { 2599 if m == nil { 2600 return 0 2601 } 2602 var l int 2603 _ = l 2604 if m.Service != nil { 2605 l = m.Service.Size() 2606 n += 1 + l + sovRaft(uint64(l)) 2607 } 2608 return n 2609 } 2610 func (m *StoreAction_Task) Size() (n int) { 2611 if m == nil { 2612 return 0 2613 } 2614 var l int 2615 _ = l 2616 if m.Task != nil { 2617 l = m.Task.Size() 2618 n += 1 + l + sovRaft(uint64(l)) 2619 } 2620 return n 2621 } 2622 func (m *StoreAction_Network) Size() (n int) { 2623 if m == nil { 2624 return 0 2625 } 2626 var l int 2627 _ = l 2628 if m.Network != nil { 2629 l = m.Network.Size() 2630 n += 1 + l + sovRaft(uint64(l)) 2631 } 2632 return n 2633 } 2634 func (m *StoreAction_Cluster) Size() (n int) { 2635 if m == nil { 2636 return 0 2637 } 2638 var l int 2639 _ = l 2640 if m.Cluster != nil { 2641 l = m.Cluster.Size() 2642 n += 1 + l + sovRaft(uint64(l)) 2643 } 2644 return n 2645 } 2646 func (m *StoreAction_Secret) Size() (n int) { 2647 if m == nil { 2648 return 0 2649 } 2650 var l int 2651 _ = l 2652 if m.Secret != nil { 2653 l = m.Secret.Size() 2654 n += 1 + l + sovRaft(uint64(l)) 2655 } 2656 return n 2657 } 2658 func (m *StoreAction_Resource) Size() (n int) { 2659 if m == nil { 2660 return 0 2661 } 2662 var l int 2663 _ = l 2664 if m.Resource != nil { 2665 l = m.Resource.Size() 2666 n += 1 + l + sovRaft(uint64(l)) 2667 } 2668 return n 2669 } 2670 func (m *StoreAction_Extension) Size() (n int) { 2671 if m == nil { 2672 return 0 2673 } 2674 var l int 2675 _ = l 2676 if m.Extension != nil { 2677 l = m.Extension.Size() 2678 n += 1 + l + sovRaft(uint64(l)) 2679 } 2680 return n 2681 } 2682 func (m *StoreAction_Config) Size() (n int) { 2683 if m == nil { 2684 return 0 2685 } 2686 var l int 2687 _ = l 2688 if m.Config != nil { 2689 l = m.Config.Size() 2690 n += 1 + l + sovRaft(uint64(l)) 2691 } 2692 return n 2693 } 2694 2695 func sovRaft(x uint64) (n int) { 2696 for { 2697 n++ 2698 x >>= 7 2699 if x == 0 { 2700 break 2701 } 2702 } 2703 return n 2704 } 2705 func sozRaft(x uint64) (n int) { 2706 return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 2707 } 2708 func (this *RaftMember) String() string { 2709 if this == nil { 2710 return "nil" 2711 } 2712 s := strings.Join([]string{`&RaftMember{`, 2713 `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, 2714 `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`, 2715 `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, 2716 `Status:` + strings.Replace(strings.Replace(this.Status.String(), "RaftMemberStatus", "RaftMemberStatus", 1), `&`, ``, 1) + `,`, 2717 `}`, 2718 }, "") 2719 return s 2720 } 2721 func (this *JoinRequest) String() string { 2722 if this == nil { 2723 return "nil" 2724 } 2725 s := strings.Join([]string{`&JoinRequest{`, 2726 `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, 2727 `}`, 2728 }, "") 2729 return s 2730 } 2731 func (this *JoinResponse) String() string { 2732 if this == nil { 2733 return "nil" 2734 } 2735 s := strings.Join([]string{`&JoinResponse{`, 2736 `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, 2737 `Members:` + strings.Replace(fmt.Sprintf("%v", this.Members), "RaftMember", "RaftMember", 1) + `,`, 2738 `RemovedMembers:` + fmt.Sprintf("%v", this.RemovedMembers) + `,`, 2739 `}`, 2740 }, "") 2741 return s 2742 } 2743 func (this *LeaveRequest) String() string { 2744 if this == nil { 2745 return "nil" 2746 } 2747 s := strings.Join([]string{`&LeaveRequest{`, 2748 `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "RaftMember", "RaftMember", 1) + `,`, 2749 `}`, 2750 }, "") 2751 return s 2752 } 2753 func (this *LeaveResponse) String() string { 2754 if this == nil { 2755 return "nil" 2756 } 2757 s := strings.Join([]string{`&LeaveResponse{`, 2758 `}`, 2759 }, "") 2760 return s 2761 } 2762 func (this *ProcessRaftMessageRequest) String() string { 2763 if this == nil { 2764 return "nil" 2765 } 2766 s := strings.Join([]string{`&ProcessRaftMessageRequest{`, 2767 `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Message", "raftpb.Message", 1) + `,`, 2768 `}`, 2769 }, "") 2770 return s 2771 } 2772 func (this *ProcessRaftMessageResponse) String() string { 2773 if this == nil { 2774 return "nil" 2775 } 2776 s := strings.Join([]string{`&ProcessRaftMessageResponse{`, 2777 `}`, 2778 }, "") 2779 return s 2780 } 2781 func (this *StreamRaftMessageRequest) String() string { 2782 if this == nil { 2783 return "nil" 2784 } 2785 s := strings.Join([]string{`&StreamRaftMessageRequest{`, 2786 `Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Message", "raftpb.Message", 1) + `,`, 2787 `}`, 2788 }, "") 2789 return s 2790 } 2791 func (this *StreamRaftMessageResponse) String() string { 2792 if this == nil { 2793 return "nil" 2794 } 2795 s := strings.Join([]string{`&StreamRaftMessageResponse{`, 2796 `}`, 2797 }, "") 2798 return s 2799 } 2800 func (this *ResolveAddressRequest) String() string { 2801 if this == nil { 2802 return "nil" 2803 } 2804 s := strings.Join([]string{`&ResolveAddressRequest{`, 2805 `RaftID:` + fmt.Sprintf("%v", this.RaftID) + `,`, 2806 `}`, 2807 }, "") 2808 return s 2809 } 2810 func (this *ResolveAddressResponse) String() string { 2811 if this == nil { 2812 return "nil" 2813 } 2814 s := strings.Join([]string{`&ResolveAddressResponse{`, 2815 `Addr:` + fmt.Sprintf("%v", this.Addr) + `,`, 2816 `}`, 2817 }, "") 2818 return s 2819 } 2820 func (this *InternalRaftRequest) String() string { 2821 if this == nil { 2822 return "nil" 2823 } 2824 s := strings.Join([]string{`&InternalRaftRequest{`, 2825 `ID:` + fmt.Sprintf("%v", this.ID) + `,`, 2826 `Action:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Action), "StoreAction", "StoreAction", 1), `&`, ``, 1) + `,`, 2827 `}`, 2828 }, "") 2829 return s 2830 } 2831 func (this *StoreAction) String() string { 2832 if this == nil { 2833 return "nil" 2834 } 2835 s := strings.Join([]string{`&StoreAction{`, 2836 `Action:` + fmt.Sprintf("%v", this.Action) + `,`, 2837 `Target:` + fmt.Sprintf("%v", this.Target) + `,`, 2838 `}`, 2839 }, "") 2840 return s 2841 } 2842 func (this *StoreAction_Node) String() string { 2843 if this == nil { 2844 return "nil" 2845 } 2846 s := strings.Join([]string{`&StoreAction_Node{`, 2847 `Node:` + strings.Replace(fmt.Sprintf("%v", this.Node), "Node", "Node", 1) + `,`, 2848 `}`, 2849 }, "") 2850 return s 2851 } 2852 func (this *StoreAction_Service) String() string { 2853 if this == nil { 2854 return "nil" 2855 } 2856 s := strings.Join([]string{`&StoreAction_Service{`, 2857 `Service:` + strings.Replace(fmt.Sprintf("%v", this.Service), "Service", "Service", 1) + `,`, 2858 `}`, 2859 }, "") 2860 return s 2861 } 2862 func (this *StoreAction_Task) String() string { 2863 if this == nil { 2864 return "nil" 2865 } 2866 s := strings.Join([]string{`&StoreAction_Task{`, 2867 `Task:` + strings.Replace(fmt.Sprintf("%v", this.Task), "Task", "Task", 1) + `,`, 2868 `}`, 2869 }, "") 2870 return s 2871 } 2872 func (this *StoreAction_Network) String() string { 2873 if this == nil { 2874 return "nil" 2875 } 2876 s := strings.Join([]string{`&StoreAction_Network{`, 2877 `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, 2878 `}`, 2879 }, "") 2880 return s 2881 } 2882 func (this *StoreAction_Cluster) String() string { 2883 if this == nil { 2884 return "nil" 2885 } 2886 s := strings.Join([]string{`&StoreAction_Cluster{`, 2887 `Cluster:` + strings.Replace(fmt.Sprintf("%v", this.Cluster), "Cluster", "Cluster", 1) + `,`, 2888 `}`, 2889 }, "") 2890 return s 2891 } 2892 func (this *StoreAction_Secret) String() string { 2893 if this == nil { 2894 return "nil" 2895 } 2896 s := strings.Join([]string{`&StoreAction_Secret{`, 2897 `Secret:` + strings.Replace(fmt.Sprintf("%v", this.Secret), "Secret", "Secret", 1) + `,`, 2898 `}`, 2899 }, "") 2900 return s 2901 } 2902 func (this *StoreAction_Resource) String() string { 2903 if this == nil { 2904 return "nil" 2905 } 2906 s := strings.Join([]string{`&StoreAction_Resource{`, 2907 `Resource:` + strings.Replace(fmt.Sprintf("%v", this.Resource), "Resource", "Resource", 1) + `,`, 2908 `}`, 2909 }, "") 2910 return s 2911 } 2912 func (this *StoreAction_Extension) String() string { 2913 if this == nil { 2914 return "nil" 2915 } 2916 s := strings.Join([]string{`&StoreAction_Extension{`, 2917 `Extension:` + strings.Replace(fmt.Sprintf("%v", this.Extension), "Extension", "Extension", 1) + `,`, 2918 `}`, 2919 }, "") 2920 return s 2921 } 2922 func (this *StoreAction_Config) String() string { 2923 if this == nil { 2924 return "nil" 2925 } 2926 s := strings.Join([]string{`&StoreAction_Config{`, 2927 `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "Config", "Config", 1) + `,`, 2928 `}`, 2929 }, "") 2930 return s 2931 } 2932 func valueToStringRaft(v interface{}) string { 2933 rv := reflect.ValueOf(v) 2934 if rv.IsNil() { 2935 return "nil" 2936 } 2937 pv := reflect.Indirect(rv).Interface() 2938 return fmt.Sprintf("*%v", pv) 2939 } 2940 func (m *RaftMember) Unmarshal(dAtA []byte) error { 2941 l := len(dAtA) 2942 iNdEx := 0 2943 for iNdEx < l { 2944 preIndex := iNdEx 2945 var wire uint64 2946 for shift := uint(0); ; shift += 7 { 2947 if shift >= 64 { 2948 return ErrIntOverflowRaft 2949 } 2950 if iNdEx >= l { 2951 return io.ErrUnexpectedEOF 2952 } 2953 b := dAtA[iNdEx] 2954 iNdEx++ 2955 wire |= uint64(b&0x7F) << shift 2956 if b < 0x80 { 2957 break 2958 } 2959 } 2960 fieldNum := int32(wire >> 3) 2961 wireType := int(wire & 0x7) 2962 if wireType == 4 { 2963 return fmt.Errorf("proto: RaftMember: wiretype end group for non-group") 2964 } 2965 if fieldNum <= 0 { 2966 return fmt.Errorf("proto: RaftMember: illegal tag %d (wire type %d)", fieldNum, wire) 2967 } 2968 switch fieldNum { 2969 case 1: 2970 if wireType != 0 { 2971 return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType) 2972 } 2973 m.RaftID = 0 2974 for shift := uint(0); ; shift += 7 { 2975 if shift >= 64 { 2976 return ErrIntOverflowRaft 2977 } 2978 if iNdEx >= l { 2979 return io.ErrUnexpectedEOF 2980 } 2981 b := dAtA[iNdEx] 2982 iNdEx++ 2983 m.RaftID |= uint64(b&0x7F) << shift 2984 if b < 0x80 { 2985 break 2986 } 2987 } 2988 case 2: 2989 if wireType != 2 { 2990 return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) 2991 } 2992 var stringLen uint64 2993 for shift := uint(0); ; shift += 7 { 2994 if shift >= 64 { 2995 return ErrIntOverflowRaft 2996 } 2997 if iNdEx >= l { 2998 return io.ErrUnexpectedEOF 2999 } 3000 b := dAtA[iNdEx] 3001 iNdEx++ 3002 stringLen |= uint64(b&0x7F) << shift 3003 if b < 0x80 { 3004 break 3005 } 3006 } 3007 intStringLen := int(stringLen) 3008 if intStringLen < 0 { 3009 return ErrInvalidLengthRaft 3010 } 3011 postIndex := iNdEx + intStringLen 3012 if postIndex < 0 { 3013 return ErrInvalidLengthRaft 3014 } 3015 if postIndex > l { 3016 return io.ErrUnexpectedEOF 3017 } 3018 m.NodeID = string(dAtA[iNdEx:postIndex]) 3019 iNdEx = postIndex 3020 case 3: 3021 if wireType != 2 { 3022 return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) 3023 } 3024 var stringLen uint64 3025 for shift := uint(0); ; shift += 7 { 3026 if shift >= 64 { 3027 return ErrIntOverflowRaft 3028 } 3029 if iNdEx >= l { 3030 return io.ErrUnexpectedEOF 3031 } 3032 b := dAtA[iNdEx] 3033 iNdEx++ 3034 stringLen |= uint64(b&0x7F) << shift 3035 if b < 0x80 { 3036 break 3037 } 3038 } 3039 intStringLen := int(stringLen) 3040 if intStringLen < 0 { 3041 return ErrInvalidLengthRaft 3042 } 3043 postIndex := iNdEx + intStringLen 3044 if postIndex < 0 { 3045 return ErrInvalidLengthRaft 3046 } 3047 if postIndex > l { 3048 return io.ErrUnexpectedEOF 3049 } 3050 m.Addr = string(dAtA[iNdEx:postIndex]) 3051 iNdEx = postIndex 3052 case 4: 3053 if wireType != 2 { 3054 return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) 3055 } 3056 var msglen int 3057 for shift := uint(0); ; shift += 7 { 3058 if shift >= 64 { 3059 return ErrIntOverflowRaft 3060 } 3061 if iNdEx >= l { 3062 return io.ErrUnexpectedEOF 3063 } 3064 b := dAtA[iNdEx] 3065 iNdEx++ 3066 msglen |= int(b&0x7F) << shift 3067 if b < 0x80 { 3068 break 3069 } 3070 } 3071 if msglen < 0 { 3072 return ErrInvalidLengthRaft 3073 } 3074 postIndex := iNdEx + msglen 3075 if postIndex < 0 { 3076 return ErrInvalidLengthRaft 3077 } 3078 if postIndex > l { 3079 return io.ErrUnexpectedEOF 3080 } 3081 if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 3082 return err 3083 } 3084 iNdEx = postIndex 3085 default: 3086 iNdEx = preIndex 3087 skippy, err := skipRaft(dAtA[iNdEx:]) 3088 if err != nil { 3089 return err 3090 } 3091 if skippy < 0 { 3092 return ErrInvalidLengthRaft 3093 } 3094 if (iNdEx + skippy) < 0 { 3095 return ErrInvalidLengthRaft 3096 } 3097 if (iNdEx + skippy) > l { 3098 return io.ErrUnexpectedEOF 3099 } 3100 iNdEx += skippy 3101 } 3102 } 3103 3104 if iNdEx > l { 3105 return io.ErrUnexpectedEOF 3106 } 3107 return nil 3108 } 3109 func (m *JoinRequest) Unmarshal(dAtA []byte) error { 3110 l := len(dAtA) 3111 iNdEx := 0 3112 for iNdEx < l { 3113 preIndex := iNdEx 3114 var wire uint64 3115 for shift := uint(0); ; shift += 7 { 3116 if shift >= 64 { 3117 return ErrIntOverflowRaft 3118 } 3119 if iNdEx >= l { 3120 return io.ErrUnexpectedEOF 3121 } 3122 b := dAtA[iNdEx] 3123 iNdEx++ 3124 wire |= uint64(b&0x7F) << shift 3125 if b < 0x80 { 3126 break 3127 } 3128 } 3129 fieldNum := int32(wire >> 3) 3130 wireType := int(wire & 0x7) 3131 if wireType == 4 { 3132 return fmt.Errorf("proto: JoinRequest: wiretype end group for non-group") 3133 } 3134 if fieldNum <= 0 { 3135 return fmt.Errorf("proto: JoinRequest: illegal tag %d (wire type %d)", fieldNum, wire) 3136 } 3137 switch fieldNum { 3138 case 1: 3139 if wireType != 2 { 3140 return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) 3141 } 3142 var stringLen uint64 3143 for shift := uint(0); ; shift += 7 { 3144 if shift >= 64 { 3145 return ErrIntOverflowRaft 3146 } 3147 if iNdEx >= l { 3148 return io.ErrUnexpectedEOF 3149 } 3150 b := dAtA[iNdEx] 3151 iNdEx++ 3152 stringLen |= uint64(b&0x7F) << shift 3153 if b < 0x80 { 3154 break 3155 } 3156 } 3157 intStringLen := int(stringLen) 3158 if intStringLen < 0 { 3159 return ErrInvalidLengthRaft 3160 } 3161 postIndex := iNdEx + intStringLen 3162 if postIndex < 0 { 3163 return ErrInvalidLengthRaft 3164 } 3165 if postIndex > l { 3166 return io.ErrUnexpectedEOF 3167 } 3168 m.Addr = string(dAtA[iNdEx:postIndex]) 3169 iNdEx = postIndex 3170 default: 3171 iNdEx = preIndex 3172 skippy, err := skipRaft(dAtA[iNdEx:]) 3173 if err != nil { 3174 return err 3175 } 3176 if skippy < 0 { 3177 return ErrInvalidLengthRaft 3178 } 3179 if (iNdEx + skippy) < 0 { 3180 return ErrInvalidLengthRaft 3181 } 3182 if (iNdEx + skippy) > l { 3183 return io.ErrUnexpectedEOF 3184 } 3185 iNdEx += skippy 3186 } 3187 } 3188 3189 if iNdEx > l { 3190 return io.ErrUnexpectedEOF 3191 } 3192 return nil 3193 } 3194 func (m *JoinResponse) Unmarshal(dAtA []byte) error { 3195 l := len(dAtA) 3196 iNdEx := 0 3197 for iNdEx < l { 3198 preIndex := iNdEx 3199 var wire uint64 3200 for shift := uint(0); ; shift += 7 { 3201 if shift >= 64 { 3202 return ErrIntOverflowRaft 3203 } 3204 if iNdEx >= l { 3205 return io.ErrUnexpectedEOF 3206 } 3207 b := dAtA[iNdEx] 3208 iNdEx++ 3209 wire |= uint64(b&0x7F) << shift 3210 if b < 0x80 { 3211 break 3212 } 3213 } 3214 fieldNum := int32(wire >> 3) 3215 wireType := int(wire & 0x7) 3216 if wireType == 4 { 3217 return fmt.Errorf("proto: JoinResponse: wiretype end group for non-group") 3218 } 3219 if fieldNum <= 0 { 3220 return fmt.Errorf("proto: JoinResponse: illegal tag %d (wire type %d)", fieldNum, wire) 3221 } 3222 switch fieldNum { 3223 case 1: 3224 if wireType != 0 { 3225 return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType) 3226 } 3227 m.RaftID = 0 3228 for shift := uint(0); ; shift += 7 { 3229 if shift >= 64 { 3230 return ErrIntOverflowRaft 3231 } 3232 if iNdEx >= l { 3233 return io.ErrUnexpectedEOF 3234 } 3235 b := dAtA[iNdEx] 3236 iNdEx++ 3237 m.RaftID |= uint64(b&0x7F) << shift 3238 if b < 0x80 { 3239 break 3240 } 3241 } 3242 case 2: 3243 if wireType != 2 { 3244 return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) 3245 } 3246 var msglen int 3247 for shift := uint(0); ; shift += 7 { 3248 if shift >= 64 { 3249 return ErrIntOverflowRaft 3250 } 3251 if iNdEx >= l { 3252 return io.ErrUnexpectedEOF 3253 } 3254 b := dAtA[iNdEx] 3255 iNdEx++ 3256 msglen |= int(b&0x7F) << shift 3257 if b < 0x80 { 3258 break 3259 } 3260 } 3261 if msglen < 0 { 3262 return ErrInvalidLengthRaft 3263 } 3264 postIndex := iNdEx + msglen 3265 if postIndex < 0 { 3266 return ErrInvalidLengthRaft 3267 } 3268 if postIndex > l { 3269 return io.ErrUnexpectedEOF 3270 } 3271 m.Members = append(m.Members, &RaftMember{}) 3272 if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 3273 return err 3274 } 3275 iNdEx = postIndex 3276 case 3: 3277 if wireType == 0 { 3278 var v uint64 3279 for shift := uint(0); ; shift += 7 { 3280 if shift >= 64 { 3281 return ErrIntOverflowRaft 3282 } 3283 if iNdEx >= l { 3284 return io.ErrUnexpectedEOF 3285 } 3286 b := dAtA[iNdEx] 3287 iNdEx++ 3288 v |= uint64(b&0x7F) << shift 3289 if b < 0x80 { 3290 break 3291 } 3292 } 3293 m.RemovedMembers = append(m.RemovedMembers, v) 3294 } else if wireType == 2 { 3295 var packedLen int 3296 for shift := uint(0); ; shift += 7 { 3297 if shift >= 64 { 3298 return ErrIntOverflowRaft 3299 } 3300 if iNdEx >= l { 3301 return io.ErrUnexpectedEOF 3302 } 3303 b := dAtA[iNdEx] 3304 iNdEx++ 3305 packedLen |= int(b&0x7F) << shift 3306 if b < 0x80 { 3307 break 3308 } 3309 } 3310 if packedLen < 0 { 3311 return ErrInvalidLengthRaft 3312 } 3313 postIndex := iNdEx + packedLen 3314 if postIndex < 0 { 3315 return ErrInvalidLengthRaft 3316 } 3317 if postIndex > l { 3318 return io.ErrUnexpectedEOF 3319 } 3320 var elementCount int 3321 var count int 3322 for _, integer := range dAtA[iNdEx:postIndex] { 3323 if integer < 128 { 3324 count++ 3325 } 3326 } 3327 elementCount = count 3328 if elementCount != 0 && len(m.RemovedMembers) == 0 { 3329 m.RemovedMembers = make([]uint64, 0, elementCount) 3330 } 3331 for iNdEx < postIndex { 3332 var v uint64 3333 for shift := uint(0); ; shift += 7 { 3334 if shift >= 64 { 3335 return ErrIntOverflowRaft 3336 } 3337 if iNdEx >= l { 3338 return io.ErrUnexpectedEOF 3339 } 3340 b := dAtA[iNdEx] 3341 iNdEx++ 3342 v |= uint64(b&0x7F) << shift 3343 if b < 0x80 { 3344 break 3345 } 3346 } 3347 m.RemovedMembers = append(m.RemovedMembers, v) 3348 } 3349 } else { 3350 return fmt.Errorf("proto: wrong wireType = %d for field RemovedMembers", wireType) 3351 } 3352 default: 3353 iNdEx = preIndex 3354 skippy, err := skipRaft(dAtA[iNdEx:]) 3355 if err != nil { 3356 return err 3357 } 3358 if skippy < 0 { 3359 return ErrInvalidLengthRaft 3360 } 3361 if (iNdEx + skippy) < 0 { 3362 return ErrInvalidLengthRaft 3363 } 3364 if (iNdEx + skippy) > l { 3365 return io.ErrUnexpectedEOF 3366 } 3367 iNdEx += skippy 3368 } 3369 } 3370 3371 if iNdEx > l { 3372 return io.ErrUnexpectedEOF 3373 } 3374 return nil 3375 } 3376 func (m *LeaveRequest) Unmarshal(dAtA []byte) error { 3377 l := len(dAtA) 3378 iNdEx := 0 3379 for iNdEx < l { 3380 preIndex := iNdEx 3381 var wire uint64 3382 for shift := uint(0); ; shift += 7 { 3383 if shift >= 64 { 3384 return ErrIntOverflowRaft 3385 } 3386 if iNdEx >= l { 3387 return io.ErrUnexpectedEOF 3388 } 3389 b := dAtA[iNdEx] 3390 iNdEx++ 3391 wire |= uint64(b&0x7F) << shift 3392 if b < 0x80 { 3393 break 3394 } 3395 } 3396 fieldNum := int32(wire >> 3) 3397 wireType := int(wire & 0x7) 3398 if wireType == 4 { 3399 return fmt.Errorf("proto: LeaveRequest: wiretype end group for non-group") 3400 } 3401 if fieldNum <= 0 { 3402 return fmt.Errorf("proto: LeaveRequest: illegal tag %d (wire type %d)", fieldNum, wire) 3403 } 3404 switch fieldNum { 3405 case 1: 3406 if wireType != 2 { 3407 return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) 3408 } 3409 var msglen int 3410 for shift := uint(0); ; shift += 7 { 3411 if shift >= 64 { 3412 return ErrIntOverflowRaft 3413 } 3414 if iNdEx >= l { 3415 return io.ErrUnexpectedEOF 3416 } 3417 b := dAtA[iNdEx] 3418 iNdEx++ 3419 msglen |= int(b&0x7F) << shift 3420 if b < 0x80 { 3421 break 3422 } 3423 } 3424 if msglen < 0 { 3425 return ErrInvalidLengthRaft 3426 } 3427 postIndex := iNdEx + msglen 3428 if postIndex < 0 { 3429 return ErrInvalidLengthRaft 3430 } 3431 if postIndex > l { 3432 return io.ErrUnexpectedEOF 3433 } 3434 if m.Node == nil { 3435 m.Node = &RaftMember{} 3436 } 3437 if err := m.Node.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 3438 return err 3439 } 3440 iNdEx = postIndex 3441 default: 3442 iNdEx = preIndex 3443 skippy, err := skipRaft(dAtA[iNdEx:]) 3444 if err != nil { 3445 return err 3446 } 3447 if skippy < 0 { 3448 return ErrInvalidLengthRaft 3449 } 3450 if (iNdEx + skippy) < 0 { 3451 return ErrInvalidLengthRaft 3452 } 3453 if (iNdEx + skippy) > l { 3454 return io.ErrUnexpectedEOF 3455 } 3456 iNdEx += skippy 3457 } 3458 } 3459 3460 if iNdEx > l { 3461 return io.ErrUnexpectedEOF 3462 } 3463 return nil 3464 } 3465 func (m *LeaveResponse) Unmarshal(dAtA []byte) error { 3466 l := len(dAtA) 3467 iNdEx := 0 3468 for iNdEx < l { 3469 preIndex := iNdEx 3470 var wire uint64 3471 for shift := uint(0); ; shift += 7 { 3472 if shift >= 64 { 3473 return ErrIntOverflowRaft 3474 } 3475 if iNdEx >= l { 3476 return io.ErrUnexpectedEOF 3477 } 3478 b := dAtA[iNdEx] 3479 iNdEx++ 3480 wire |= uint64(b&0x7F) << shift 3481 if b < 0x80 { 3482 break 3483 } 3484 } 3485 fieldNum := int32(wire >> 3) 3486 wireType := int(wire & 0x7) 3487 if wireType == 4 { 3488 return fmt.Errorf("proto: LeaveResponse: wiretype end group for non-group") 3489 } 3490 if fieldNum <= 0 { 3491 return fmt.Errorf("proto: LeaveResponse: illegal tag %d (wire type %d)", fieldNum, wire) 3492 } 3493 switch fieldNum { 3494 default: 3495 iNdEx = preIndex 3496 skippy, err := skipRaft(dAtA[iNdEx:]) 3497 if err != nil { 3498 return err 3499 } 3500 if skippy < 0 { 3501 return ErrInvalidLengthRaft 3502 } 3503 if (iNdEx + skippy) < 0 { 3504 return ErrInvalidLengthRaft 3505 } 3506 if (iNdEx + skippy) > l { 3507 return io.ErrUnexpectedEOF 3508 } 3509 iNdEx += skippy 3510 } 3511 } 3512 3513 if iNdEx > l { 3514 return io.ErrUnexpectedEOF 3515 } 3516 return nil 3517 } 3518 func (m *ProcessRaftMessageRequest) Unmarshal(dAtA []byte) error { 3519 l := len(dAtA) 3520 iNdEx := 0 3521 for iNdEx < l { 3522 preIndex := iNdEx 3523 var wire uint64 3524 for shift := uint(0); ; shift += 7 { 3525 if shift >= 64 { 3526 return ErrIntOverflowRaft 3527 } 3528 if iNdEx >= l { 3529 return io.ErrUnexpectedEOF 3530 } 3531 b := dAtA[iNdEx] 3532 iNdEx++ 3533 wire |= uint64(b&0x7F) << shift 3534 if b < 0x80 { 3535 break 3536 } 3537 } 3538 fieldNum := int32(wire >> 3) 3539 wireType := int(wire & 0x7) 3540 if wireType == 4 { 3541 return fmt.Errorf("proto: ProcessRaftMessageRequest: wiretype end group for non-group") 3542 } 3543 if fieldNum <= 0 { 3544 return fmt.Errorf("proto: ProcessRaftMessageRequest: illegal tag %d (wire type %d)", fieldNum, wire) 3545 } 3546 switch fieldNum { 3547 case 1: 3548 if wireType != 2 { 3549 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 3550 } 3551 var msglen int 3552 for shift := uint(0); ; shift += 7 { 3553 if shift >= 64 { 3554 return ErrIntOverflowRaft 3555 } 3556 if iNdEx >= l { 3557 return io.ErrUnexpectedEOF 3558 } 3559 b := dAtA[iNdEx] 3560 iNdEx++ 3561 msglen |= int(b&0x7F) << shift 3562 if b < 0x80 { 3563 break 3564 } 3565 } 3566 if msglen < 0 { 3567 return ErrInvalidLengthRaft 3568 } 3569 postIndex := iNdEx + msglen 3570 if postIndex < 0 { 3571 return ErrInvalidLengthRaft 3572 } 3573 if postIndex > l { 3574 return io.ErrUnexpectedEOF 3575 } 3576 if m.Message == nil { 3577 m.Message = &raftpb.Message{} 3578 } 3579 if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 3580 return err 3581 } 3582 iNdEx = postIndex 3583 default: 3584 iNdEx = preIndex 3585 skippy, err := skipRaft(dAtA[iNdEx:]) 3586 if err != nil { 3587 return err 3588 } 3589 if skippy < 0 { 3590 return ErrInvalidLengthRaft 3591 } 3592 if (iNdEx + skippy) < 0 { 3593 return ErrInvalidLengthRaft 3594 } 3595 if (iNdEx + skippy) > l { 3596 return io.ErrUnexpectedEOF 3597 } 3598 iNdEx += skippy 3599 } 3600 } 3601 3602 if iNdEx > l { 3603 return io.ErrUnexpectedEOF 3604 } 3605 return nil 3606 } 3607 func (m *ProcessRaftMessageResponse) Unmarshal(dAtA []byte) error { 3608 l := len(dAtA) 3609 iNdEx := 0 3610 for iNdEx < l { 3611 preIndex := iNdEx 3612 var wire uint64 3613 for shift := uint(0); ; shift += 7 { 3614 if shift >= 64 { 3615 return ErrIntOverflowRaft 3616 } 3617 if iNdEx >= l { 3618 return io.ErrUnexpectedEOF 3619 } 3620 b := dAtA[iNdEx] 3621 iNdEx++ 3622 wire |= uint64(b&0x7F) << shift 3623 if b < 0x80 { 3624 break 3625 } 3626 } 3627 fieldNum := int32(wire >> 3) 3628 wireType := int(wire & 0x7) 3629 if wireType == 4 { 3630 return fmt.Errorf("proto: ProcessRaftMessageResponse: wiretype end group for non-group") 3631 } 3632 if fieldNum <= 0 { 3633 return fmt.Errorf("proto: ProcessRaftMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) 3634 } 3635 switch fieldNum { 3636 default: 3637 iNdEx = preIndex 3638 skippy, err := skipRaft(dAtA[iNdEx:]) 3639 if err != nil { 3640 return err 3641 } 3642 if skippy < 0 { 3643 return ErrInvalidLengthRaft 3644 } 3645 if (iNdEx + skippy) < 0 { 3646 return ErrInvalidLengthRaft 3647 } 3648 if (iNdEx + skippy) > l { 3649 return io.ErrUnexpectedEOF 3650 } 3651 iNdEx += skippy 3652 } 3653 } 3654 3655 if iNdEx > l { 3656 return io.ErrUnexpectedEOF 3657 } 3658 return nil 3659 } 3660 func (m *StreamRaftMessageRequest) Unmarshal(dAtA []byte) error { 3661 l := len(dAtA) 3662 iNdEx := 0 3663 for iNdEx < l { 3664 preIndex := iNdEx 3665 var wire uint64 3666 for shift := uint(0); ; shift += 7 { 3667 if shift >= 64 { 3668 return ErrIntOverflowRaft 3669 } 3670 if iNdEx >= l { 3671 return io.ErrUnexpectedEOF 3672 } 3673 b := dAtA[iNdEx] 3674 iNdEx++ 3675 wire |= uint64(b&0x7F) << shift 3676 if b < 0x80 { 3677 break 3678 } 3679 } 3680 fieldNum := int32(wire >> 3) 3681 wireType := int(wire & 0x7) 3682 if wireType == 4 { 3683 return fmt.Errorf("proto: StreamRaftMessageRequest: wiretype end group for non-group") 3684 } 3685 if fieldNum <= 0 { 3686 return fmt.Errorf("proto: StreamRaftMessageRequest: illegal tag %d (wire type %d)", fieldNum, wire) 3687 } 3688 switch fieldNum { 3689 case 1: 3690 if wireType != 2 { 3691 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 3692 } 3693 var msglen int 3694 for shift := uint(0); ; shift += 7 { 3695 if shift >= 64 { 3696 return ErrIntOverflowRaft 3697 } 3698 if iNdEx >= l { 3699 return io.ErrUnexpectedEOF 3700 } 3701 b := dAtA[iNdEx] 3702 iNdEx++ 3703 msglen |= int(b&0x7F) << shift 3704 if b < 0x80 { 3705 break 3706 } 3707 } 3708 if msglen < 0 { 3709 return ErrInvalidLengthRaft 3710 } 3711 postIndex := iNdEx + msglen 3712 if postIndex < 0 { 3713 return ErrInvalidLengthRaft 3714 } 3715 if postIndex > l { 3716 return io.ErrUnexpectedEOF 3717 } 3718 if m.Message == nil { 3719 m.Message = &raftpb.Message{} 3720 } 3721 if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 3722 return err 3723 } 3724 iNdEx = postIndex 3725 default: 3726 iNdEx = preIndex 3727 skippy, err := skipRaft(dAtA[iNdEx:]) 3728 if err != nil { 3729 return err 3730 } 3731 if skippy < 0 { 3732 return ErrInvalidLengthRaft 3733 } 3734 if (iNdEx + skippy) < 0 { 3735 return ErrInvalidLengthRaft 3736 } 3737 if (iNdEx + skippy) > l { 3738 return io.ErrUnexpectedEOF 3739 } 3740 iNdEx += skippy 3741 } 3742 } 3743 3744 if iNdEx > l { 3745 return io.ErrUnexpectedEOF 3746 } 3747 return nil 3748 } 3749 func (m *StreamRaftMessageResponse) Unmarshal(dAtA []byte) error { 3750 l := len(dAtA) 3751 iNdEx := 0 3752 for iNdEx < l { 3753 preIndex := iNdEx 3754 var wire uint64 3755 for shift := uint(0); ; shift += 7 { 3756 if shift >= 64 { 3757 return ErrIntOverflowRaft 3758 } 3759 if iNdEx >= l { 3760 return io.ErrUnexpectedEOF 3761 } 3762 b := dAtA[iNdEx] 3763 iNdEx++ 3764 wire |= uint64(b&0x7F) << shift 3765 if b < 0x80 { 3766 break 3767 } 3768 } 3769 fieldNum := int32(wire >> 3) 3770 wireType := int(wire & 0x7) 3771 if wireType == 4 { 3772 return fmt.Errorf("proto: StreamRaftMessageResponse: wiretype end group for non-group") 3773 } 3774 if fieldNum <= 0 { 3775 return fmt.Errorf("proto: StreamRaftMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) 3776 } 3777 switch fieldNum { 3778 default: 3779 iNdEx = preIndex 3780 skippy, err := skipRaft(dAtA[iNdEx:]) 3781 if err != nil { 3782 return err 3783 } 3784 if skippy < 0 { 3785 return ErrInvalidLengthRaft 3786 } 3787 if (iNdEx + skippy) < 0 { 3788 return ErrInvalidLengthRaft 3789 } 3790 if (iNdEx + skippy) > l { 3791 return io.ErrUnexpectedEOF 3792 } 3793 iNdEx += skippy 3794 } 3795 } 3796 3797 if iNdEx > l { 3798 return io.ErrUnexpectedEOF 3799 } 3800 return nil 3801 } 3802 func (m *ResolveAddressRequest) Unmarshal(dAtA []byte) error { 3803 l := len(dAtA) 3804 iNdEx := 0 3805 for iNdEx < l { 3806 preIndex := iNdEx 3807 var wire uint64 3808 for shift := uint(0); ; shift += 7 { 3809 if shift >= 64 { 3810 return ErrIntOverflowRaft 3811 } 3812 if iNdEx >= l { 3813 return io.ErrUnexpectedEOF 3814 } 3815 b := dAtA[iNdEx] 3816 iNdEx++ 3817 wire |= uint64(b&0x7F) << shift 3818 if b < 0x80 { 3819 break 3820 } 3821 } 3822 fieldNum := int32(wire >> 3) 3823 wireType := int(wire & 0x7) 3824 if wireType == 4 { 3825 return fmt.Errorf("proto: ResolveAddressRequest: wiretype end group for non-group") 3826 } 3827 if fieldNum <= 0 { 3828 return fmt.Errorf("proto: ResolveAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) 3829 } 3830 switch fieldNum { 3831 case 1: 3832 if wireType != 0 { 3833 return fmt.Errorf("proto: wrong wireType = %d for field RaftID", wireType) 3834 } 3835 m.RaftID = 0 3836 for shift := uint(0); ; shift += 7 { 3837 if shift >= 64 { 3838 return ErrIntOverflowRaft 3839 } 3840 if iNdEx >= l { 3841 return io.ErrUnexpectedEOF 3842 } 3843 b := dAtA[iNdEx] 3844 iNdEx++ 3845 m.RaftID |= uint64(b&0x7F) << shift 3846 if b < 0x80 { 3847 break 3848 } 3849 } 3850 default: 3851 iNdEx = preIndex 3852 skippy, err := skipRaft(dAtA[iNdEx:]) 3853 if err != nil { 3854 return err 3855 } 3856 if skippy < 0 { 3857 return ErrInvalidLengthRaft 3858 } 3859 if (iNdEx + skippy) < 0 { 3860 return ErrInvalidLengthRaft 3861 } 3862 if (iNdEx + skippy) > l { 3863 return io.ErrUnexpectedEOF 3864 } 3865 iNdEx += skippy 3866 } 3867 } 3868 3869 if iNdEx > l { 3870 return io.ErrUnexpectedEOF 3871 } 3872 return nil 3873 } 3874 func (m *ResolveAddressResponse) Unmarshal(dAtA []byte) error { 3875 l := len(dAtA) 3876 iNdEx := 0 3877 for iNdEx < l { 3878 preIndex := iNdEx 3879 var wire uint64 3880 for shift := uint(0); ; shift += 7 { 3881 if shift >= 64 { 3882 return ErrIntOverflowRaft 3883 } 3884 if iNdEx >= l { 3885 return io.ErrUnexpectedEOF 3886 } 3887 b := dAtA[iNdEx] 3888 iNdEx++ 3889 wire |= uint64(b&0x7F) << shift 3890 if b < 0x80 { 3891 break 3892 } 3893 } 3894 fieldNum := int32(wire >> 3) 3895 wireType := int(wire & 0x7) 3896 if wireType == 4 { 3897 return fmt.Errorf("proto: ResolveAddressResponse: wiretype end group for non-group") 3898 } 3899 if fieldNum <= 0 { 3900 return fmt.Errorf("proto: ResolveAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) 3901 } 3902 switch fieldNum { 3903 case 1: 3904 if wireType != 2 { 3905 return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) 3906 } 3907 var stringLen uint64 3908 for shift := uint(0); ; shift += 7 { 3909 if shift >= 64 { 3910 return ErrIntOverflowRaft 3911 } 3912 if iNdEx >= l { 3913 return io.ErrUnexpectedEOF 3914 } 3915 b := dAtA[iNdEx] 3916 iNdEx++ 3917 stringLen |= uint64(b&0x7F) << shift 3918 if b < 0x80 { 3919 break 3920 } 3921 } 3922 intStringLen := int(stringLen) 3923 if intStringLen < 0 { 3924 return ErrInvalidLengthRaft 3925 } 3926 postIndex := iNdEx + intStringLen 3927 if postIndex < 0 { 3928 return ErrInvalidLengthRaft 3929 } 3930 if postIndex > l { 3931 return io.ErrUnexpectedEOF 3932 } 3933 m.Addr = string(dAtA[iNdEx:postIndex]) 3934 iNdEx = postIndex 3935 default: 3936 iNdEx = preIndex 3937 skippy, err := skipRaft(dAtA[iNdEx:]) 3938 if err != nil { 3939 return err 3940 } 3941 if skippy < 0 { 3942 return ErrInvalidLengthRaft 3943 } 3944 if (iNdEx + skippy) < 0 { 3945 return ErrInvalidLengthRaft 3946 } 3947 if (iNdEx + skippy) > l { 3948 return io.ErrUnexpectedEOF 3949 } 3950 iNdEx += skippy 3951 } 3952 } 3953 3954 if iNdEx > l { 3955 return io.ErrUnexpectedEOF 3956 } 3957 return nil 3958 } 3959 func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { 3960 l := len(dAtA) 3961 iNdEx := 0 3962 for iNdEx < l { 3963 preIndex := iNdEx 3964 var wire uint64 3965 for shift := uint(0); ; shift += 7 { 3966 if shift >= 64 { 3967 return ErrIntOverflowRaft 3968 } 3969 if iNdEx >= l { 3970 return io.ErrUnexpectedEOF 3971 } 3972 b := dAtA[iNdEx] 3973 iNdEx++ 3974 wire |= uint64(b&0x7F) << shift 3975 if b < 0x80 { 3976 break 3977 } 3978 } 3979 fieldNum := int32(wire >> 3) 3980 wireType := int(wire & 0x7) 3981 if wireType == 4 { 3982 return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group") 3983 } 3984 if fieldNum <= 0 { 3985 return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire) 3986 } 3987 switch fieldNum { 3988 case 1: 3989 if wireType != 0 { 3990 return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) 3991 } 3992 m.ID = 0 3993 for shift := uint(0); ; shift += 7 { 3994 if shift >= 64 { 3995 return ErrIntOverflowRaft 3996 } 3997 if iNdEx >= l { 3998 return io.ErrUnexpectedEOF 3999 } 4000 b := dAtA[iNdEx] 4001 iNdEx++ 4002 m.ID |= uint64(b&0x7F) << shift 4003 if b < 0x80 { 4004 break 4005 } 4006 } 4007 case 2: 4008 if wireType != 2 { 4009 return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) 4010 } 4011 var msglen int 4012 for shift := uint(0); ; shift += 7 { 4013 if shift >= 64 { 4014 return ErrIntOverflowRaft 4015 } 4016 if iNdEx >= l { 4017 return io.ErrUnexpectedEOF 4018 } 4019 b := dAtA[iNdEx] 4020 iNdEx++ 4021 msglen |= int(b&0x7F) << shift 4022 if b < 0x80 { 4023 break 4024 } 4025 } 4026 if msglen < 0 { 4027 return ErrInvalidLengthRaft 4028 } 4029 postIndex := iNdEx + msglen 4030 if postIndex < 0 { 4031 return ErrInvalidLengthRaft 4032 } 4033 if postIndex > l { 4034 return io.ErrUnexpectedEOF 4035 } 4036 m.Action = append(m.Action, StoreAction{}) 4037 if err := m.Action[len(m.Action)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4038 return err 4039 } 4040 iNdEx = postIndex 4041 default: 4042 iNdEx = preIndex 4043 skippy, err := skipRaft(dAtA[iNdEx:]) 4044 if err != nil { 4045 return err 4046 } 4047 if skippy < 0 { 4048 return ErrInvalidLengthRaft 4049 } 4050 if (iNdEx + skippy) < 0 { 4051 return ErrInvalidLengthRaft 4052 } 4053 if (iNdEx + skippy) > l { 4054 return io.ErrUnexpectedEOF 4055 } 4056 iNdEx += skippy 4057 } 4058 } 4059 4060 if iNdEx > l { 4061 return io.ErrUnexpectedEOF 4062 } 4063 return nil 4064 } 4065 func (m *StoreAction) Unmarshal(dAtA []byte) error { 4066 l := len(dAtA) 4067 iNdEx := 0 4068 for iNdEx < l { 4069 preIndex := iNdEx 4070 var wire uint64 4071 for shift := uint(0); ; shift += 7 { 4072 if shift >= 64 { 4073 return ErrIntOverflowRaft 4074 } 4075 if iNdEx >= l { 4076 return io.ErrUnexpectedEOF 4077 } 4078 b := dAtA[iNdEx] 4079 iNdEx++ 4080 wire |= uint64(b&0x7F) << shift 4081 if b < 0x80 { 4082 break 4083 } 4084 } 4085 fieldNum := int32(wire >> 3) 4086 wireType := int(wire & 0x7) 4087 if wireType == 4 { 4088 return fmt.Errorf("proto: StoreAction: wiretype end group for non-group") 4089 } 4090 if fieldNum <= 0 { 4091 return fmt.Errorf("proto: StoreAction: illegal tag %d (wire type %d)", fieldNum, wire) 4092 } 4093 switch fieldNum { 4094 case 1: 4095 if wireType != 0 { 4096 return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) 4097 } 4098 m.Action = 0 4099 for shift := uint(0); ; shift += 7 { 4100 if shift >= 64 { 4101 return ErrIntOverflowRaft 4102 } 4103 if iNdEx >= l { 4104 return io.ErrUnexpectedEOF 4105 } 4106 b := dAtA[iNdEx] 4107 iNdEx++ 4108 m.Action |= StoreActionKind(b&0x7F) << shift 4109 if b < 0x80 { 4110 break 4111 } 4112 } 4113 case 2: 4114 if wireType != 2 { 4115 return fmt.Errorf("proto: wrong wireType = %d for field Node", wireType) 4116 } 4117 var msglen int 4118 for shift := uint(0); ; shift += 7 { 4119 if shift >= 64 { 4120 return ErrIntOverflowRaft 4121 } 4122 if iNdEx >= l { 4123 return io.ErrUnexpectedEOF 4124 } 4125 b := dAtA[iNdEx] 4126 iNdEx++ 4127 msglen |= int(b&0x7F) << shift 4128 if b < 0x80 { 4129 break 4130 } 4131 } 4132 if msglen < 0 { 4133 return ErrInvalidLengthRaft 4134 } 4135 postIndex := iNdEx + msglen 4136 if postIndex < 0 { 4137 return ErrInvalidLengthRaft 4138 } 4139 if postIndex > l { 4140 return io.ErrUnexpectedEOF 4141 } 4142 v := &Node{} 4143 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4144 return err 4145 } 4146 m.Target = &StoreAction_Node{v} 4147 iNdEx = postIndex 4148 case 3: 4149 if wireType != 2 { 4150 return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) 4151 } 4152 var msglen int 4153 for shift := uint(0); ; shift += 7 { 4154 if shift >= 64 { 4155 return ErrIntOverflowRaft 4156 } 4157 if iNdEx >= l { 4158 return io.ErrUnexpectedEOF 4159 } 4160 b := dAtA[iNdEx] 4161 iNdEx++ 4162 msglen |= int(b&0x7F) << shift 4163 if b < 0x80 { 4164 break 4165 } 4166 } 4167 if msglen < 0 { 4168 return ErrInvalidLengthRaft 4169 } 4170 postIndex := iNdEx + msglen 4171 if postIndex < 0 { 4172 return ErrInvalidLengthRaft 4173 } 4174 if postIndex > l { 4175 return io.ErrUnexpectedEOF 4176 } 4177 v := &Service{} 4178 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4179 return err 4180 } 4181 m.Target = &StoreAction_Service{v} 4182 iNdEx = postIndex 4183 case 4: 4184 if wireType != 2 { 4185 return fmt.Errorf("proto: wrong wireType = %d for field Task", wireType) 4186 } 4187 var msglen int 4188 for shift := uint(0); ; shift += 7 { 4189 if shift >= 64 { 4190 return ErrIntOverflowRaft 4191 } 4192 if iNdEx >= l { 4193 return io.ErrUnexpectedEOF 4194 } 4195 b := dAtA[iNdEx] 4196 iNdEx++ 4197 msglen |= int(b&0x7F) << shift 4198 if b < 0x80 { 4199 break 4200 } 4201 } 4202 if msglen < 0 { 4203 return ErrInvalidLengthRaft 4204 } 4205 postIndex := iNdEx + msglen 4206 if postIndex < 0 { 4207 return ErrInvalidLengthRaft 4208 } 4209 if postIndex > l { 4210 return io.ErrUnexpectedEOF 4211 } 4212 v := &Task{} 4213 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4214 return err 4215 } 4216 m.Target = &StoreAction_Task{v} 4217 iNdEx = postIndex 4218 case 5: 4219 if wireType != 2 { 4220 return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) 4221 } 4222 var msglen int 4223 for shift := uint(0); ; shift += 7 { 4224 if shift >= 64 { 4225 return ErrIntOverflowRaft 4226 } 4227 if iNdEx >= l { 4228 return io.ErrUnexpectedEOF 4229 } 4230 b := dAtA[iNdEx] 4231 iNdEx++ 4232 msglen |= int(b&0x7F) << shift 4233 if b < 0x80 { 4234 break 4235 } 4236 } 4237 if msglen < 0 { 4238 return ErrInvalidLengthRaft 4239 } 4240 postIndex := iNdEx + msglen 4241 if postIndex < 0 { 4242 return ErrInvalidLengthRaft 4243 } 4244 if postIndex > l { 4245 return io.ErrUnexpectedEOF 4246 } 4247 v := &Network{} 4248 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4249 return err 4250 } 4251 m.Target = &StoreAction_Network{v} 4252 iNdEx = postIndex 4253 case 6: 4254 if wireType != 2 { 4255 return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) 4256 } 4257 var msglen int 4258 for shift := uint(0); ; shift += 7 { 4259 if shift >= 64 { 4260 return ErrIntOverflowRaft 4261 } 4262 if iNdEx >= l { 4263 return io.ErrUnexpectedEOF 4264 } 4265 b := dAtA[iNdEx] 4266 iNdEx++ 4267 msglen |= int(b&0x7F) << shift 4268 if b < 0x80 { 4269 break 4270 } 4271 } 4272 if msglen < 0 { 4273 return ErrInvalidLengthRaft 4274 } 4275 postIndex := iNdEx + msglen 4276 if postIndex < 0 { 4277 return ErrInvalidLengthRaft 4278 } 4279 if postIndex > l { 4280 return io.ErrUnexpectedEOF 4281 } 4282 v := &Cluster{} 4283 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4284 return err 4285 } 4286 m.Target = &StoreAction_Cluster{v} 4287 iNdEx = postIndex 4288 case 7: 4289 if wireType != 2 { 4290 return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) 4291 } 4292 var msglen int 4293 for shift := uint(0); ; shift += 7 { 4294 if shift >= 64 { 4295 return ErrIntOverflowRaft 4296 } 4297 if iNdEx >= l { 4298 return io.ErrUnexpectedEOF 4299 } 4300 b := dAtA[iNdEx] 4301 iNdEx++ 4302 msglen |= int(b&0x7F) << shift 4303 if b < 0x80 { 4304 break 4305 } 4306 } 4307 if msglen < 0 { 4308 return ErrInvalidLengthRaft 4309 } 4310 postIndex := iNdEx + msglen 4311 if postIndex < 0 { 4312 return ErrInvalidLengthRaft 4313 } 4314 if postIndex > l { 4315 return io.ErrUnexpectedEOF 4316 } 4317 v := &Secret{} 4318 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4319 return err 4320 } 4321 m.Target = &StoreAction_Secret{v} 4322 iNdEx = postIndex 4323 case 8: 4324 if wireType != 2 { 4325 return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) 4326 } 4327 var msglen int 4328 for shift := uint(0); ; shift += 7 { 4329 if shift >= 64 { 4330 return ErrIntOverflowRaft 4331 } 4332 if iNdEx >= l { 4333 return io.ErrUnexpectedEOF 4334 } 4335 b := dAtA[iNdEx] 4336 iNdEx++ 4337 msglen |= int(b&0x7F) << shift 4338 if b < 0x80 { 4339 break 4340 } 4341 } 4342 if msglen < 0 { 4343 return ErrInvalidLengthRaft 4344 } 4345 postIndex := iNdEx + msglen 4346 if postIndex < 0 { 4347 return ErrInvalidLengthRaft 4348 } 4349 if postIndex > l { 4350 return io.ErrUnexpectedEOF 4351 } 4352 v := &Resource{} 4353 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4354 return err 4355 } 4356 m.Target = &StoreAction_Resource{v} 4357 iNdEx = postIndex 4358 case 9: 4359 if wireType != 2 { 4360 return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) 4361 } 4362 var msglen int 4363 for shift := uint(0); ; shift += 7 { 4364 if shift >= 64 { 4365 return ErrIntOverflowRaft 4366 } 4367 if iNdEx >= l { 4368 return io.ErrUnexpectedEOF 4369 } 4370 b := dAtA[iNdEx] 4371 iNdEx++ 4372 msglen |= int(b&0x7F) << shift 4373 if b < 0x80 { 4374 break 4375 } 4376 } 4377 if msglen < 0 { 4378 return ErrInvalidLengthRaft 4379 } 4380 postIndex := iNdEx + msglen 4381 if postIndex < 0 { 4382 return ErrInvalidLengthRaft 4383 } 4384 if postIndex > l { 4385 return io.ErrUnexpectedEOF 4386 } 4387 v := &Extension{} 4388 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4389 return err 4390 } 4391 m.Target = &StoreAction_Extension{v} 4392 iNdEx = postIndex 4393 case 10: 4394 if wireType != 2 { 4395 return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) 4396 } 4397 var msglen int 4398 for shift := uint(0); ; shift += 7 { 4399 if shift >= 64 { 4400 return ErrIntOverflowRaft 4401 } 4402 if iNdEx >= l { 4403 return io.ErrUnexpectedEOF 4404 } 4405 b := dAtA[iNdEx] 4406 iNdEx++ 4407 msglen |= int(b&0x7F) << shift 4408 if b < 0x80 { 4409 break 4410 } 4411 } 4412 if msglen < 0 { 4413 return ErrInvalidLengthRaft 4414 } 4415 postIndex := iNdEx + msglen 4416 if postIndex < 0 { 4417 return ErrInvalidLengthRaft 4418 } 4419 if postIndex > l { 4420 return io.ErrUnexpectedEOF 4421 } 4422 v := &Config{} 4423 if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 4424 return err 4425 } 4426 m.Target = &StoreAction_Config{v} 4427 iNdEx = postIndex 4428 default: 4429 iNdEx = preIndex 4430 skippy, err := skipRaft(dAtA[iNdEx:]) 4431 if err != nil { 4432 return err 4433 } 4434 if skippy < 0 { 4435 return ErrInvalidLengthRaft 4436 } 4437 if (iNdEx + skippy) < 0 { 4438 return ErrInvalidLengthRaft 4439 } 4440 if (iNdEx + skippy) > l { 4441 return io.ErrUnexpectedEOF 4442 } 4443 iNdEx += skippy 4444 } 4445 } 4446 4447 if iNdEx > l { 4448 return io.ErrUnexpectedEOF 4449 } 4450 return nil 4451 } 4452 func skipRaft(dAtA []byte) (n int, err error) { 4453 l := len(dAtA) 4454 iNdEx := 0 4455 for iNdEx < l { 4456 var wire uint64 4457 for shift := uint(0); ; shift += 7 { 4458 if shift >= 64 { 4459 return 0, ErrIntOverflowRaft 4460 } 4461 if iNdEx >= l { 4462 return 0, io.ErrUnexpectedEOF 4463 } 4464 b := dAtA[iNdEx] 4465 iNdEx++ 4466 wire |= (uint64(b) & 0x7F) << shift 4467 if b < 0x80 { 4468 break 4469 } 4470 } 4471 wireType := int(wire & 0x7) 4472 switch wireType { 4473 case 0: 4474 for shift := uint(0); ; shift += 7 { 4475 if shift >= 64 { 4476 return 0, ErrIntOverflowRaft 4477 } 4478 if iNdEx >= l { 4479 return 0, io.ErrUnexpectedEOF 4480 } 4481 iNdEx++ 4482 if dAtA[iNdEx-1] < 0x80 { 4483 break 4484 } 4485 } 4486 return iNdEx, nil 4487 case 1: 4488 iNdEx += 8 4489 return iNdEx, nil 4490 case 2: 4491 var length int 4492 for shift := uint(0); ; shift += 7 { 4493 if shift >= 64 { 4494 return 0, ErrIntOverflowRaft 4495 } 4496 if iNdEx >= l { 4497 return 0, io.ErrUnexpectedEOF 4498 } 4499 b := dAtA[iNdEx] 4500 iNdEx++ 4501 length |= (int(b) & 0x7F) << shift 4502 if b < 0x80 { 4503 break 4504 } 4505 } 4506 if length < 0 { 4507 return 0, ErrInvalidLengthRaft 4508 } 4509 iNdEx += length 4510 if iNdEx < 0 { 4511 return 0, ErrInvalidLengthRaft 4512 } 4513 return iNdEx, nil 4514 case 3: 4515 for { 4516 var innerWire uint64 4517 var start int = iNdEx 4518 for shift := uint(0); ; shift += 7 { 4519 if shift >= 64 { 4520 return 0, ErrIntOverflowRaft 4521 } 4522 if iNdEx >= l { 4523 return 0, io.ErrUnexpectedEOF 4524 } 4525 b := dAtA[iNdEx] 4526 iNdEx++ 4527 innerWire |= (uint64(b) & 0x7F) << shift 4528 if b < 0x80 { 4529 break 4530 } 4531 } 4532 innerWireType := int(innerWire & 0x7) 4533 if innerWireType == 4 { 4534 break 4535 } 4536 next, err := skipRaft(dAtA[start:]) 4537 if err != nil { 4538 return 0, err 4539 } 4540 iNdEx = start + next 4541 if iNdEx < 0 { 4542 return 0, ErrInvalidLengthRaft 4543 } 4544 } 4545 return iNdEx, nil 4546 case 4: 4547 return iNdEx, nil 4548 case 5: 4549 iNdEx += 4 4550 return iNdEx, nil 4551 default: 4552 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 4553 } 4554 } 4555 panic("unreachable") 4556 } 4557 4558 var ( 4559 ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") 4560 ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") 4561 )