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