forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
request_vote_responses.pb.go
440 lines (421 loc) · 11.2 KB
/
request_vote_responses.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
// Code generated by protoc-gen-gogo.
// source: request_vote_responses.proto
// DO NOT EDIT!
package protobuf
import proto "code.google.com/p/gogoprotobuf/proto"
import json "encoding/json"
import math "math"
// discarding unused import gogoproto "code.google.com/p/gogoprotobuf/gogoproto/gogo.pb"
import io4 "io"
import code_google_com_p_gogoprotobuf_proto8 "code.google.com/p/gogoprotobuf/proto"
import fmt12 "fmt"
import strings8 "strings"
import reflect8 "reflect"
import fmt13 "fmt"
import strings9 "strings"
import code_google_com_p_gogoprotobuf_proto9 "code.google.com/p/gogoprotobuf/proto"
import sort4 "sort"
import strconv4 "strconv"
import reflect9 "reflect"
import fmt14 "fmt"
import bytes4 "bytes"
// Reference proto, json, and math imports to suppress error if they are not otherwise used.
var _ = proto.Marshal
var _ = &json.SyntaxError{}
var _ = math.Inf
type RequestVoteResponse struct {
Term *uint64 `protobuf:"varint,1,req" json:"Term,omitempty"`
VoteGranted *bool `protobuf:"varint,2,req" json:"VoteGranted,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *RequestVoteResponse) Reset() { *m = RequestVoteResponse{} }
func (*RequestVoteResponse) ProtoMessage() {}
func (m *RequestVoteResponse) GetTerm() uint64 {
if m != nil && m.Term != nil {
return *m.Term
}
return 0
}
func (m *RequestVoteResponse) GetVoteGranted() bool {
if m != nil && m.VoteGranted != nil {
return *m.VoteGranted
}
return false
}
func init() {
}
func (m *RequestVoteResponse) Unmarshal(data []byte) error {
l := len(data)
index := 0
for index < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if index >= l {
return io4.ErrUnexpectedEOF
}
b := data[index]
index++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
switch fieldNum {
case 1:
if wireType != 0 {
return proto.ErrWrongType
}
var v uint64
for shift := uint(0); ; shift += 7 {
if index >= l {
return io4.ErrUnexpectedEOF
}
b := data[index]
index++
v |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
m.Term = &v
case 2:
if wireType != 0 {
return proto.ErrWrongType
}
var v int
for shift := uint(0); ; shift += 7 {
if index >= l {
return io4.ErrUnexpectedEOF
}
b := data[index]
index++
v |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
b := bool(v != 0)
m.VoteGranted = &b
default:
var sizeOfWire int
for {
sizeOfWire++
wire >>= 7
if wire == 0 {
break
}
}
index -= sizeOfWire
skippy, err := code_google_com_p_gogoprotobuf_proto8.Skip(data[index:])
if err != nil {
return err
}
m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...)
index += skippy
}
}
return nil
}
func (this *RequestVoteResponse) String() string {
if this == nil {
return "nil"
}
s := strings8.Join([]string{`&RequestVoteResponse{`,
`Term:` + valueToStringRequestVoteResponses(this.Term) + `,`,
`VoteGranted:` + valueToStringRequestVoteResponses(this.VoteGranted) + `,`,
`XXX_unrecognized:` + fmt12.Sprintf("%v", this.XXX_unrecognized) + `,`,
`}`,
}, "")
return s
}
func valueToStringRequestVoteResponses(v interface{}) string {
rv := reflect8.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect8.Indirect(rv).Interface()
return fmt12.Sprintf("*%v", pv)
}
func (m *RequestVoteResponse) Size() (n int) {
var l int
_ = l
if m.Term != nil {
n += 1 + sovRequestVoteResponses(uint64(*m.Term))
}
if m.VoteGranted != nil {
n += 2
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovRequestVoteResponses(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozRequestVoteResponses(x uint64) (n int) {
return sovRequestVoteResponses(uint64((x << 1) ^ uint64((int64(x) >> 63))))
return sovRequestVoteResponses(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func NewPopulatedRequestVoteResponse(r randyRequestVoteResponses, easy bool) *RequestVoteResponse {
this := &RequestVoteResponse{}
v1 := uint64(r.Uint32())
this.Term = &v1
v2 := bool(r.Intn(2) == 0)
this.VoteGranted = &v2
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedRequestVoteResponses(r, 3)
}
return this
}
type randyRequestVoteResponses interface {
Float32() float32
Float64() float64
Int63() int64
Int31() int32
Uint32() uint32
Intn(n int) int
}
func randUTF8RuneRequestVoteResponses(r randyRequestVoteResponses) rune {
res := rune(r.Uint32() % 1112064)
if 55296 <= res {
res += 2047
}
return res
}
func randStringRequestVoteResponses(r randyRequestVoteResponses) string {
v3 := r.Intn(100)
tmps := make([]rune, v3)
for i := 0; i < v3; i++ {
tmps[i] = randUTF8RuneRequestVoteResponses(r)
}
return string(tmps)
}
func randUnrecognizedRequestVoteResponses(r randyRequestVoteResponses, maxFieldNumber int) (data []byte) {
l := r.Intn(5)
for i := 0; i < l; i++ {
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
fieldNumber := maxFieldNumber + r.Intn(100)
data = randFieldRequestVoteResponses(data, r, fieldNumber, wire)
}
return data
}
func randFieldRequestVoteResponses(data []byte, r randyRequestVoteResponses, fieldNumber int, wire int) []byte {
key := uint32(fieldNumber)<<3 | uint32(wire)
switch wire {
case 0:
data = encodeVarintPopulateRequestVoteResponses(data, uint64(key))
data = encodeVarintPopulateRequestVoteResponses(data, uint64(r.Int63()))
case 1:
data = encodeVarintPopulateRequestVoteResponses(data, uint64(key))
data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
case 2:
data = encodeVarintPopulateRequestVoteResponses(data, uint64(key))
ll := r.Intn(100)
data = encodeVarintPopulateRequestVoteResponses(data, uint64(ll))
for j := 0; j < ll; j++ {
data = append(data, byte(r.Intn(256)))
}
default:
data = encodeVarintPopulateRequestVoteResponses(data, uint64(key))
data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return data
}
func encodeVarintPopulateRequestVoteResponses(data []byte, v uint64) []byte {
for v >= 1<<7 {
data = append(data, uint8(uint64(v)&0x7f|0x80))
v >>= 7
}
data = append(data, uint8(v))
return data
}
func (m *RequestVoteResponse) Marshal() (data []byte, err error) {
size := m.Size()
data = make([]byte, size)
n, err := m.MarshalTo(data)
if err != nil {
return nil, err
}
return data[:n], nil
}
func (m *RequestVoteResponse) MarshalTo(data []byte) (n int, err error) {
var i int
_ = i
var l int
_ = l
if m.Term != nil {
data[i] = 0x8
i++
i = encodeVarintRequestVoteResponses(data, i, uint64(*m.Term))
}
if m.VoteGranted != nil {
data[i] = 0x10
i++
if *m.VoteGranted {
data[i] = 1
} else {
data[i] = 0
}
i++
}
if m.XXX_unrecognized != nil {
i += copy(data[i:], m.XXX_unrecognized)
}
return i, nil
}
func encodeFixed64RequestVoteResponses(data []byte, offset int, v uint64) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
data[offset+4] = uint8(v >> 32)
data[offset+5] = uint8(v >> 40)
data[offset+6] = uint8(v >> 48)
data[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32RequestVoteResponses(data []byte, offset int, v uint32) int {
data[offset] = uint8(v)
data[offset+1] = uint8(v >> 8)
data[offset+2] = uint8(v >> 16)
data[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintRequestVoteResponses(data []byte, offset int, v uint64) int {
for v >= 1<<7 {
data[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
data[offset] = uint8(v)
return offset + 1
}
func (this *RequestVoteResponse) GoString() string {
if this == nil {
return "nil"
}
s := strings9.Join([]string{`&protobuf.RequestVoteResponse{` + `Term:` + valueToGoStringRequestVoteResponses(this.Term, "uint64"), `VoteGranted:` + valueToGoStringRequestVoteResponses(this.VoteGranted, "bool"), `XXX_unrecognized:` + fmt13.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ")
return s
}
func valueToGoStringRequestVoteResponses(v interface{}, typ string) string {
rv := reflect9.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect9.Indirect(rv).Interface()
return fmt13.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
}
func extensionToGoStringRequestVoteResponses(e map[int32]code_google_com_p_gogoprotobuf_proto9.Extension) string {
if e == nil {
return "nil"
}
s := "map[int32]proto.Extension{"
keys := make([]int, 0, len(e))
for k := range e {
keys = append(keys, int(k))
}
sort4.Ints(keys)
ss := []string{}
for _, k := range keys {
ss = append(ss, strconv4.Itoa(k)+": "+e[int32(k)].GoString())
}
s += strings9.Join(ss, ",") + "}"
return s
}
func (this *RequestVoteResponse) VerboseEqual(that interface{}) error {
if that == nil {
if this == nil {
return nil
}
return fmt14.Errorf("that == nil && this != nil")
}
that1, ok := that.(*RequestVoteResponse)
if !ok {
return fmt14.Errorf("that is not of type *RequestVoteResponse")
}
if that1 == nil {
if this == nil {
return nil
}
return fmt14.Errorf("that is type *RequestVoteResponse but is nil && this != nil")
} else if this == nil {
return fmt14.Errorf("that is type *RequestVoteResponsebut is not nil && this == nil")
}
if this.Term != nil && that1.Term != nil {
if *this.Term != *that1.Term {
return fmt14.Errorf("Term this(%v) Not Equal that(%v)", *this.Term, *that1.Term)
}
} else if this.Term != nil {
return fmt14.Errorf("this.Term == nil && that.Term != nil")
} else if that1.Term != nil {
return fmt14.Errorf("Term this(%v) Not Equal that(%v)", this.Term, that1.Term)
}
if this.VoteGranted != nil && that1.VoteGranted != nil {
if *this.VoteGranted != *that1.VoteGranted {
return fmt14.Errorf("VoteGranted this(%v) Not Equal that(%v)", *this.VoteGranted, *that1.VoteGranted)
}
} else if this.VoteGranted != nil {
return fmt14.Errorf("this.VoteGranted == nil && that.VoteGranted != nil")
} else if that1.VoteGranted != nil {
return fmt14.Errorf("VoteGranted this(%v) Not Equal that(%v)", this.VoteGranted, that1.VoteGranted)
}
if !bytes4.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return fmt14.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized)
}
return nil
}
func (this *RequestVoteResponse) Equal(that interface{}) bool {
if that == nil {
if this == nil {
return true
}
return false
}
that1, ok := that.(*RequestVoteResponse)
if !ok {
return false
}
if that1 == nil {
if this == nil {
return true
}
return false
} else if this == nil {
return false
}
if this.Term != nil && that1.Term != nil {
if *this.Term != *that1.Term {
return false
}
} else if this.Term != nil {
return false
} else if that1.Term != nil {
return false
}
if this.VoteGranted != nil && that1.VoteGranted != nil {
if *this.VoteGranted != *that1.VoteGranted {
return false
}
} else if this.VoteGranted != nil {
return false
} else if that1.VoteGranted != nil {
return false
}
if !bytes4.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}