khenaidoo | ab1f7bd | 2019-11-14 14:00:27 -0500 | [diff] [blame] | 1 | // Code generated by protoc-gen-gogo. DO NOT EDIT. |
| 2 | // source: v3election.proto |
| 3 | |
| 4 | /* |
| 5 | Package v3electionpb is a generated protocol buffer package. |
| 6 | |
| 7 | It is generated from these files: |
| 8 | v3election.proto |
| 9 | |
| 10 | It has these top-level messages: |
| 11 | CampaignRequest |
| 12 | CampaignResponse |
| 13 | LeaderKey |
| 14 | LeaderRequest |
| 15 | LeaderResponse |
| 16 | ResignRequest |
| 17 | ResignResponse |
| 18 | ProclaimRequest |
| 19 | ProclaimResponse |
| 20 | */ |
| 21 | package v3electionpb |
| 22 | |
| 23 | import ( |
| 24 | "fmt" |
| 25 | |
| 26 | proto "github.com/golang/protobuf/proto" |
| 27 | |
| 28 | math "math" |
| 29 | |
| 30 | _ "github.com/gogo/protobuf/gogoproto" |
| 31 | |
| 32 | etcdserverpb "go.etcd.io/etcd/etcdserver/etcdserverpb" |
| 33 | |
| 34 | mvccpb "go.etcd.io/etcd/mvcc/mvccpb" |
| 35 | |
| 36 | context "golang.org/x/net/context" |
| 37 | |
| 38 | grpc "google.golang.org/grpc" |
| 39 | |
| 40 | io "io" |
| 41 | ) |
| 42 | |
| 43 | // Reference imports to suppress errors if they are not otherwise used. |
| 44 | var _ = proto.Marshal |
| 45 | var _ = fmt.Errorf |
| 46 | var _ = math.Inf |
| 47 | |
| 48 | // This is a compile-time assertion to ensure that this generated file |
| 49 | // is compatible with the proto package it is being compiled against. |
| 50 | // A compilation error at this line likely means your copy of the |
| 51 | // proto package needs to be updated. |
| 52 | const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package |
| 53 | |
| 54 | type CampaignRequest struct { |
| 55 | // name is the election's identifier for the campaign. |
| 56 | Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 57 | // lease is the ID of the lease attached to leadership of the election. If the |
| 58 | // lease expires or is revoked before resigning leadership, then the |
| 59 | // leadership is transferred to the next campaigner, if any. |
| 60 | Lease int64 `protobuf:"varint,2,opt,name=lease,proto3" json:"lease,omitempty"` |
| 61 | // value is the initial proclaimed value set when the campaigner wins the |
| 62 | // election. |
| 63 | Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` |
| 64 | } |
| 65 | |
| 66 | func (m *CampaignRequest) Reset() { *m = CampaignRequest{} } |
| 67 | func (m *CampaignRequest) String() string { return proto.CompactTextString(m) } |
| 68 | func (*CampaignRequest) ProtoMessage() {} |
| 69 | func (*CampaignRequest) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{0} } |
| 70 | |
| 71 | func (m *CampaignRequest) GetName() []byte { |
| 72 | if m != nil { |
| 73 | return m.Name |
| 74 | } |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | func (m *CampaignRequest) GetLease() int64 { |
| 79 | if m != nil { |
| 80 | return m.Lease |
| 81 | } |
| 82 | return 0 |
| 83 | } |
| 84 | |
| 85 | func (m *CampaignRequest) GetValue() []byte { |
| 86 | if m != nil { |
| 87 | return m.Value |
| 88 | } |
| 89 | return nil |
| 90 | } |
| 91 | |
| 92 | type CampaignResponse struct { |
| 93 | Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` |
| 94 | // leader describes the resources used for holding leadereship of the election. |
| 95 | Leader *LeaderKey `protobuf:"bytes,2,opt,name=leader" json:"leader,omitempty"` |
| 96 | } |
| 97 | |
| 98 | func (m *CampaignResponse) Reset() { *m = CampaignResponse{} } |
| 99 | func (m *CampaignResponse) String() string { return proto.CompactTextString(m) } |
| 100 | func (*CampaignResponse) ProtoMessage() {} |
| 101 | func (*CampaignResponse) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{1} } |
| 102 | |
| 103 | func (m *CampaignResponse) GetHeader() *etcdserverpb.ResponseHeader { |
| 104 | if m != nil { |
| 105 | return m.Header |
| 106 | } |
| 107 | return nil |
| 108 | } |
| 109 | |
| 110 | func (m *CampaignResponse) GetLeader() *LeaderKey { |
| 111 | if m != nil { |
| 112 | return m.Leader |
| 113 | } |
| 114 | return nil |
| 115 | } |
| 116 | |
| 117 | type LeaderKey struct { |
| 118 | // name is the election identifier that correponds to the leadership key. |
| 119 | Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 120 | // key is an opaque key representing the ownership of the election. If the key |
| 121 | // is deleted, then leadership is lost. |
| 122 | Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` |
| 123 | // rev is the creation revision of the key. It can be used to test for ownership |
| 124 | // of an election during transactions by testing the key's creation revision |
| 125 | // matches rev. |
| 126 | Rev int64 `protobuf:"varint,3,opt,name=rev,proto3" json:"rev,omitempty"` |
| 127 | // lease is the lease ID of the election leader. |
| 128 | Lease int64 `protobuf:"varint,4,opt,name=lease,proto3" json:"lease,omitempty"` |
| 129 | } |
| 130 | |
| 131 | func (m *LeaderKey) Reset() { *m = LeaderKey{} } |
| 132 | func (m *LeaderKey) String() string { return proto.CompactTextString(m) } |
| 133 | func (*LeaderKey) ProtoMessage() {} |
| 134 | func (*LeaderKey) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{2} } |
| 135 | |
| 136 | func (m *LeaderKey) GetName() []byte { |
| 137 | if m != nil { |
| 138 | return m.Name |
| 139 | } |
| 140 | return nil |
| 141 | } |
| 142 | |
| 143 | func (m *LeaderKey) GetKey() []byte { |
| 144 | if m != nil { |
| 145 | return m.Key |
| 146 | } |
| 147 | return nil |
| 148 | } |
| 149 | |
| 150 | func (m *LeaderKey) GetRev() int64 { |
| 151 | if m != nil { |
| 152 | return m.Rev |
| 153 | } |
| 154 | return 0 |
| 155 | } |
| 156 | |
| 157 | func (m *LeaderKey) GetLease() int64 { |
| 158 | if m != nil { |
| 159 | return m.Lease |
| 160 | } |
| 161 | return 0 |
| 162 | } |
| 163 | |
| 164 | type LeaderRequest struct { |
| 165 | // name is the election identifier for the leadership information. |
| 166 | Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` |
| 167 | } |
| 168 | |
| 169 | func (m *LeaderRequest) Reset() { *m = LeaderRequest{} } |
| 170 | func (m *LeaderRequest) String() string { return proto.CompactTextString(m) } |
| 171 | func (*LeaderRequest) ProtoMessage() {} |
| 172 | func (*LeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{3} } |
| 173 | |
| 174 | func (m *LeaderRequest) GetName() []byte { |
| 175 | if m != nil { |
| 176 | return m.Name |
| 177 | } |
| 178 | return nil |
| 179 | } |
| 180 | |
| 181 | type LeaderResponse struct { |
| 182 | Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` |
| 183 | // kv is the key-value pair representing the latest leader update. |
| 184 | Kv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=kv" json:"kv,omitempty"` |
| 185 | } |
| 186 | |
| 187 | func (m *LeaderResponse) Reset() { *m = LeaderResponse{} } |
| 188 | func (m *LeaderResponse) String() string { return proto.CompactTextString(m) } |
| 189 | func (*LeaderResponse) ProtoMessage() {} |
| 190 | func (*LeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{4} } |
| 191 | |
| 192 | func (m *LeaderResponse) GetHeader() *etcdserverpb.ResponseHeader { |
| 193 | if m != nil { |
| 194 | return m.Header |
| 195 | } |
| 196 | return nil |
| 197 | } |
| 198 | |
| 199 | func (m *LeaderResponse) GetKv() *mvccpb.KeyValue { |
| 200 | if m != nil { |
| 201 | return m.Kv |
| 202 | } |
| 203 | return nil |
| 204 | } |
| 205 | |
| 206 | type ResignRequest struct { |
| 207 | // leader is the leadership to relinquish by resignation. |
| 208 | Leader *LeaderKey `protobuf:"bytes,1,opt,name=leader" json:"leader,omitempty"` |
| 209 | } |
| 210 | |
| 211 | func (m *ResignRequest) Reset() { *m = ResignRequest{} } |
| 212 | func (m *ResignRequest) String() string { return proto.CompactTextString(m) } |
| 213 | func (*ResignRequest) ProtoMessage() {} |
| 214 | func (*ResignRequest) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{5} } |
| 215 | |
| 216 | func (m *ResignRequest) GetLeader() *LeaderKey { |
| 217 | if m != nil { |
| 218 | return m.Leader |
| 219 | } |
| 220 | return nil |
| 221 | } |
| 222 | |
| 223 | type ResignResponse struct { |
| 224 | Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` |
| 225 | } |
| 226 | |
| 227 | func (m *ResignResponse) Reset() { *m = ResignResponse{} } |
| 228 | func (m *ResignResponse) String() string { return proto.CompactTextString(m) } |
| 229 | func (*ResignResponse) ProtoMessage() {} |
| 230 | func (*ResignResponse) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{6} } |
| 231 | |
| 232 | func (m *ResignResponse) GetHeader() *etcdserverpb.ResponseHeader { |
| 233 | if m != nil { |
| 234 | return m.Header |
| 235 | } |
| 236 | return nil |
| 237 | } |
| 238 | |
| 239 | type ProclaimRequest struct { |
| 240 | // leader is the leadership hold on the election. |
| 241 | Leader *LeaderKey `protobuf:"bytes,1,opt,name=leader" json:"leader,omitempty"` |
| 242 | // value is an update meant to overwrite the leader's current value. |
| 243 | Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` |
| 244 | } |
| 245 | |
| 246 | func (m *ProclaimRequest) Reset() { *m = ProclaimRequest{} } |
| 247 | func (m *ProclaimRequest) String() string { return proto.CompactTextString(m) } |
| 248 | func (*ProclaimRequest) ProtoMessage() {} |
| 249 | func (*ProclaimRequest) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{7} } |
| 250 | |
| 251 | func (m *ProclaimRequest) GetLeader() *LeaderKey { |
| 252 | if m != nil { |
| 253 | return m.Leader |
| 254 | } |
| 255 | return nil |
| 256 | } |
| 257 | |
| 258 | func (m *ProclaimRequest) GetValue() []byte { |
| 259 | if m != nil { |
| 260 | return m.Value |
| 261 | } |
| 262 | return nil |
| 263 | } |
| 264 | |
| 265 | type ProclaimResponse struct { |
| 266 | Header *etcdserverpb.ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` |
| 267 | } |
| 268 | |
| 269 | func (m *ProclaimResponse) Reset() { *m = ProclaimResponse{} } |
| 270 | func (m *ProclaimResponse) String() string { return proto.CompactTextString(m) } |
| 271 | func (*ProclaimResponse) ProtoMessage() {} |
| 272 | func (*ProclaimResponse) Descriptor() ([]byte, []int) { return fileDescriptorV3Election, []int{8} } |
| 273 | |
| 274 | func (m *ProclaimResponse) GetHeader() *etcdserverpb.ResponseHeader { |
| 275 | if m != nil { |
| 276 | return m.Header |
| 277 | } |
| 278 | return nil |
| 279 | } |
| 280 | |
| 281 | func init() { |
| 282 | proto.RegisterType((*CampaignRequest)(nil), "v3electionpb.CampaignRequest") |
| 283 | proto.RegisterType((*CampaignResponse)(nil), "v3electionpb.CampaignResponse") |
| 284 | proto.RegisterType((*LeaderKey)(nil), "v3electionpb.LeaderKey") |
| 285 | proto.RegisterType((*LeaderRequest)(nil), "v3electionpb.LeaderRequest") |
| 286 | proto.RegisterType((*LeaderResponse)(nil), "v3electionpb.LeaderResponse") |
| 287 | proto.RegisterType((*ResignRequest)(nil), "v3electionpb.ResignRequest") |
| 288 | proto.RegisterType((*ResignResponse)(nil), "v3electionpb.ResignResponse") |
| 289 | proto.RegisterType((*ProclaimRequest)(nil), "v3electionpb.ProclaimRequest") |
| 290 | proto.RegisterType((*ProclaimResponse)(nil), "v3electionpb.ProclaimResponse") |
| 291 | } |
| 292 | |
| 293 | // Reference imports to suppress errors if they are not otherwise used. |
| 294 | var _ context.Context |
| 295 | var _ grpc.ClientConn |
| 296 | |
| 297 | // This is a compile-time assertion to ensure that this generated file |
| 298 | // is compatible with the grpc package it is being compiled against. |
| 299 | const _ = grpc.SupportPackageIsVersion4 |
| 300 | |
| 301 | // Client API for Election service |
| 302 | |
| 303 | type ElectionClient interface { |
| 304 | // Campaign waits to acquire leadership in an election, returning a LeaderKey |
| 305 | // representing the leadership if successful. The LeaderKey can then be used |
| 306 | // to issue new values on the election, transactionally guard API requests on |
| 307 | // leadership still being held, and resign from the election. |
| 308 | Campaign(ctx context.Context, in *CampaignRequest, opts ...grpc.CallOption) (*CampaignResponse, error) |
| 309 | // Proclaim updates the leader's posted value with a new value. |
| 310 | Proclaim(ctx context.Context, in *ProclaimRequest, opts ...grpc.CallOption) (*ProclaimResponse, error) |
| 311 | // Leader returns the current election proclamation, if any. |
| 312 | Leader(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (*LeaderResponse, error) |
| 313 | // Observe streams election proclamations in-order as made by the election's |
| 314 | // elected leaders. |
| 315 | Observe(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (Election_ObserveClient, error) |
| 316 | // Resign releases election leadership so other campaigners may acquire |
| 317 | // leadership on the election. |
| 318 | Resign(ctx context.Context, in *ResignRequest, opts ...grpc.CallOption) (*ResignResponse, error) |
| 319 | } |
| 320 | |
| 321 | type electionClient struct { |
| 322 | cc *grpc.ClientConn |
| 323 | } |
| 324 | |
| 325 | func NewElectionClient(cc *grpc.ClientConn) ElectionClient { |
| 326 | return &electionClient{cc} |
| 327 | } |
| 328 | |
| 329 | func (c *electionClient) Campaign(ctx context.Context, in *CampaignRequest, opts ...grpc.CallOption) (*CampaignResponse, error) { |
| 330 | out := new(CampaignResponse) |
| 331 | err := grpc.Invoke(ctx, "/v3electionpb.Election/Campaign", in, out, c.cc, opts...) |
| 332 | if err != nil { |
| 333 | return nil, err |
| 334 | } |
| 335 | return out, nil |
| 336 | } |
| 337 | |
| 338 | func (c *electionClient) Proclaim(ctx context.Context, in *ProclaimRequest, opts ...grpc.CallOption) (*ProclaimResponse, error) { |
| 339 | out := new(ProclaimResponse) |
| 340 | err := grpc.Invoke(ctx, "/v3electionpb.Election/Proclaim", in, out, c.cc, opts...) |
| 341 | if err != nil { |
| 342 | return nil, err |
| 343 | } |
| 344 | return out, nil |
| 345 | } |
| 346 | |
| 347 | func (c *electionClient) Leader(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (*LeaderResponse, error) { |
| 348 | out := new(LeaderResponse) |
| 349 | err := grpc.Invoke(ctx, "/v3electionpb.Election/Leader", in, out, c.cc, opts...) |
| 350 | if err != nil { |
| 351 | return nil, err |
| 352 | } |
| 353 | return out, nil |
| 354 | } |
| 355 | |
| 356 | func (c *electionClient) Observe(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (Election_ObserveClient, error) { |
| 357 | stream, err := grpc.NewClientStream(ctx, &_Election_serviceDesc.Streams[0], c.cc, "/v3electionpb.Election/Observe", opts...) |
| 358 | if err != nil { |
| 359 | return nil, err |
| 360 | } |
| 361 | x := &electionObserveClient{stream} |
| 362 | if err := x.ClientStream.SendMsg(in); err != nil { |
| 363 | return nil, err |
| 364 | } |
| 365 | if err := x.ClientStream.CloseSend(); err != nil { |
| 366 | return nil, err |
| 367 | } |
| 368 | return x, nil |
| 369 | } |
| 370 | |
| 371 | type Election_ObserveClient interface { |
| 372 | Recv() (*LeaderResponse, error) |
| 373 | grpc.ClientStream |
| 374 | } |
| 375 | |
| 376 | type electionObserveClient struct { |
| 377 | grpc.ClientStream |
| 378 | } |
| 379 | |
| 380 | func (x *electionObserveClient) Recv() (*LeaderResponse, error) { |
| 381 | m := new(LeaderResponse) |
| 382 | if err := x.ClientStream.RecvMsg(m); err != nil { |
| 383 | return nil, err |
| 384 | } |
| 385 | return m, nil |
| 386 | } |
| 387 | |
| 388 | func (c *electionClient) Resign(ctx context.Context, in *ResignRequest, opts ...grpc.CallOption) (*ResignResponse, error) { |
| 389 | out := new(ResignResponse) |
| 390 | err := grpc.Invoke(ctx, "/v3electionpb.Election/Resign", in, out, c.cc, opts...) |
| 391 | if err != nil { |
| 392 | return nil, err |
| 393 | } |
| 394 | return out, nil |
| 395 | } |
| 396 | |
| 397 | // Server API for Election service |
| 398 | |
| 399 | type ElectionServer interface { |
| 400 | // Campaign waits to acquire leadership in an election, returning a LeaderKey |
| 401 | // representing the leadership if successful. The LeaderKey can then be used |
| 402 | // to issue new values on the election, transactionally guard API requests on |
| 403 | // leadership still being held, and resign from the election. |
| 404 | Campaign(context.Context, *CampaignRequest) (*CampaignResponse, error) |
| 405 | // Proclaim updates the leader's posted value with a new value. |
| 406 | Proclaim(context.Context, *ProclaimRequest) (*ProclaimResponse, error) |
| 407 | // Leader returns the current election proclamation, if any. |
| 408 | Leader(context.Context, *LeaderRequest) (*LeaderResponse, error) |
| 409 | // Observe streams election proclamations in-order as made by the election's |
| 410 | // elected leaders. |
| 411 | Observe(*LeaderRequest, Election_ObserveServer) error |
| 412 | // Resign releases election leadership so other campaigners may acquire |
| 413 | // leadership on the election. |
| 414 | Resign(context.Context, *ResignRequest) (*ResignResponse, error) |
| 415 | } |
| 416 | |
| 417 | func RegisterElectionServer(s *grpc.Server, srv ElectionServer) { |
| 418 | s.RegisterService(&_Election_serviceDesc, srv) |
| 419 | } |
| 420 | |
| 421 | func _Election_Campaign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 422 | in := new(CampaignRequest) |
| 423 | if err := dec(in); err != nil { |
| 424 | return nil, err |
| 425 | } |
| 426 | if interceptor == nil { |
| 427 | return srv.(ElectionServer).Campaign(ctx, in) |
| 428 | } |
| 429 | info := &grpc.UnaryServerInfo{ |
| 430 | Server: srv, |
| 431 | FullMethod: "/v3electionpb.Election/Campaign", |
| 432 | } |
| 433 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 434 | return srv.(ElectionServer).Campaign(ctx, req.(*CampaignRequest)) |
| 435 | } |
| 436 | return interceptor(ctx, in, info, handler) |
| 437 | } |
| 438 | |
| 439 | func _Election_Proclaim_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 440 | in := new(ProclaimRequest) |
| 441 | if err := dec(in); err != nil { |
| 442 | return nil, err |
| 443 | } |
| 444 | if interceptor == nil { |
| 445 | return srv.(ElectionServer).Proclaim(ctx, in) |
| 446 | } |
| 447 | info := &grpc.UnaryServerInfo{ |
| 448 | Server: srv, |
| 449 | FullMethod: "/v3electionpb.Election/Proclaim", |
| 450 | } |
| 451 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 452 | return srv.(ElectionServer).Proclaim(ctx, req.(*ProclaimRequest)) |
| 453 | } |
| 454 | return interceptor(ctx, in, info, handler) |
| 455 | } |
| 456 | |
| 457 | func _Election_Leader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 458 | in := new(LeaderRequest) |
| 459 | if err := dec(in); err != nil { |
| 460 | return nil, err |
| 461 | } |
| 462 | if interceptor == nil { |
| 463 | return srv.(ElectionServer).Leader(ctx, in) |
| 464 | } |
| 465 | info := &grpc.UnaryServerInfo{ |
| 466 | Server: srv, |
| 467 | FullMethod: "/v3electionpb.Election/Leader", |
| 468 | } |
| 469 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 470 | return srv.(ElectionServer).Leader(ctx, req.(*LeaderRequest)) |
| 471 | } |
| 472 | return interceptor(ctx, in, info, handler) |
| 473 | } |
| 474 | |
| 475 | func _Election_Observe_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 476 | m := new(LeaderRequest) |
| 477 | if err := stream.RecvMsg(m); err != nil { |
| 478 | return err |
| 479 | } |
| 480 | return srv.(ElectionServer).Observe(m, &electionObserveServer{stream}) |
| 481 | } |
| 482 | |
| 483 | type Election_ObserveServer interface { |
| 484 | Send(*LeaderResponse) error |
| 485 | grpc.ServerStream |
| 486 | } |
| 487 | |
| 488 | type electionObserveServer struct { |
| 489 | grpc.ServerStream |
| 490 | } |
| 491 | |
| 492 | func (x *electionObserveServer) Send(m *LeaderResponse) error { |
| 493 | return x.ServerStream.SendMsg(m) |
| 494 | } |
| 495 | |
| 496 | func _Election_Resign_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 497 | in := new(ResignRequest) |
| 498 | if err := dec(in); err != nil { |
| 499 | return nil, err |
| 500 | } |
| 501 | if interceptor == nil { |
| 502 | return srv.(ElectionServer).Resign(ctx, in) |
| 503 | } |
| 504 | info := &grpc.UnaryServerInfo{ |
| 505 | Server: srv, |
| 506 | FullMethod: "/v3electionpb.Election/Resign", |
| 507 | } |
| 508 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 509 | return srv.(ElectionServer).Resign(ctx, req.(*ResignRequest)) |
| 510 | } |
| 511 | return interceptor(ctx, in, info, handler) |
| 512 | } |
| 513 | |
| 514 | var _Election_serviceDesc = grpc.ServiceDesc{ |
| 515 | ServiceName: "v3electionpb.Election", |
| 516 | HandlerType: (*ElectionServer)(nil), |
| 517 | Methods: []grpc.MethodDesc{ |
| 518 | { |
| 519 | MethodName: "Campaign", |
| 520 | Handler: _Election_Campaign_Handler, |
| 521 | }, |
| 522 | { |
| 523 | MethodName: "Proclaim", |
| 524 | Handler: _Election_Proclaim_Handler, |
| 525 | }, |
| 526 | { |
| 527 | MethodName: "Leader", |
| 528 | Handler: _Election_Leader_Handler, |
| 529 | }, |
| 530 | { |
| 531 | MethodName: "Resign", |
| 532 | Handler: _Election_Resign_Handler, |
| 533 | }, |
| 534 | }, |
| 535 | Streams: []grpc.StreamDesc{ |
| 536 | { |
| 537 | StreamName: "Observe", |
| 538 | Handler: _Election_Observe_Handler, |
| 539 | ServerStreams: true, |
| 540 | }, |
| 541 | }, |
| 542 | Metadata: "v3election.proto", |
| 543 | } |
| 544 | |
| 545 | func (m *CampaignRequest) Marshal() (dAtA []byte, err error) { |
| 546 | size := m.Size() |
| 547 | dAtA = make([]byte, size) |
| 548 | n, err := m.MarshalTo(dAtA) |
| 549 | if err != nil { |
| 550 | return nil, err |
| 551 | } |
| 552 | return dAtA[:n], nil |
| 553 | } |
| 554 | |
| 555 | func (m *CampaignRequest) MarshalTo(dAtA []byte) (int, error) { |
| 556 | var i int |
| 557 | _ = i |
| 558 | var l int |
| 559 | _ = l |
| 560 | if len(m.Name) > 0 { |
| 561 | dAtA[i] = 0xa |
| 562 | i++ |
| 563 | i = encodeVarintV3Election(dAtA, i, uint64(len(m.Name))) |
| 564 | i += copy(dAtA[i:], m.Name) |
| 565 | } |
| 566 | if m.Lease != 0 { |
| 567 | dAtA[i] = 0x10 |
| 568 | i++ |
| 569 | i = encodeVarintV3Election(dAtA, i, uint64(m.Lease)) |
| 570 | } |
| 571 | if len(m.Value) > 0 { |
| 572 | dAtA[i] = 0x1a |
| 573 | i++ |
| 574 | i = encodeVarintV3Election(dAtA, i, uint64(len(m.Value))) |
| 575 | i += copy(dAtA[i:], m.Value) |
| 576 | } |
| 577 | return i, nil |
| 578 | } |
| 579 | |
| 580 | func (m *CampaignResponse) Marshal() (dAtA []byte, err error) { |
| 581 | size := m.Size() |
| 582 | dAtA = make([]byte, size) |
| 583 | n, err := m.MarshalTo(dAtA) |
| 584 | if err != nil { |
| 585 | return nil, err |
| 586 | } |
| 587 | return dAtA[:n], nil |
| 588 | } |
| 589 | |
| 590 | func (m *CampaignResponse) MarshalTo(dAtA []byte) (int, error) { |
| 591 | var i int |
| 592 | _ = i |
| 593 | var l int |
| 594 | _ = l |
| 595 | if m.Header != nil { |
| 596 | dAtA[i] = 0xa |
| 597 | i++ |
| 598 | i = encodeVarintV3Election(dAtA, i, uint64(m.Header.Size())) |
| 599 | n1, err := m.Header.MarshalTo(dAtA[i:]) |
| 600 | if err != nil { |
| 601 | return 0, err |
| 602 | } |
| 603 | i += n1 |
| 604 | } |
| 605 | if m.Leader != nil { |
| 606 | dAtA[i] = 0x12 |
| 607 | i++ |
| 608 | i = encodeVarintV3Election(dAtA, i, uint64(m.Leader.Size())) |
| 609 | n2, err := m.Leader.MarshalTo(dAtA[i:]) |
| 610 | if err != nil { |
| 611 | return 0, err |
| 612 | } |
| 613 | i += n2 |
| 614 | } |
| 615 | return i, nil |
| 616 | } |
| 617 | |
| 618 | func (m *LeaderKey) Marshal() (dAtA []byte, err error) { |
| 619 | size := m.Size() |
| 620 | dAtA = make([]byte, size) |
| 621 | n, err := m.MarshalTo(dAtA) |
| 622 | if err != nil { |
| 623 | return nil, err |
| 624 | } |
| 625 | return dAtA[:n], nil |
| 626 | } |
| 627 | |
| 628 | func (m *LeaderKey) MarshalTo(dAtA []byte) (int, error) { |
| 629 | var i int |
| 630 | _ = i |
| 631 | var l int |
| 632 | _ = l |
| 633 | if len(m.Name) > 0 { |
| 634 | dAtA[i] = 0xa |
| 635 | i++ |
| 636 | i = encodeVarintV3Election(dAtA, i, uint64(len(m.Name))) |
| 637 | i += copy(dAtA[i:], m.Name) |
| 638 | } |
| 639 | if len(m.Key) > 0 { |
| 640 | dAtA[i] = 0x12 |
| 641 | i++ |
| 642 | i = encodeVarintV3Election(dAtA, i, uint64(len(m.Key))) |
| 643 | i += copy(dAtA[i:], m.Key) |
| 644 | } |
| 645 | if m.Rev != 0 { |
| 646 | dAtA[i] = 0x18 |
| 647 | i++ |
| 648 | i = encodeVarintV3Election(dAtA, i, uint64(m.Rev)) |
| 649 | } |
| 650 | if m.Lease != 0 { |
| 651 | dAtA[i] = 0x20 |
| 652 | i++ |
| 653 | i = encodeVarintV3Election(dAtA, i, uint64(m.Lease)) |
| 654 | } |
| 655 | return i, nil |
| 656 | } |
| 657 | |
| 658 | func (m *LeaderRequest) Marshal() (dAtA []byte, err error) { |
| 659 | size := m.Size() |
| 660 | dAtA = make([]byte, size) |
| 661 | n, err := m.MarshalTo(dAtA) |
| 662 | if err != nil { |
| 663 | return nil, err |
| 664 | } |
| 665 | return dAtA[:n], nil |
| 666 | } |
| 667 | |
| 668 | func (m *LeaderRequest) MarshalTo(dAtA []byte) (int, error) { |
| 669 | var i int |
| 670 | _ = i |
| 671 | var l int |
| 672 | _ = l |
| 673 | if len(m.Name) > 0 { |
| 674 | dAtA[i] = 0xa |
| 675 | i++ |
| 676 | i = encodeVarintV3Election(dAtA, i, uint64(len(m.Name))) |
| 677 | i += copy(dAtA[i:], m.Name) |
| 678 | } |
| 679 | return i, nil |
| 680 | } |
| 681 | |
| 682 | func (m *LeaderResponse) Marshal() (dAtA []byte, err error) { |
| 683 | size := m.Size() |
| 684 | dAtA = make([]byte, size) |
| 685 | n, err := m.MarshalTo(dAtA) |
| 686 | if err != nil { |
| 687 | return nil, err |
| 688 | } |
| 689 | return dAtA[:n], nil |
| 690 | } |
| 691 | |
| 692 | func (m *LeaderResponse) MarshalTo(dAtA []byte) (int, error) { |
| 693 | var i int |
| 694 | _ = i |
| 695 | var l int |
| 696 | _ = l |
| 697 | if m.Header != nil { |
| 698 | dAtA[i] = 0xa |
| 699 | i++ |
| 700 | i = encodeVarintV3Election(dAtA, i, uint64(m.Header.Size())) |
| 701 | n3, err := m.Header.MarshalTo(dAtA[i:]) |
| 702 | if err != nil { |
| 703 | return 0, err |
| 704 | } |
| 705 | i += n3 |
| 706 | } |
| 707 | if m.Kv != nil { |
| 708 | dAtA[i] = 0x12 |
| 709 | i++ |
| 710 | i = encodeVarintV3Election(dAtA, i, uint64(m.Kv.Size())) |
| 711 | n4, err := m.Kv.MarshalTo(dAtA[i:]) |
| 712 | if err != nil { |
| 713 | return 0, err |
| 714 | } |
| 715 | i += n4 |
| 716 | } |
| 717 | return i, nil |
| 718 | } |
| 719 | |
| 720 | func (m *ResignRequest) Marshal() (dAtA []byte, err error) { |
| 721 | size := m.Size() |
| 722 | dAtA = make([]byte, size) |
| 723 | n, err := m.MarshalTo(dAtA) |
| 724 | if err != nil { |
| 725 | return nil, err |
| 726 | } |
| 727 | return dAtA[:n], nil |
| 728 | } |
| 729 | |
| 730 | func (m *ResignRequest) MarshalTo(dAtA []byte) (int, error) { |
| 731 | var i int |
| 732 | _ = i |
| 733 | var l int |
| 734 | _ = l |
| 735 | if m.Leader != nil { |
| 736 | dAtA[i] = 0xa |
| 737 | i++ |
| 738 | i = encodeVarintV3Election(dAtA, i, uint64(m.Leader.Size())) |
| 739 | n5, err := m.Leader.MarshalTo(dAtA[i:]) |
| 740 | if err != nil { |
| 741 | return 0, err |
| 742 | } |
| 743 | i += n5 |
| 744 | } |
| 745 | return i, nil |
| 746 | } |
| 747 | |
| 748 | func (m *ResignResponse) Marshal() (dAtA []byte, err error) { |
| 749 | size := m.Size() |
| 750 | dAtA = make([]byte, size) |
| 751 | n, err := m.MarshalTo(dAtA) |
| 752 | if err != nil { |
| 753 | return nil, err |
| 754 | } |
| 755 | return dAtA[:n], nil |
| 756 | } |
| 757 | |
| 758 | func (m *ResignResponse) MarshalTo(dAtA []byte) (int, error) { |
| 759 | var i int |
| 760 | _ = i |
| 761 | var l int |
| 762 | _ = l |
| 763 | if m.Header != nil { |
| 764 | dAtA[i] = 0xa |
| 765 | i++ |
| 766 | i = encodeVarintV3Election(dAtA, i, uint64(m.Header.Size())) |
| 767 | n6, err := m.Header.MarshalTo(dAtA[i:]) |
| 768 | if err != nil { |
| 769 | return 0, err |
| 770 | } |
| 771 | i += n6 |
| 772 | } |
| 773 | return i, nil |
| 774 | } |
| 775 | |
| 776 | func (m *ProclaimRequest) Marshal() (dAtA []byte, err error) { |
| 777 | size := m.Size() |
| 778 | dAtA = make([]byte, size) |
| 779 | n, err := m.MarshalTo(dAtA) |
| 780 | if err != nil { |
| 781 | return nil, err |
| 782 | } |
| 783 | return dAtA[:n], nil |
| 784 | } |
| 785 | |
| 786 | func (m *ProclaimRequest) MarshalTo(dAtA []byte) (int, error) { |
| 787 | var i int |
| 788 | _ = i |
| 789 | var l int |
| 790 | _ = l |
| 791 | if m.Leader != nil { |
| 792 | dAtA[i] = 0xa |
| 793 | i++ |
| 794 | i = encodeVarintV3Election(dAtA, i, uint64(m.Leader.Size())) |
| 795 | n7, err := m.Leader.MarshalTo(dAtA[i:]) |
| 796 | if err != nil { |
| 797 | return 0, err |
| 798 | } |
| 799 | i += n7 |
| 800 | } |
| 801 | if len(m.Value) > 0 { |
| 802 | dAtA[i] = 0x12 |
| 803 | i++ |
| 804 | i = encodeVarintV3Election(dAtA, i, uint64(len(m.Value))) |
| 805 | i += copy(dAtA[i:], m.Value) |
| 806 | } |
| 807 | return i, nil |
| 808 | } |
| 809 | |
| 810 | func (m *ProclaimResponse) Marshal() (dAtA []byte, err error) { |
| 811 | size := m.Size() |
| 812 | dAtA = make([]byte, size) |
| 813 | n, err := m.MarshalTo(dAtA) |
| 814 | if err != nil { |
| 815 | return nil, err |
| 816 | } |
| 817 | return dAtA[:n], nil |
| 818 | } |
| 819 | |
| 820 | func (m *ProclaimResponse) MarshalTo(dAtA []byte) (int, error) { |
| 821 | var i int |
| 822 | _ = i |
| 823 | var l int |
| 824 | _ = l |
| 825 | if m.Header != nil { |
| 826 | dAtA[i] = 0xa |
| 827 | i++ |
| 828 | i = encodeVarintV3Election(dAtA, i, uint64(m.Header.Size())) |
| 829 | n8, err := m.Header.MarshalTo(dAtA[i:]) |
| 830 | if err != nil { |
| 831 | return 0, err |
| 832 | } |
| 833 | i += n8 |
| 834 | } |
| 835 | return i, nil |
| 836 | } |
| 837 | |
| 838 | func encodeVarintV3Election(dAtA []byte, offset int, v uint64) int { |
| 839 | for v >= 1<<7 { |
| 840 | dAtA[offset] = uint8(v&0x7f | 0x80) |
| 841 | v >>= 7 |
| 842 | offset++ |
| 843 | } |
| 844 | dAtA[offset] = uint8(v) |
| 845 | return offset + 1 |
| 846 | } |
| 847 | func (m *CampaignRequest) Size() (n int) { |
| 848 | var l int |
| 849 | _ = l |
| 850 | l = len(m.Name) |
| 851 | if l > 0 { |
| 852 | n += 1 + l + sovV3Election(uint64(l)) |
| 853 | } |
| 854 | if m.Lease != 0 { |
| 855 | n += 1 + sovV3Election(uint64(m.Lease)) |
| 856 | } |
| 857 | l = len(m.Value) |
| 858 | if l > 0 { |
| 859 | n += 1 + l + sovV3Election(uint64(l)) |
| 860 | } |
| 861 | return n |
| 862 | } |
| 863 | |
| 864 | func (m *CampaignResponse) Size() (n int) { |
| 865 | var l int |
| 866 | _ = l |
| 867 | if m.Header != nil { |
| 868 | l = m.Header.Size() |
| 869 | n += 1 + l + sovV3Election(uint64(l)) |
| 870 | } |
| 871 | if m.Leader != nil { |
| 872 | l = m.Leader.Size() |
| 873 | n += 1 + l + sovV3Election(uint64(l)) |
| 874 | } |
| 875 | return n |
| 876 | } |
| 877 | |
| 878 | func (m *LeaderKey) Size() (n int) { |
| 879 | var l int |
| 880 | _ = l |
| 881 | l = len(m.Name) |
| 882 | if l > 0 { |
| 883 | n += 1 + l + sovV3Election(uint64(l)) |
| 884 | } |
| 885 | l = len(m.Key) |
| 886 | if l > 0 { |
| 887 | n += 1 + l + sovV3Election(uint64(l)) |
| 888 | } |
| 889 | if m.Rev != 0 { |
| 890 | n += 1 + sovV3Election(uint64(m.Rev)) |
| 891 | } |
| 892 | if m.Lease != 0 { |
| 893 | n += 1 + sovV3Election(uint64(m.Lease)) |
| 894 | } |
| 895 | return n |
| 896 | } |
| 897 | |
| 898 | func (m *LeaderRequest) Size() (n int) { |
| 899 | var l int |
| 900 | _ = l |
| 901 | l = len(m.Name) |
| 902 | if l > 0 { |
| 903 | n += 1 + l + sovV3Election(uint64(l)) |
| 904 | } |
| 905 | return n |
| 906 | } |
| 907 | |
| 908 | func (m *LeaderResponse) Size() (n int) { |
| 909 | var l int |
| 910 | _ = l |
| 911 | if m.Header != nil { |
| 912 | l = m.Header.Size() |
| 913 | n += 1 + l + sovV3Election(uint64(l)) |
| 914 | } |
| 915 | if m.Kv != nil { |
| 916 | l = m.Kv.Size() |
| 917 | n += 1 + l + sovV3Election(uint64(l)) |
| 918 | } |
| 919 | return n |
| 920 | } |
| 921 | |
| 922 | func (m *ResignRequest) Size() (n int) { |
| 923 | var l int |
| 924 | _ = l |
| 925 | if m.Leader != nil { |
| 926 | l = m.Leader.Size() |
| 927 | n += 1 + l + sovV3Election(uint64(l)) |
| 928 | } |
| 929 | return n |
| 930 | } |
| 931 | |
| 932 | func (m *ResignResponse) Size() (n int) { |
| 933 | var l int |
| 934 | _ = l |
| 935 | if m.Header != nil { |
| 936 | l = m.Header.Size() |
| 937 | n += 1 + l + sovV3Election(uint64(l)) |
| 938 | } |
| 939 | return n |
| 940 | } |
| 941 | |
| 942 | func (m *ProclaimRequest) Size() (n int) { |
| 943 | var l int |
| 944 | _ = l |
| 945 | if m.Leader != nil { |
| 946 | l = m.Leader.Size() |
| 947 | n += 1 + l + sovV3Election(uint64(l)) |
| 948 | } |
| 949 | l = len(m.Value) |
| 950 | if l > 0 { |
| 951 | n += 1 + l + sovV3Election(uint64(l)) |
| 952 | } |
| 953 | return n |
| 954 | } |
| 955 | |
| 956 | func (m *ProclaimResponse) Size() (n int) { |
| 957 | var l int |
| 958 | _ = l |
| 959 | if m.Header != nil { |
| 960 | l = m.Header.Size() |
| 961 | n += 1 + l + sovV3Election(uint64(l)) |
| 962 | } |
| 963 | return n |
| 964 | } |
| 965 | |
| 966 | func sovV3Election(x uint64) (n int) { |
| 967 | for { |
| 968 | n++ |
| 969 | x >>= 7 |
| 970 | if x == 0 { |
| 971 | break |
| 972 | } |
| 973 | } |
| 974 | return n |
| 975 | } |
| 976 | func sozV3Election(x uint64) (n int) { |
| 977 | return sovV3Election(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 978 | } |
| 979 | func (m *CampaignRequest) Unmarshal(dAtA []byte) error { |
| 980 | l := len(dAtA) |
| 981 | iNdEx := 0 |
| 982 | for iNdEx < l { |
| 983 | preIndex := iNdEx |
| 984 | var wire uint64 |
| 985 | for shift := uint(0); ; shift += 7 { |
| 986 | if shift >= 64 { |
| 987 | return ErrIntOverflowV3Election |
| 988 | } |
| 989 | if iNdEx >= l { |
| 990 | return io.ErrUnexpectedEOF |
| 991 | } |
| 992 | b := dAtA[iNdEx] |
| 993 | iNdEx++ |
| 994 | wire |= (uint64(b) & 0x7F) << shift |
| 995 | if b < 0x80 { |
| 996 | break |
| 997 | } |
| 998 | } |
| 999 | fieldNum := int32(wire >> 3) |
| 1000 | wireType := int(wire & 0x7) |
| 1001 | if wireType == 4 { |
| 1002 | return fmt.Errorf("proto: CampaignRequest: wiretype end group for non-group") |
| 1003 | } |
| 1004 | if fieldNum <= 0 { |
| 1005 | return fmt.Errorf("proto: CampaignRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1006 | } |
| 1007 | switch fieldNum { |
| 1008 | case 1: |
| 1009 | if wireType != 2 { |
| 1010 | return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 1011 | } |
| 1012 | var byteLen int |
| 1013 | for shift := uint(0); ; shift += 7 { |
| 1014 | if shift >= 64 { |
| 1015 | return ErrIntOverflowV3Election |
| 1016 | } |
| 1017 | if iNdEx >= l { |
| 1018 | return io.ErrUnexpectedEOF |
| 1019 | } |
| 1020 | b := dAtA[iNdEx] |
| 1021 | iNdEx++ |
| 1022 | byteLen |= (int(b) & 0x7F) << shift |
| 1023 | if b < 0x80 { |
| 1024 | break |
| 1025 | } |
| 1026 | } |
| 1027 | if byteLen < 0 { |
| 1028 | return ErrInvalidLengthV3Election |
| 1029 | } |
| 1030 | postIndex := iNdEx + byteLen |
| 1031 | if postIndex > l { |
| 1032 | return io.ErrUnexpectedEOF |
| 1033 | } |
| 1034 | m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| 1035 | if m.Name == nil { |
| 1036 | m.Name = []byte{} |
| 1037 | } |
| 1038 | iNdEx = postIndex |
| 1039 | case 2: |
| 1040 | if wireType != 0 { |
| 1041 | return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) |
| 1042 | } |
| 1043 | m.Lease = 0 |
| 1044 | for shift := uint(0); ; shift += 7 { |
| 1045 | if shift >= 64 { |
| 1046 | return ErrIntOverflowV3Election |
| 1047 | } |
| 1048 | if iNdEx >= l { |
| 1049 | return io.ErrUnexpectedEOF |
| 1050 | } |
| 1051 | b := dAtA[iNdEx] |
| 1052 | iNdEx++ |
| 1053 | m.Lease |= (int64(b) & 0x7F) << shift |
| 1054 | if b < 0x80 { |
| 1055 | break |
| 1056 | } |
| 1057 | } |
| 1058 | case 3: |
| 1059 | if wireType != 2 { |
| 1060 | return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) |
| 1061 | } |
| 1062 | var byteLen int |
| 1063 | for shift := uint(0); ; shift += 7 { |
| 1064 | if shift >= 64 { |
| 1065 | return ErrIntOverflowV3Election |
| 1066 | } |
| 1067 | if iNdEx >= l { |
| 1068 | return io.ErrUnexpectedEOF |
| 1069 | } |
| 1070 | b := dAtA[iNdEx] |
| 1071 | iNdEx++ |
| 1072 | byteLen |= (int(b) & 0x7F) << shift |
| 1073 | if b < 0x80 { |
| 1074 | break |
| 1075 | } |
| 1076 | } |
| 1077 | if byteLen < 0 { |
| 1078 | return ErrInvalidLengthV3Election |
| 1079 | } |
| 1080 | postIndex := iNdEx + byteLen |
| 1081 | if postIndex > l { |
| 1082 | return io.ErrUnexpectedEOF |
| 1083 | } |
| 1084 | m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) |
| 1085 | if m.Value == nil { |
| 1086 | m.Value = []byte{} |
| 1087 | } |
| 1088 | iNdEx = postIndex |
| 1089 | default: |
| 1090 | iNdEx = preIndex |
| 1091 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1092 | if err != nil { |
| 1093 | return err |
| 1094 | } |
| 1095 | if skippy < 0 { |
| 1096 | return ErrInvalidLengthV3Election |
| 1097 | } |
| 1098 | if (iNdEx + skippy) > l { |
| 1099 | return io.ErrUnexpectedEOF |
| 1100 | } |
| 1101 | iNdEx += skippy |
| 1102 | } |
| 1103 | } |
| 1104 | |
| 1105 | if iNdEx > l { |
| 1106 | return io.ErrUnexpectedEOF |
| 1107 | } |
| 1108 | return nil |
| 1109 | } |
| 1110 | func (m *CampaignResponse) Unmarshal(dAtA []byte) error { |
| 1111 | l := len(dAtA) |
| 1112 | iNdEx := 0 |
| 1113 | for iNdEx < l { |
| 1114 | preIndex := iNdEx |
| 1115 | var wire uint64 |
| 1116 | for shift := uint(0); ; shift += 7 { |
| 1117 | if shift >= 64 { |
| 1118 | return ErrIntOverflowV3Election |
| 1119 | } |
| 1120 | if iNdEx >= l { |
| 1121 | return io.ErrUnexpectedEOF |
| 1122 | } |
| 1123 | b := dAtA[iNdEx] |
| 1124 | iNdEx++ |
| 1125 | wire |= (uint64(b) & 0x7F) << shift |
| 1126 | if b < 0x80 { |
| 1127 | break |
| 1128 | } |
| 1129 | } |
| 1130 | fieldNum := int32(wire >> 3) |
| 1131 | wireType := int(wire & 0x7) |
| 1132 | if wireType == 4 { |
| 1133 | return fmt.Errorf("proto: CampaignResponse: wiretype end group for non-group") |
| 1134 | } |
| 1135 | if fieldNum <= 0 { |
| 1136 | return fmt.Errorf("proto: CampaignResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1137 | } |
| 1138 | switch fieldNum { |
| 1139 | case 1: |
| 1140 | if wireType != 2 { |
| 1141 | return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) |
| 1142 | } |
| 1143 | var msglen int |
| 1144 | for shift := uint(0); ; shift += 7 { |
| 1145 | if shift >= 64 { |
| 1146 | return ErrIntOverflowV3Election |
| 1147 | } |
| 1148 | if iNdEx >= l { |
| 1149 | return io.ErrUnexpectedEOF |
| 1150 | } |
| 1151 | b := dAtA[iNdEx] |
| 1152 | iNdEx++ |
| 1153 | msglen |= (int(b) & 0x7F) << shift |
| 1154 | if b < 0x80 { |
| 1155 | break |
| 1156 | } |
| 1157 | } |
| 1158 | if msglen < 0 { |
| 1159 | return ErrInvalidLengthV3Election |
| 1160 | } |
| 1161 | postIndex := iNdEx + msglen |
| 1162 | if postIndex > l { |
| 1163 | return io.ErrUnexpectedEOF |
| 1164 | } |
| 1165 | if m.Header == nil { |
| 1166 | m.Header = &etcdserverpb.ResponseHeader{} |
| 1167 | } |
| 1168 | if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1169 | return err |
| 1170 | } |
| 1171 | iNdEx = postIndex |
| 1172 | case 2: |
| 1173 | if wireType != 2 { |
| 1174 | return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) |
| 1175 | } |
| 1176 | var msglen int |
| 1177 | for shift := uint(0); ; shift += 7 { |
| 1178 | if shift >= 64 { |
| 1179 | return ErrIntOverflowV3Election |
| 1180 | } |
| 1181 | if iNdEx >= l { |
| 1182 | return io.ErrUnexpectedEOF |
| 1183 | } |
| 1184 | b := dAtA[iNdEx] |
| 1185 | iNdEx++ |
| 1186 | msglen |= (int(b) & 0x7F) << shift |
| 1187 | if b < 0x80 { |
| 1188 | break |
| 1189 | } |
| 1190 | } |
| 1191 | if msglen < 0 { |
| 1192 | return ErrInvalidLengthV3Election |
| 1193 | } |
| 1194 | postIndex := iNdEx + msglen |
| 1195 | if postIndex > l { |
| 1196 | return io.ErrUnexpectedEOF |
| 1197 | } |
| 1198 | if m.Leader == nil { |
| 1199 | m.Leader = &LeaderKey{} |
| 1200 | } |
| 1201 | if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1202 | return err |
| 1203 | } |
| 1204 | iNdEx = postIndex |
| 1205 | default: |
| 1206 | iNdEx = preIndex |
| 1207 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1208 | if err != nil { |
| 1209 | return err |
| 1210 | } |
| 1211 | if skippy < 0 { |
| 1212 | return ErrInvalidLengthV3Election |
| 1213 | } |
| 1214 | if (iNdEx + skippy) > l { |
| 1215 | return io.ErrUnexpectedEOF |
| 1216 | } |
| 1217 | iNdEx += skippy |
| 1218 | } |
| 1219 | } |
| 1220 | |
| 1221 | if iNdEx > l { |
| 1222 | return io.ErrUnexpectedEOF |
| 1223 | } |
| 1224 | return nil |
| 1225 | } |
| 1226 | func (m *LeaderKey) Unmarshal(dAtA []byte) error { |
| 1227 | l := len(dAtA) |
| 1228 | iNdEx := 0 |
| 1229 | for iNdEx < l { |
| 1230 | preIndex := iNdEx |
| 1231 | var wire uint64 |
| 1232 | for shift := uint(0); ; shift += 7 { |
| 1233 | if shift >= 64 { |
| 1234 | return ErrIntOverflowV3Election |
| 1235 | } |
| 1236 | if iNdEx >= l { |
| 1237 | return io.ErrUnexpectedEOF |
| 1238 | } |
| 1239 | b := dAtA[iNdEx] |
| 1240 | iNdEx++ |
| 1241 | wire |= (uint64(b) & 0x7F) << shift |
| 1242 | if b < 0x80 { |
| 1243 | break |
| 1244 | } |
| 1245 | } |
| 1246 | fieldNum := int32(wire >> 3) |
| 1247 | wireType := int(wire & 0x7) |
| 1248 | if wireType == 4 { |
| 1249 | return fmt.Errorf("proto: LeaderKey: wiretype end group for non-group") |
| 1250 | } |
| 1251 | if fieldNum <= 0 { |
| 1252 | return fmt.Errorf("proto: LeaderKey: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1253 | } |
| 1254 | switch fieldNum { |
| 1255 | case 1: |
| 1256 | if wireType != 2 { |
| 1257 | return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 1258 | } |
| 1259 | var byteLen int |
| 1260 | for shift := uint(0); ; shift += 7 { |
| 1261 | if shift >= 64 { |
| 1262 | return ErrIntOverflowV3Election |
| 1263 | } |
| 1264 | if iNdEx >= l { |
| 1265 | return io.ErrUnexpectedEOF |
| 1266 | } |
| 1267 | b := dAtA[iNdEx] |
| 1268 | iNdEx++ |
| 1269 | byteLen |= (int(b) & 0x7F) << shift |
| 1270 | if b < 0x80 { |
| 1271 | break |
| 1272 | } |
| 1273 | } |
| 1274 | if byteLen < 0 { |
| 1275 | return ErrInvalidLengthV3Election |
| 1276 | } |
| 1277 | postIndex := iNdEx + byteLen |
| 1278 | if postIndex > l { |
| 1279 | return io.ErrUnexpectedEOF |
| 1280 | } |
| 1281 | m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| 1282 | if m.Name == nil { |
| 1283 | m.Name = []byte{} |
| 1284 | } |
| 1285 | iNdEx = postIndex |
| 1286 | case 2: |
| 1287 | if wireType != 2 { |
| 1288 | return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 1289 | } |
| 1290 | var byteLen int |
| 1291 | for shift := uint(0); ; shift += 7 { |
| 1292 | if shift >= 64 { |
| 1293 | return ErrIntOverflowV3Election |
| 1294 | } |
| 1295 | if iNdEx >= l { |
| 1296 | return io.ErrUnexpectedEOF |
| 1297 | } |
| 1298 | b := dAtA[iNdEx] |
| 1299 | iNdEx++ |
| 1300 | byteLen |= (int(b) & 0x7F) << shift |
| 1301 | if b < 0x80 { |
| 1302 | break |
| 1303 | } |
| 1304 | } |
| 1305 | if byteLen < 0 { |
| 1306 | return ErrInvalidLengthV3Election |
| 1307 | } |
| 1308 | postIndex := iNdEx + byteLen |
| 1309 | if postIndex > l { |
| 1310 | return io.ErrUnexpectedEOF |
| 1311 | } |
| 1312 | m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) |
| 1313 | if m.Key == nil { |
| 1314 | m.Key = []byte{} |
| 1315 | } |
| 1316 | iNdEx = postIndex |
| 1317 | case 3: |
| 1318 | if wireType != 0 { |
| 1319 | return fmt.Errorf("proto: wrong wireType = %d for field Rev", wireType) |
| 1320 | } |
| 1321 | m.Rev = 0 |
| 1322 | for shift := uint(0); ; shift += 7 { |
| 1323 | if shift >= 64 { |
| 1324 | return ErrIntOverflowV3Election |
| 1325 | } |
| 1326 | if iNdEx >= l { |
| 1327 | return io.ErrUnexpectedEOF |
| 1328 | } |
| 1329 | b := dAtA[iNdEx] |
| 1330 | iNdEx++ |
| 1331 | m.Rev |= (int64(b) & 0x7F) << shift |
| 1332 | if b < 0x80 { |
| 1333 | break |
| 1334 | } |
| 1335 | } |
| 1336 | case 4: |
| 1337 | if wireType != 0 { |
| 1338 | return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) |
| 1339 | } |
| 1340 | m.Lease = 0 |
| 1341 | for shift := uint(0); ; shift += 7 { |
| 1342 | if shift >= 64 { |
| 1343 | return ErrIntOverflowV3Election |
| 1344 | } |
| 1345 | if iNdEx >= l { |
| 1346 | return io.ErrUnexpectedEOF |
| 1347 | } |
| 1348 | b := dAtA[iNdEx] |
| 1349 | iNdEx++ |
| 1350 | m.Lease |= (int64(b) & 0x7F) << shift |
| 1351 | if b < 0x80 { |
| 1352 | break |
| 1353 | } |
| 1354 | } |
| 1355 | default: |
| 1356 | iNdEx = preIndex |
| 1357 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1358 | if err != nil { |
| 1359 | return err |
| 1360 | } |
| 1361 | if skippy < 0 { |
| 1362 | return ErrInvalidLengthV3Election |
| 1363 | } |
| 1364 | if (iNdEx + skippy) > l { |
| 1365 | return io.ErrUnexpectedEOF |
| 1366 | } |
| 1367 | iNdEx += skippy |
| 1368 | } |
| 1369 | } |
| 1370 | |
| 1371 | if iNdEx > l { |
| 1372 | return io.ErrUnexpectedEOF |
| 1373 | } |
| 1374 | return nil |
| 1375 | } |
| 1376 | func (m *LeaderRequest) Unmarshal(dAtA []byte) error { |
| 1377 | l := len(dAtA) |
| 1378 | iNdEx := 0 |
| 1379 | for iNdEx < l { |
| 1380 | preIndex := iNdEx |
| 1381 | var wire uint64 |
| 1382 | for shift := uint(0); ; shift += 7 { |
| 1383 | if shift >= 64 { |
| 1384 | return ErrIntOverflowV3Election |
| 1385 | } |
| 1386 | if iNdEx >= l { |
| 1387 | return io.ErrUnexpectedEOF |
| 1388 | } |
| 1389 | b := dAtA[iNdEx] |
| 1390 | iNdEx++ |
| 1391 | wire |= (uint64(b) & 0x7F) << shift |
| 1392 | if b < 0x80 { |
| 1393 | break |
| 1394 | } |
| 1395 | } |
| 1396 | fieldNum := int32(wire >> 3) |
| 1397 | wireType := int(wire & 0x7) |
| 1398 | if wireType == 4 { |
| 1399 | return fmt.Errorf("proto: LeaderRequest: wiretype end group for non-group") |
| 1400 | } |
| 1401 | if fieldNum <= 0 { |
| 1402 | return fmt.Errorf("proto: LeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1403 | } |
| 1404 | switch fieldNum { |
| 1405 | case 1: |
| 1406 | if wireType != 2 { |
| 1407 | return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) |
| 1408 | } |
| 1409 | var byteLen int |
| 1410 | for shift := uint(0); ; shift += 7 { |
| 1411 | if shift >= 64 { |
| 1412 | return ErrIntOverflowV3Election |
| 1413 | } |
| 1414 | if iNdEx >= l { |
| 1415 | return io.ErrUnexpectedEOF |
| 1416 | } |
| 1417 | b := dAtA[iNdEx] |
| 1418 | iNdEx++ |
| 1419 | byteLen |= (int(b) & 0x7F) << shift |
| 1420 | if b < 0x80 { |
| 1421 | break |
| 1422 | } |
| 1423 | } |
| 1424 | if byteLen < 0 { |
| 1425 | return ErrInvalidLengthV3Election |
| 1426 | } |
| 1427 | postIndex := iNdEx + byteLen |
| 1428 | if postIndex > l { |
| 1429 | return io.ErrUnexpectedEOF |
| 1430 | } |
| 1431 | m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) |
| 1432 | if m.Name == nil { |
| 1433 | m.Name = []byte{} |
| 1434 | } |
| 1435 | iNdEx = postIndex |
| 1436 | default: |
| 1437 | iNdEx = preIndex |
| 1438 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1439 | if err != nil { |
| 1440 | return err |
| 1441 | } |
| 1442 | if skippy < 0 { |
| 1443 | return ErrInvalidLengthV3Election |
| 1444 | } |
| 1445 | if (iNdEx + skippy) > l { |
| 1446 | return io.ErrUnexpectedEOF |
| 1447 | } |
| 1448 | iNdEx += skippy |
| 1449 | } |
| 1450 | } |
| 1451 | |
| 1452 | if iNdEx > l { |
| 1453 | return io.ErrUnexpectedEOF |
| 1454 | } |
| 1455 | return nil |
| 1456 | } |
| 1457 | func (m *LeaderResponse) Unmarshal(dAtA []byte) error { |
| 1458 | l := len(dAtA) |
| 1459 | iNdEx := 0 |
| 1460 | for iNdEx < l { |
| 1461 | preIndex := iNdEx |
| 1462 | var wire uint64 |
| 1463 | for shift := uint(0); ; shift += 7 { |
| 1464 | if shift >= 64 { |
| 1465 | return ErrIntOverflowV3Election |
| 1466 | } |
| 1467 | if iNdEx >= l { |
| 1468 | return io.ErrUnexpectedEOF |
| 1469 | } |
| 1470 | b := dAtA[iNdEx] |
| 1471 | iNdEx++ |
| 1472 | wire |= (uint64(b) & 0x7F) << shift |
| 1473 | if b < 0x80 { |
| 1474 | break |
| 1475 | } |
| 1476 | } |
| 1477 | fieldNum := int32(wire >> 3) |
| 1478 | wireType := int(wire & 0x7) |
| 1479 | if wireType == 4 { |
| 1480 | return fmt.Errorf("proto: LeaderResponse: wiretype end group for non-group") |
| 1481 | } |
| 1482 | if fieldNum <= 0 { |
| 1483 | return fmt.Errorf("proto: LeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1484 | } |
| 1485 | switch fieldNum { |
| 1486 | case 1: |
| 1487 | if wireType != 2 { |
| 1488 | return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) |
| 1489 | } |
| 1490 | var msglen int |
| 1491 | for shift := uint(0); ; shift += 7 { |
| 1492 | if shift >= 64 { |
| 1493 | return ErrIntOverflowV3Election |
| 1494 | } |
| 1495 | if iNdEx >= l { |
| 1496 | return io.ErrUnexpectedEOF |
| 1497 | } |
| 1498 | b := dAtA[iNdEx] |
| 1499 | iNdEx++ |
| 1500 | msglen |= (int(b) & 0x7F) << shift |
| 1501 | if b < 0x80 { |
| 1502 | break |
| 1503 | } |
| 1504 | } |
| 1505 | if msglen < 0 { |
| 1506 | return ErrInvalidLengthV3Election |
| 1507 | } |
| 1508 | postIndex := iNdEx + msglen |
| 1509 | if postIndex > l { |
| 1510 | return io.ErrUnexpectedEOF |
| 1511 | } |
| 1512 | if m.Header == nil { |
| 1513 | m.Header = &etcdserverpb.ResponseHeader{} |
| 1514 | } |
| 1515 | if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1516 | return err |
| 1517 | } |
| 1518 | iNdEx = postIndex |
| 1519 | case 2: |
| 1520 | if wireType != 2 { |
| 1521 | return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType) |
| 1522 | } |
| 1523 | var msglen int |
| 1524 | for shift := uint(0); ; shift += 7 { |
| 1525 | if shift >= 64 { |
| 1526 | return ErrIntOverflowV3Election |
| 1527 | } |
| 1528 | if iNdEx >= l { |
| 1529 | return io.ErrUnexpectedEOF |
| 1530 | } |
| 1531 | b := dAtA[iNdEx] |
| 1532 | iNdEx++ |
| 1533 | msglen |= (int(b) & 0x7F) << shift |
| 1534 | if b < 0x80 { |
| 1535 | break |
| 1536 | } |
| 1537 | } |
| 1538 | if msglen < 0 { |
| 1539 | return ErrInvalidLengthV3Election |
| 1540 | } |
| 1541 | postIndex := iNdEx + msglen |
| 1542 | if postIndex > l { |
| 1543 | return io.ErrUnexpectedEOF |
| 1544 | } |
| 1545 | if m.Kv == nil { |
| 1546 | m.Kv = &mvccpb.KeyValue{} |
| 1547 | } |
| 1548 | if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1549 | return err |
| 1550 | } |
| 1551 | iNdEx = postIndex |
| 1552 | default: |
| 1553 | iNdEx = preIndex |
| 1554 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1555 | if err != nil { |
| 1556 | return err |
| 1557 | } |
| 1558 | if skippy < 0 { |
| 1559 | return ErrInvalidLengthV3Election |
| 1560 | } |
| 1561 | if (iNdEx + skippy) > l { |
| 1562 | return io.ErrUnexpectedEOF |
| 1563 | } |
| 1564 | iNdEx += skippy |
| 1565 | } |
| 1566 | } |
| 1567 | |
| 1568 | if iNdEx > l { |
| 1569 | return io.ErrUnexpectedEOF |
| 1570 | } |
| 1571 | return nil |
| 1572 | } |
| 1573 | func (m *ResignRequest) Unmarshal(dAtA []byte) error { |
| 1574 | l := len(dAtA) |
| 1575 | iNdEx := 0 |
| 1576 | for iNdEx < l { |
| 1577 | preIndex := iNdEx |
| 1578 | var wire uint64 |
| 1579 | for shift := uint(0); ; shift += 7 { |
| 1580 | if shift >= 64 { |
| 1581 | return ErrIntOverflowV3Election |
| 1582 | } |
| 1583 | if iNdEx >= l { |
| 1584 | return io.ErrUnexpectedEOF |
| 1585 | } |
| 1586 | b := dAtA[iNdEx] |
| 1587 | iNdEx++ |
| 1588 | wire |= (uint64(b) & 0x7F) << shift |
| 1589 | if b < 0x80 { |
| 1590 | break |
| 1591 | } |
| 1592 | } |
| 1593 | fieldNum := int32(wire >> 3) |
| 1594 | wireType := int(wire & 0x7) |
| 1595 | if wireType == 4 { |
| 1596 | return fmt.Errorf("proto: ResignRequest: wiretype end group for non-group") |
| 1597 | } |
| 1598 | if fieldNum <= 0 { |
| 1599 | return fmt.Errorf("proto: ResignRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1600 | } |
| 1601 | switch fieldNum { |
| 1602 | case 1: |
| 1603 | if wireType != 2 { |
| 1604 | return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) |
| 1605 | } |
| 1606 | var msglen int |
| 1607 | for shift := uint(0); ; shift += 7 { |
| 1608 | if shift >= 64 { |
| 1609 | return ErrIntOverflowV3Election |
| 1610 | } |
| 1611 | if iNdEx >= l { |
| 1612 | return io.ErrUnexpectedEOF |
| 1613 | } |
| 1614 | b := dAtA[iNdEx] |
| 1615 | iNdEx++ |
| 1616 | msglen |= (int(b) & 0x7F) << shift |
| 1617 | if b < 0x80 { |
| 1618 | break |
| 1619 | } |
| 1620 | } |
| 1621 | if msglen < 0 { |
| 1622 | return ErrInvalidLengthV3Election |
| 1623 | } |
| 1624 | postIndex := iNdEx + msglen |
| 1625 | if postIndex > l { |
| 1626 | return io.ErrUnexpectedEOF |
| 1627 | } |
| 1628 | if m.Leader == nil { |
| 1629 | m.Leader = &LeaderKey{} |
| 1630 | } |
| 1631 | if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1632 | return err |
| 1633 | } |
| 1634 | iNdEx = postIndex |
| 1635 | default: |
| 1636 | iNdEx = preIndex |
| 1637 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1638 | if err != nil { |
| 1639 | return err |
| 1640 | } |
| 1641 | if skippy < 0 { |
| 1642 | return ErrInvalidLengthV3Election |
| 1643 | } |
| 1644 | if (iNdEx + skippy) > l { |
| 1645 | return io.ErrUnexpectedEOF |
| 1646 | } |
| 1647 | iNdEx += skippy |
| 1648 | } |
| 1649 | } |
| 1650 | |
| 1651 | if iNdEx > l { |
| 1652 | return io.ErrUnexpectedEOF |
| 1653 | } |
| 1654 | return nil |
| 1655 | } |
| 1656 | func (m *ResignResponse) Unmarshal(dAtA []byte) error { |
| 1657 | l := len(dAtA) |
| 1658 | iNdEx := 0 |
| 1659 | for iNdEx < l { |
| 1660 | preIndex := iNdEx |
| 1661 | var wire uint64 |
| 1662 | for shift := uint(0); ; shift += 7 { |
| 1663 | if shift >= 64 { |
| 1664 | return ErrIntOverflowV3Election |
| 1665 | } |
| 1666 | if iNdEx >= l { |
| 1667 | return io.ErrUnexpectedEOF |
| 1668 | } |
| 1669 | b := dAtA[iNdEx] |
| 1670 | iNdEx++ |
| 1671 | wire |= (uint64(b) & 0x7F) << shift |
| 1672 | if b < 0x80 { |
| 1673 | break |
| 1674 | } |
| 1675 | } |
| 1676 | fieldNum := int32(wire >> 3) |
| 1677 | wireType := int(wire & 0x7) |
| 1678 | if wireType == 4 { |
| 1679 | return fmt.Errorf("proto: ResignResponse: wiretype end group for non-group") |
| 1680 | } |
| 1681 | if fieldNum <= 0 { |
| 1682 | return fmt.Errorf("proto: ResignResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1683 | } |
| 1684 | switch fieldNum { |
| 1685 | case 1: |
| 1686 | if wireType != 2 { |
| 1687 | return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) |
| 1688 | } |
| 1689 | var msglen int |
| 1690 | for shift := uint(0); ; shift += 7 { |
| 1691 | if shift >= 64 { |
| 1692 | return ErrIntOverflowV3Election |
| 1693 | } |
| 1694 | if iNdEx >= l { |
| 1695 | return io.ErrUnexpectedEOF |
| 1696 | } |
| 1697 | b := dAtA[iNdEx] |
| 1698 | iNdEx++ |
| 1699 | msglen |= (int(b) & 0x7F) << shift |
| 1700 | if b < 0x80 { |
| 1701 | break |
| 1702 | } |
| 1703 | } |
| 1704 | if msglen < 0 { |
| 1705 | return ErrInvalidLengthV3Election |
| 1706 | } |
| 1707 | postIndex := iNdEx + msglen |
| 1708 | if postIndex > l { |
| 1709 | return io.ErrUnexpectedEOF |
| 1710 | } |
| 1711 | if m.Header == nil { |
| 1712 | m.Header = &etcdserverpb.ResponseHeader{} |
| 1713 | } |
| 1714 | if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1715 | return err |
| 1716 | } |
| 1717 | iNdEx = postIndex |
| 1718 | default: |
| 1719 | iNdEx = preIndex |
| 1720 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1721 | if err != nil { |
| 1722 | return err |
| 1723 | } |
| 1724 | if skippy < 0 { |
| 1725 | return ErrInvalidLengthV3Election |
| 1726 | } |
| 1727 | if (iNdEx + skippy) > l { |
| 1728 | return io.ErrUnexpectedEOF |
| 1729 | } |
| 1730 | iNdEx += skippy |
| 1731 | } |
| 1732 | } |
| 1733 | |
| 1734 | if iNdEx > l { |
| 1735 | return io.ErrUnexpectedEOF |
| 1736 | } |
| 1737 | return nil |
| 1738 | } |
| 1739 | func (m *ProclaimRequest) Unmarshal(dAtA []byte) error { |
| 1740 | l := len(dAtA) |
| 1741 | iNdEx := 0 |
| 1742 | for iNdEx < l { |
| 1743 | preIndex := iNdEx |
| 1744 | var wire uint64 |
| 1745 | for shift := uint(0); ; shift += 7 { |
| 1746 | if shift >= 64 { |
| 1747 | return ErrIntOverflowV3Election |
| 1748 | } |
| 1749 | if iNdEx >= l { |
| 1750 | return io.ErrUnexpectedEOF |
| 1751 | } |
| 1752 | b := dAtA[iNdEx] |
| 1753 | iNdEx++ |
| 1754 | wire |= (uint64(b) & 0x7F) << shift |
| 1755 | if b < 0x80 { |
| 1756 | break |
| 1757 | } |
| 1758 | } |
| 1759 | fieldNum := int32(wire >> 3) |
| 1760 | wireType := int(wire & 0x7) |
| 1761 | if wireType == 4 { |
| 1762 | return fmt.Errorf("proto: ProclaimRequest: wiretype end group for non-group") |
| 1763 | } |
| 1764 | if fieldNum <= 0 { |
| 1765 | return fmt.Errorf("proto: ProclaimRequest: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1766 | } |
| 1767 | switch fieldNum { |
| 1768 | case 1: |
| 1769 | if wireType != 2 { |
| 1770 | return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) |
| 1771 | } |
| 1772 | var msglen int |
| 1773 | for shift := uint(0); ; shift += 7 { |
| 1774 | if shift >= 64 { |
| 1775 | return ErrIntOverflowV3Election |
| 1776 | } |
| 1777 | if iNdEx >= l { |
| 1778 | return io.ErrUnexpectedEOF |
| 1779 | } |
| 1780 | b := dAtA[iNdEx] |
| 1781 | iNdEx++ |
| 1782 | msglen |= (int(b) & 0x7F) << shift |
| 1783 | if b < 0x80 { |
| 1784 | break |
| 1785 | } |
| 1786 | } |
| 1787 | if msglen < 0 { |
| 1788 | return ErrInvalidLengthV3Election |
| 1789 | } |
| 1790 | postIndex := iNdEx + msglen |
| 1791 | if postIndex > l { |
| 1792 | return io.ErrUnexpectedEOF |
| 1793 | } |
| 1794 | if m.Leader == nil { |
| 1795 | m.Leader = &LeaderKey{} |
| 1796 | } |
| 1797 | if err := m.Leader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1798 | return err |
| 1799 | } |
| 1800 | iNdEx = postIndex |
| 1801 | case 2: |
| 1802 | if wireType != 2 { |
| 1803 | return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) |
| 1804 | } |
| 1805 | var byteLen int |
| 1806 | for shift := uint(0); ; shift += 7 { |
| 1807 | if shift >= 64 { |
| 1808 | return ErrIntOverflowV3Election |
| 1809 | } |
| 1810 | if iNdEx >= l { |
| 1811 | return io.ErrUnexpectedEOF |
| 1812 | } |
| 1813 | b := dAtA[iNdEx] |
| 1814 | iNdEx++ |
| 1815 | byteLen |= (int(b) & 0x7F) << shift |
| 1816 | if b < 0x80 { |
| 1817 | break |
| 1818 | } |
| 1819 | } |
| 1820 | if byteLen < 0 { |
| 1821 | return ErrInvalidLengthV3Election |
| 1822 | } |
| 1823 | postIndex := iNdEx + byteLen |
| 1824 | if postIndex > l { |
| 1825 | return io.ErrUnexpectedEOF |
| 1826 | } |
| 1827 | m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) |
| 1828 | if m.Value == nil { |
| 1829 | m.Value = []byte{} |
| 1830 | } |
| 1831 | iNdEx = postIndex |
| 1832 | default: |
| 1833 | iNdEx = preIndex |
| 1834 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1835 | if err != nil { |
| 1836 | return err |
| 1837 | } |
| 1838 | if skippy < 0 { |
| 1839 | return ErrInvalidLengthV3Election |
| 1840 | } |
| 1841 | if (iNdEx + skippy) > l { |
| 1842 | return io.ErrUnexpectedEOF |
| 1843 | } |
| 1844 | iNdEx += skippy |
| 1845 | } |
| 1846 | } |
| 1847 | |
| 1848 | if iNdEx > l { |
| 1849 | return io.ErrUnexpectedEOF |
| 1850 | } |
| 1851 | return nil |
| 1852 | } |
| 1853 | func (m *ProclaimResponse) Unmarshal(dAtA []byte) error { |
| 1854 | l := len(dAtA) |
| 1855 | iNdEx := 0 |
| 1856 | for iNdEx < l { |
| 1857 | preIndex := iNdEx |
| 1858 | var wire uint64 |
| 1859 | for shift := uint(0); ; shift += 7 { |
| 1860 | if shift >= 64 { |
| 1861 | return ErrIntOverflowV3Election |
| 1862 | } |
| 1863 | if iNdEx >= l { |
| 1864 | return io.ErrUnexpectedEOF |
| 1865 | } |
| 1866 | b := dAtA[iNdEx] |
| 1867 | iNdEx++ |
| 1868 | wire |= (uint64(b) & 0x7F) << shift |
| 1869 | if b < 0x80 { |
| 1870 | break |
| 1871 | } |
| 1872 | } |
| 1873 | fieldNum := int32(wire >> 3) |
| 1874 | wireType := int(wire & 0x7) |
| 1875 | if wireType == 4 { |
| 1876 | return fmt.Errorf("proto: ProclaimResponse: wiretype end group for non-group") |
| 1877 | } |
| 1878 | if fieldNum <= 0 { |
| 1879 | return fmt.Errorf("proto: ProclaimResponse: illegal tag %d (wire type %d)", fieldNum, wire) |
| 1880 | } |
| 1881 | switch fieldNum { |
| 1882 | case 1: |
| 1883 | if wireType != 2 { |
| 1884 | return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) |
| 1885 | } |
| 1886 | var msglen int |
| 1887 | for shift := uint(0); ; shift += 7 { |
| 1888 | if shift >= 64 { |
| 1889 | return ErrIntOverflowV3Election |
| 1890 | } |
| 1891 | if iNdEx >= l { |
| 1892 | return io.ErrUnexpectedEOF |
| 1893 | } |
| 1894 | b := dAtA[iNdEx] |
| 1895 | iNdEx++ |
| 1896 | msglen |= (int(b) & 0x7F) << shift |
| 1897 | if b < 0x80 { |
| 1898 | break |
| 1899 | } |
| 1900 | } |
| 1901 | if msglen < 0 { |
| 1902 | return ErrInvalidLengthV3Election |
| 1903 | } |
| 1904 | postIndex := iNdEx + msglen |
| 1905 | if postIndex > l { |
| 1906 | return io.ErrUnexpectedEOF |
| 1907 | } |
| 1908 | if m.Header == nil { |
| 1909 | m.Header = &etcdserverpb.ResponseHeader{} |
| 1910 | } |
| 1911 | if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 1912 | return err |
| 1913 | } |
| 1914 | iNdEx = postIndex |
| 1915 | default: |
| 1916 | iNdEx = preIndex |
| 1917 | skippy, err := skipV3Election(dAtA[iNdEx:]) |
| 1918 | if err != nil { |
| 1919 | return err |
| 1920 | } |
| 1921 | if skippy < 0 { |
| 1922 | return ErrInvalidLengthV3Election |
| 1923 | } |
| 1924 | if (iNdEx + skippy) > l { |
| 1925 | return io.ErrUnexpectedEOF |
| 1926 | } |
| 1927 | iNdEx += skippy |
| 1928 | } |
| 1929 | } |
| 1930 | |
| 1931 | if iNdEx > l { |
| 1932 | return io.ErrUnexpectedEOF |
| 1933 | } |
| 1934 | return nil |
| 1935 | } |
| 1936 | func skipV3Election(dAtA []byte) (n int, err error) { |
| 1937 | l := len(dAtA) |
| 1938 | iNdEx := 0 |
| 1939 | for iNdEx < l { |
| 1940 | var wire uint64 |
| 1941 | for shift := uint(0); ; shift += 7 { |
| 1942 | if shift >= 64 { |
| 1943 | return 0, ErrIntOverflowV3Election |
| 1944 | } |
| 1945 | if iNdEx >= l { |
| 1946 | return 0, io.ErrUnexpectedEOF |
| 1947 | } |
| 1948 | b := dAtA[iNdEx] |
| 1949 | iNdEx++ |
| 1950 | wire |= (uint64(b) & 0x7F) << shift |
| 1951 | if b < 0x80 { |
| 1952 | break |
| 1953 | } |
| 1954 | } |
| 1955 | wireType := int(wire & 0x7) |
| 1956 | switch wireType { |
| 1957 | case 0: |
| 1958 | for shift := uint(0); ; shift += 7 { |
| 1959 | if shift >= 64 { |
| 1960 | return 0, ErrIntOverflowV3Election |
| 1961 | } |
| 1962 | if iNdEx >= l { |
| 1963 | return 0, io.ErrUnexpectedEOF |
| 1964 | } |
| 1965 | iNdEx++ |
| 1966 | if dAtA[iNdEx-1] < 0x80 { |
| 1967 | break |
| 1968 | } |
| 1969 | } |
| 1970 | return iNdEx, nil |
| 1971 | case 1: |
| 1972 | iNdEx += 8 |
| 1973 | return iNdEx, nil |
| 1974 | case 2: |
| 1975 | var length int |
| 1976 | for shift := uint(0); ; shift += 7 { |
| 1977 | if shift >= 64 { |
| 1978 | return 0, ErrIntOverflowV3Election |
| 1979 | } |
| 1980 | if iNdEx >= l { |
| 1981 | return 0, io.ErrUnexpectedEOF |
| 1982 | } |
| 1983 | b := dAtA[iNdEx] |
| 1984 | iNdEx++ |
| 1985 | length |= (int(b) & 0x7F) << shift |
| 1986 | if b < 0x80 { |
| 1987 | break |
| 1988 | } |
| 1989 | } |
| 1990 | iNdEx += length |
| 1991 | if length < 0 { |
| 1992 | return 0, ErrInvalidLengthV3Election |
| 1993 | } |
| 1994 | return iNdEx, nil |
| 1995 | case 3: |
| 1996 | for { |
| 1997 | var innerWire uint64 |
| 1998 | var start int = iNdEx |
| 1999 | for shift := uint(0); ; shift += 7 { |
| 2000 | if shift >= 64 { |
| 2001 | return 0, ErrIntOverflowV3Election |
| 2002 | } |
| 2003 | if iNdEx >= l { |
| 2004 | return 0, io.ErrUnexpectedEOF |
| 2005 | } |
| 2006 | b := dAtA[iNdEx] |
| 2007 | iNdEx++ |
| 2008 | innerWire |= (uint64(b) & 0x7F) << shift |
| 2009 | if b < 0x80 { |
| 2010 | break |
| 2011 | } |
| 2012 | } |
| 2013 | innerWireType := int(innerWire & 0x7) |
| 2014 | if innerWireType == 4 { |
| 2015 | break |
| 2016 | } |
| 2017 | next, err := skipV3Election(dAtA[start:]) |
| 2018 | if err != nil { |
| 2019 | return 0, err |
| 2020 | } |
| 2021 | iNdEx = start + next |
| 2022 | } |
| 2023 | return iNdEx, nil |
| 2024 | case 4: |
| 2025 | return iNdEx, nil |
| 2026 | case 5: |
| 2027 | iNdEx += 4 |
| 2028 | return iNdEx, nil |
| 2029 | default: |
| 2030 | return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 2031 | } |
| 2032 | } |
| 2033 | panic("unreachable") |
| 2034 | } |
| 2035 | |
| 2036 | var ( |
| 2037 | ErrInvalidLengthV3Election = fmt.Errorf("proto: negative length found during unmarshaling") |
| 2038 | ErrIntOverflowV3Election = fmt.Errorf("proto: integer overflow") |
| 2039 | ) |
| 2040 | |
| 2041 | func init() { proto.RegisterFile("v3election.proto", fileDescriptorV3Election) } |
| 2042 | |
| 2043 | var fileDescriptorV3Election = []byte{ |
| 2044 | // 535 bytes of a gzipped FileDescriptorProto |
| 2045 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xcf, 0x6e, 0xd3, 0x40, |
| 2046 | 0x10, 0xc6, 0x59, 0x27, 0x84, 0x32, 0xa4, 0xad, 0x65, 0x82, 0x48, 0x43, 0x30, 0xd1, 0x22, 0xa1, |
| 2047 | 0x2a, 0x07, 0x2f, 0x6a, 0x38, 0xe5, 0x84, 0x40, 0xa0, 0x4a, 0x45, 0x02, 0x7c, 0x40, 0x70, 0xdc, |
| 2048 | 0xb8, 0x23, 0x37, 0x8a, 0xe3, 0x35, 0xb6, 0x6b, 0x29, 0x57, 0x5e, 0x81, 0x03, 0x3c, 0x12, 0x47, |
| 2049 | 0x24, 0x5e, 0x00, 0x05, 0x1e, 0x04, 0xed, 0xae, 0x8d, 0xff, 0x28, 0x41, 0xa8, 0xb9, 0x58, 0xe3, |
| 2050 | 0x9d, 0xcf, 0xf3, 0x9b, 0x6f, 0x76, 0x12, 0x30, 0xb3, 0x09, 0x06, 0xe8, 0xa5, 0x73, 0x11, 0x3a, |
| 2051 | 0x51, 0x2c, 0x52, 0x61, 0x75, 0xcb, 0x93, 0x68, 0x36, 0xe8, 0xf9, 0xc2, 0x17, 0x2a, 0xc1, 0x64, |
| 2052 | 0xa4, 0x35, 0x83, 0x47, 0x98, 0x7a, 0xe7, 0x4c, 0x3e, 0x12, 0x8c, 0x33, 0x8c, 0x2b, 0x61, 0x34, |
| 2053 | 0x63, 0x71, 0xe4, 0xe5, 0xba, 0x23, 0xa5, 0x5b, 0x66, 0x9e, 0xa7, 0x1e, 0xd1, 0x8c, 0x2d, 0xb2, |
| 2054 | 0x3c, 0x35, 0xf4, 0x85, 0xf0, 0x03, 0x64, 0x3c, 0x9a, 0x33, 0x1e, 0x86, 0x22, 0xe5, 0x92, 0x98, |
| 2055 | 0xe8, 0x2c, 0x7d, 0x0b, 0x87, 0xcf, 0xf9, 0x32, 0xe2, 0x73, 0x3f, 0x74, 0xf1, 0xe3, 0x25, 0x26, |
| 2056 | 0xa9, 0x65, 0x41, 0x3b, 0xe4, 0x4b, 0xec, 0x93, 0x11, 0x39, 0xee, 0xba, 0x2a, 0xb6, 0x7a, 0x70, |
| 2057 | 0x3d, 0x40, 0x9e, 0x60, 0xdf, 0x18, 0x91, 0xe3, 0x96, 0xab, 0x5f, 0xe4, 0x69, 0xc6, 0x83, 0x4b, |
| 2058 | 0xec, 0xb7, 0x94, 0x54, 0xbf, 0xd0, 0x15, 0x98, 0x65, 0xc9, 0x24, 0x12, 0x61, 0x82, 0xd6, 0x13, |
| 2059 | 0xe8, 0x5c, 0x20, 0x3f, 0xc7, 0x58, 0x55, 0xbd, 0x75, 0x32, 0x74, 0xaa, 0x46, 0x9c, 0x42, 0x77, |
| 2060 | 0xaa, 0x34, 0x6e, 0xae, 0xb5, 0x18, 0x74, 0x02, 0xfd, 0x95, 0xa1, 0xbe, 0xba, 0xeb, 0x54, 0x47, |
| 2061 | 0xe6, 0xbc, 0x52, 0xb9, 0x33, 0x5c, 0xb9, 0xb9, 0x8c, 0x7e, 0x80, 0x9b, 0x7f, 0x0f, 0x37, 0xfa, |
| 2062 | 0x30, 0xa1, 0xb5, 0xc0, 0x95, 0x2a, 0xd7, 0x75, 0x65, 0x28, 0x4f, 0x62, 0xcc, 0x94, 0x83, 0x96, |
| 2063 | 0x2b, 0xc3, 0xd2, 0x6b, 0xbb, 0xe2, 0x95, 0x3e, 0x84, 0x7d, 0x5d, 0xfa, 0x1f, 0x63, 0xa2, 0x17, |
| 2064 | 0x70, 0x50, 0x88, 0x76, 0x32, 0x3e, 0x02, 0x63, 0x91, 0xe5, 0xa6, 0x4d, 0x47, 0xdf, 0xa8, 0x73, |
| 2065 | 0x86, 0xab, 0x77, 0x72, 0xc0, 0xae, 0xb1, 0xc8, 0xe8, 0x53, 0xd8, 0x77, 0x31, 0xa9, 0xdc, 0x5a, |
| 2066 | 0x39, 0x2b, 0xf2, 0x7f, 0xb3, 0x7a, 0x09, 0x07, 0x45, 0x85, 0x5d, 0x7a, 0xa5, 0xef, 0xe1, 0xf0, |
| 2067 | 0x4d, 0x2c, 0xbc, 0x80, 0xcf, 0x97, 0x57, 0xed, 0xa5, 0x5c, 0x24, 0xa3, 0xba, 0x48, 0xa7, 0x60, |
| 2068 | 0x96, 0x95, 0x77, 0xe9, 0xf1, 0xe4, 0x4b, 0x1b, 0xf6, 0x5e, 0xe4, 0x0d, 0x58, 0x0b, 0xd8, 0x2b, |
| 2069 | 0xf6, 0xd3, 0xba, 0x5f, 0xef, 0xac, 0xf1, 0x53, 0x18, 0xd8, 0xdb, 0xd2, 0x9a, 0x42, 0x47, 0x9f, |
| 2070 | 0x7e, 0xfc, 0xfe, 0x6c, 0x0c, 0xe8, 0x1d, 0x96, 0x4d, 0x58, 0x21, 0x64, 0x5e, 0x2e, 0x9b, 0x92, |
| 2071 | 0xb1, 0x84, 0x15, 0x1e, 0x9a, 0xb0, 0xc6, 0xd4, 0x9a, 0xb0, 0xa6, 0xf5, 0x2d, 0xb0, 0x28, 0x97, |
| 2072 | 0x49, 0x98, 0x07, 0x1d, 0x3d, 0x5b, 0xeb, 0xde, 0xa6, 0x89, 0x17, 0xa0, 0xe1, 0xe6, 0x64, 0x8e, |
| 2073 | 0xb1, 0x15, 0xa6, 0x4f, 0x6f, 0xd7, 0x30, 0xfa, 0xa2, 0x24, 0xc4, 0x87, 0x1b, 0xaf, 0x67, 0x6a, |
| 2074 | 0xe0, 0xbb, 0x50, 0x1e, 0x28, 0xca, 0x11, 0xed, 0xd5, 0x28, 0x42, 0x17, 0x9e, 0x92, 0xf1, 0x63, |
| 2075 | 0x22, 0xdd, 0xe8, 0x05, 0x6d, 0x72, 0x6a, 0x8b, 0xdf, 0xe4, 0xd4, 0x77, 0x7a, 0x8b, 0x9b, 0x58, |
| 2076 | 0x89, 0xa6, 0x64, 0xfc, 0xcc, 0xfc, 0xb6, 0xb6, 0xc9, 0xf7, 0xb5, 0x4d, 0x7e, 0xae, 0x6d, 0xf2, |
| 2077 | 0xf5, 0x97, 0x7d, 0x6d, 0xd6, 0x51, 0x7f, 0x8c, 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2f, |
| 2078 | 0x1d, 0xfa, 0x11, 0xb1, 0x05, 0x00, 0x00, |
| 2079 | } |