forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpc.pb.go
16507 lines (15759 loc) · 410 KB
/
rpc.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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-gogo.
// source: rpc.proto
// DO NOT EDIT!
package etcdserverpb
import (
"fmt"
proto "github.com/golang/protobuf/proto"
math "math"
mvccpb "github.com/coreos/etcd/mvcc/mvccpb"
authpb "github.com/coreos/etcd/auth/authpb"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
io "io"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type AlarmType int32
const (
AlarmType_NONE AlarmType = 0
AlarmType_NOSPACE AlarmType = 1
)
var AlarmType_name = map[int32]string{
0: "NONE",
1: "NOSPACE",
}
var AlarmType_value = map[string]int32{
"NONE": 0,
"NOSPACE": 1,
}
func (x AlarmType) String() string {
return proto.EnumName(AlarmType_name, int32(x))
}
func (AlarmType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} }
type RangeRequest_SortOrder int32
const (
RangeRequest_NONE RangeRequest_SortOrder = 0
RangeRequest_ASCEND RangeRequest_SortOrder = 1
RangeRequest_DESCEND RangeRequest_SortOrder = 2
)
var RangeRequest_SortOrder_name = map[int32]string{
0: "NONE",
1: "ASCEND",
2: "DESCEND",
}
var RangeRequest_SortOrder_value = map[string]int32{
"NONE": 0,
"ASCEND": 1,
"DESCEND": 2,
}
func (x RangeRequest_SortOrder) String() string {
return proto.EnumName(RangeRequest_SortOrder_name, int32(x))
}
func (RangeRequest_SortOrder) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1, 0} }
type RangeRequest_SortTarget int32
const (
RangeRequest_KEY RangeRequest_SortTarget = 0
RangeRequest_VERSION RangeRequest_SortTarget = 1
RangeRequest_CREATE RangeRequest_SortTarget = 2
RangeRequest_MOD RangeRequest_SortTarget = 3
RangeRequest_VALUE RangeRequest_SortTarget = 4
)
var RangeRequest_SortTarget_name = map[int32]string{
0: "KEY",
1: "VERSION",
2: "CREATE",
3: "MOD",
4: "VALUE",
}
var RangeRequest_SortTarget_value = map[string]int32{
"KEY": 0,
"VERSION": 1,
"CREATE": 2,
"MOD": 3,
"VALUE": 4,
}
func (x RangeRequest_SortTarget) String() string {
return proto.EnumName(RangeRequest_SortTarget_name, int32(x))
}
func (RangeRequest_SortTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1, 1} }
type Compare_CompareResult int32
const (
Compare_EQUAL Compare_CompareResult = 0
Compare_GREATER Compare_CompareResult = 1
Compare_LESS Compare_CompareResult = 2
Compare_NOT_EQUAL Compare_CompareResult = 3
)
var Compare_CompareResult_name = map[int32]string{
0: "EQUAL",
1: "GREATER",
2: "LESS",
3: "NOT_EQUAL",
}
var Compare_CompareResult_value = map[string]int32{
"EQUAL": 0,
"GREATER": 1,
"LESS": 2,
"NOT_EQUAL": 3,
}
func (x Compare_CompareResult) String() string {
return proto.EnumName(Compare_CompareResult_name, int32(x))
}
func (Compare_CompareResult) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 0} }
type Compare_CompareTarget int32
const (
Compare_VERSION Compare_CompareTarget = 0
Compare_CREATE Compare_CompareTarget = 1
Compare_MOD Compare_CompareTarget = 2
Compare_VALUE Compare_CompareTarget = 3
)
var Compare_CompareTarget_name = map[int32]string{
0: "VERSION",
1: "CREATE",
2: "MOD",
3: "VALUE",
}
var Compare_CompareTarget_value = map[string]int32{
"VERSION": 0,
"CREATE": 1,
"MOD": 2,
"VALUE": 3,
}
func (x Compare_CompareTarget) String() string {
return proto.EnumName(Compare_CompareTarget_name, int32(x))
}
func (Compare_CompareTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 1} }
type WatchCreateRequest_FilterType int32
const (
// filter out put event.
WatchCreateRequest_NOPUT WatchCreateRequest_FilterType = 0
// filter out delete event.
WatchCreateRequest_NODELETE WatchCreateRequest_FilterType = 1
)
var WatchCreateRequest_FilterType_name = map[int32]string{
0: "NOPUT",
1: "NODELETE",
}
var WatchCreateRequest_FilterType_value = map[string]int32{
"NOPUT": 0,
"NODELETE": 1,
}
func (x WatchCreateRequest_FilterType) String() string {
return proto.EnumName(WatchCreateRequest_FilterType_name, int32(x))
}
func (WatchCreateRequest_FilterType) EnumDescriptor() ([]byte, []int) {
return fileDescriptorRpc, []int{19, 0}
}
type AlarmRequest_AlarmAction int32
const (
AlarmRequest_GET AlarmRequest_AlarmAction = 0
AlarmRequest_ACTIVATE AlarmRequest_AlarmAction = 1
AlarmRequest_DEACTIVATE AlarmRequest_AlarmAction = 2
)
var AlarmRequest_AlarmAction_name = map[int32]string{
0: "GET",
1: "ACTIVATE",
2: "DEACTIVATE",
}
var AlarmRequest_AlarmAction_value = map[string]int32{
"GET": 0,
"ACTIVATE": 1,
"DEACTIVATE": 2,
}
func (x AlarmRequest_AlarmAction) String() string {
return proto.EnumName(AlarmRequest_AlarmAction_name, int32(x))
}
func (AlarmRequest_AlarmAction) EnumDescriptor() ([]byte, []int) {
return fileDescriptorRpc, []int{41, 0}
}
type ResponseHeader struct {
// cluster_id is the ID of the cluster which sent the response.
ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
// member_id is the ID of the member which sent the response.
MemberId uint64 `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"`
// revision is the key-value store revision when the request was applied.
Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
// raft_term is the raft term when the request was applied.
RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"`
}
func (m *ResponseHeader) Reset() { *m = ResponseHeader{} }
func (m *ResponseHeader) String() string { return proto.CompactTextString(m) }
func (*ResponseHeader) ProtoMessage() {}
func (*ResponseHeader) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} }
type RangeRequest struct {
// key is the first key for the range. If range_end is not given, the request only looks up key.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// range_end is the upper bound on the requested range [key, range_end).
// If range_end is '\0', the range is all keys >= key.
// If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"),
// then the range request gets all keys prefixed with key.
// If both key and range_end are '\0', then the range request returns all keys.
RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
// limit is a limit on the number of keys returned for the request. When limit is set to 0,
// it is treated as no limit.
Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
// revision is the point-in-time of the key-value store to use for the range.
// If revision is less or equal to zero, the range is over the newest key-value store.
// If the revision has been compacted, ErrCompacted is returned as a response.
Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
// sort_order is the order for returned sorted results.
SortOrder RangeRequest_SortOrder `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3,enum=etcdserverpb.RangeRequest_SortOrder" json:"sort_order,omitempty"`
// sort_target is the key-value field to use for sorting.
SortTarget RangeRequest_SortTarget `protobuf:"varint,6,opt,name=sort_target,json=sortTarget,proto3,enum=etcdserverpb.RangeRequest_SortTarget" json:"sort_target,omitempty"`
// serializable sets the range request to use serializable member-local reads.
// Range requests are linearizable by default; linearizable requests have higher
// latency and lower throughput than serializable requests but reflect the current
// consensus of the cluster. For better performance, in exchange for possible stale reads,
// a serializable range request is served locally without needing to reach consensus
// with other nodes in the cluster.
Serializable bool `protobuf:"varint,7,opt,name=serializable,proto3" json:"serializable,omitempty"`
// keys_only when set returns only the keys and not the values.
KeysOnly bool `protobuf:"varint,8,opt,name=keys_only,json=keysOnly,proto3" json:"keys_only,omitempty"`
// count_only when set returns only the count of the keys in the range.
CountOnly bool `protobuf:"varint,9,opt,name=count_only,json=countOnly,proto3" json:"count_only,omitempty"`
// min_mod_revision is the lower bound for returned key mod revisions; all keys with
// lesser mod revisions will be filtered away.
MinModRevision int64 `protobuf:"varint,10,opt,name=min_mod_revision,json=minModRevision,proto3" json:"min_mod_revision,omitempty"`
// max_mod_revision is the upper bound for returned key mod revisions; all keys with
// greater mod revisions will be filtered away.
MaxModRevision int64 `protobuf:"varint,11,opt,name=max_mod_revision,json=maxModRevision,proto3" json:"max_mod_revision,omitempty"`
// min_create_revision is the lower bound for returned key create revisions; all keys with
// lesser create trevisions will be filtered away.
MinCreateRevision int64 `protobuf:"varint,12,opt,name=min_create_revision,json=minCreateRevision,proto3" json:"min_create_revision,omitempty"`
// max_create_revision is the upper bound for returned key create revisions; all keys with
// greater create revisions will be filtered away.
MaxCreateRevision int64 `protobuf:"varint,13,opt,name=max_create_revision,json=maxCreateRevision,proto3" json:"max_create_revision,omitempty"`
}
func (m *RangeRequest) Reset() { *m = RangeRequest{} }
func (m *RangeRequest) String() string { return proto.CompactTextString(m) }
func (*RangeRequest) ProtoMessage() {}
func (*RangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1} }
type RangeResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
// kvs is the list of key-value pairs matched by the range request.
// kvs is empty when count is requested.
Kvs []*mvccpb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"`
// more indicates if there are more keys to return in the requested range.
More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"`
// count is set to the number of keys within the range when requested.
Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`
}
func (m *RangeResponse) Reset() { *m = RangeResponse{} }
func (m *RangeResponse) String() string { return proto.CompactTextString(m) }
func (*RangeResponse) ProtoMessage() {}
func (*RangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{2} }
func (m *RangeResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
func (m *RangeResponse) GetKvs() []*mvccpb.KeyValue {
if m != nil {
return m.Kvs
}
return nil
}
type PutRequest struct {
// key is the key, in bytes, to put into the key-value store.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// value is the value, in bytes, to associate with the key in the key-value store.
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// lease is the lease ID to associate with the key in the key-value store. A lease
// value of 0 indicates no lease.
Lease int64 `protobuf:"varint,3,opt,name=lease,proto3" json:"lease,omitempty"`
// If prev_kv is set, etcd gets the previous key-value pair before changing it.
// The previous key-value pair will be returned in the put response.
PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"`
// If ignore_value is set, etcd updates the key using its current value.
// Returns an error if the key does not exist.
IgnoreValue bool `protobuf:"varint,5,opt,name=ignore_value,json=ignoreValue,proto3" json:"ignore_value,omitempty"`
// If ignore_lease is set, etcd updates the key using its current lease.
// Returns an error if the key does not exist.
IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,json=ignoreLease,proto3" json:"ignore_lease,omitempty"`
}
func (m *PutRequest) Reset() { *m = PutRequest{} }
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
func (*PutRequest) ProtoMessage() {}
func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{3} }
type PutResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
// if prev_kv is set in the request, the previous key-value pair will be returned.
PrevKv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv" json:"prev_kv,omitempty"`
}
func (m *PutResponse) Reset() { *m = PutResponse{} }
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
func (*PutResponse) ProtoMessage() {}
func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{4} }
func (m *PutResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
func (m *PutResponse) GetPrevKv() *mvccpb.KeyValue {
if m != nil {
return m.PrevKv
}
return nil
}
type DeleteRangeRequest struct {
// key is the first key to delete in the range.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// range_end is the key following the last key to delete for the range [key, range_end).
// If range_end is not given, the range is defined to contain only the key argument.
// If range_end is one bit larger than the given key, then the range is all the keys
// with the prefix (the given key).
// If range_end is '\0', the range is all keys greater than or equal to the key argument.
RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"`
// If prev_kv is set, etcd gets the previous key-value pairs before deleting it.
// The previous key-value pairs will be returned in the delete response.
PrevKv bool `protobuf:"varint,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"`
}
func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} }
func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRangeRequest) ProtoMessage() {}
func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{5} }
type DeleteRangeResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
// deleted is the number of keys deleted by the delete range request.
Deleted int64 `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"`
// if prev_kv is set in the request, the previous key-value pairs will be returned.
PrevKvs []*mvccpb.KeyValue `protobuf:"bytes,3,rep,name=prev_kvs,json=prevKvs" json:"prev_kvs,omitempty"`
}
func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} }
func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteRangeResponse) ProtoMessage() {}
func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{6} }
func (m *DeleteRangeResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
func (m *DeleteRangeResponse) GetPrevKvs() []*mvccpb.KeyValue {
if m != nil {
return m.PrevKvs
}
return nil
}
type RequestOp struct {
// request is a union of request types accepted by a transaction.
//
// Types that are valid to be assigned to Request:
// *RequestOp_RequestRange
// *RequestOp_RequestPut
// *RequestOp_RequestDeleteRange
Request isRequestOp_Request `protobuf_oneof:"request"`
}
func (m *RequestOp) Reset() { *m = RequestOp{} }
func (m *RequestOp) String() string { return proto.CompactTextString(m) }
func (*RequestOp) ProtoMessage() {}
func (*RequestOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{7} }
type isRequestOp_Request interface {
isRequestOp_Request()
MarshalTo([]byte) (int, error)
Size() int
}
type RequestOp_RequestRange struct {
RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,json=requestRange,oneof"`
}
type RequestOp_RequestPut struct {
RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,json=requestPut,oneof"`
}
type RequestOp_RequestDeleteRange struct {
RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,json=requestDeleteRange,oneof"`
}
func (*RequestOp_RequestRange) isRequestOp_Request() {}
func (*RequestOp_RequestPut) isRequestOp_Request() {}
func (*RequestOp_RequestDeleteRange) isRequestOp_Request() {}
func (m *RequestOp) GetRequest() isRequestOp_Request {
if m != nil {
return m.Request
}
return nil
}
func (m *RequestOp) GetRequestRange() *RangeRequest {
if x, ok := m.GetRequest().(*RequestOp_RequestRange); ok {
return x.RequestRange
}
return nil
}
func (m *RequestOp) GetRequestPut() *PutRequest {
if x, ok := m.GetRequest().(*RequestOp_RequestPut); ok {
return x.RequestPut
}
return nil
}
func (m *RequestOp) GetRequestDeleteRange() *DeleteRangeRequest {
if x, ok := m.GetRequest().(*RequestOp_RequestDeleteRange); ok {
return x.RequestDeleteRange
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*RequestOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _RequestOp_OneofMarshaler, _RequestOp_OneofUnmarshaler, _RequestOp_OneofSizer, []interface{}{
(*RequestOp_RequestRange)(nil),
(*RequestOp_RequestPut)(nil),
(*RequestOp_RequestDeleteRange)(nil),
}
}
func _RequestOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*RequestOp)
// request
switch x := m.Request.(type) {
case *RequestOp_RequestRange:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.RequestRange); err != nil {
return err
}
case *RequestOp_RequestPut:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.RequestPut); err != nil {
return err
}
case *RequestOp_RequestDeleteRange:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.RequestDeleteRange); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("RequestOp.Request has unexpected type %T", x)
}
return nil
}
func _RequestOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*RequestOp)
switch tag {
case 1: // request.request_range
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(RangeRequest)
err := b.DecodeMessage(msg)
m.Request = &RequestOp_RequestRange{msg}
return true, err
case 2: // request.request_put
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PutRequest)
err := b.DecodeMessage(msg)
m.Request = &RequestOp_RequestPut{msg}
return true, err
case 3: // request.request_delete_range
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(DeleteRangeRequest)
err := b.DecodeMessage(msg)
m.Request = &RequestOp_RequestDeleteRange{msg}
return true, err
default:
return false, nil
}
}
func _RequestOp_OneofSizer(msg proto.Message) (n int) {
m := msg.(*RequestOp)
// request
switch x := m.Request.(type) {
case *RequestOp_RequestRange:
s := proto.Size(x.RequestRange)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *RequestOp_RequestPut:
s := proto.Size(x.RequestPut)
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *RequestOp_RequestDeleteRange:
s := proto.Size(x.RequestDeleteRange)
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type ResponseOp struct {
// response is a union of response types returned by a transaction.
//
// Types that are valid to be assigned to Response:
// *ResponseOp_ResponseRange
// *ResponseOp_ResponsePut
// *ResponseOp_ResponseDeleteRange
Response isResponseOp_Response `protobuf_oneof:"response"`
}
func (m *ResponseOp) Reset() { *m = ResponseOp{} }
func (m *ResponseOp) String() string { return proto.CompactTextString(m) }
func (*ResponseOp) ProtoMessage() {}
func (*ResponseOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{8} }
type isResponseOp_Response interface {
isResponseOp_Response()
MarshalTo([]byte) (int, error)
Size() int
}
type ResponseOp_ResponseRange struct {
ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,json=responseRange,oneof"`
}
type ResponseOp_ResponsePut struct {
ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,json=responsePut,oneof"`
}
type ResponseOp_ResponseDeleteRange struct {
ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,json=responseDeleteRange,oneof"`
}
func (*ResponseOp_ResponseRange) isResponseOp_Response() {}
func (*ResponseOp_ResponsePut) isResponseOp_Response() {}
func (*ResponseOp_ResponseDeleteRange) isResponseOp_Response() {}
func (m *ResponseOp) GetResponse() isResponseOp_Response {
if m != nil {
return m.Response
}
return nil
}
func (m *ResponseOp) GetResponseRange() *RangeResponse {
if x, ok := m.GetResponse().(*ResponseOp_ResponseRange); ok {
return x.ResponseRange
}
return nil
}
func (m *ResponseOp) GetResponsePut() *PutResponse {
if x, ok := m.GetResponse().(*ResponseOp_ResponsePut); ok {
return x.ResponsePut
}
return nil
}
func (m *ResponseOp) GetResponseDeleteRange() *DeleteRangeResponse {
if x, ok := m.GetResponse().(*ResponseOp_ResponseDeleteRange); ok {
return x.ResponseDeleteRange
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*ResponseOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _ResponseOp_OneofMarshaler, _ResponseOp_OneofUnmarshaler, _ResponseOp_OneofSizer, []interface{}{
(*ResponseOp_ResponseRange)(nil),
(*ResponseOp_ResponsePut)(nil),
(*ResponseOp_ResponseDeleteRange)(nil),
}
}
func _ResponseOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*ResponseOp)
// response
switch x := m.Response.(type) {
case *ResponseOp_ResponseRange:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ResponseRange); err != nil {
return err
}
case *ResponseOp_ResponsePut:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ResponsePut); err != nil {
return err
}
case *ResponseOp_ResponseDeleteRange:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ResponseDeleteRange); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("ResponseOp.Response has unexpected type %T", x)
}
return nil
}
func _ResponseOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*ResponseOp)
switch tag {
case 1: // response.response_range
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(RangeResponse)
err := b.DecodeMessage(msg)
m.Response = &ResponseOp_ResponseRange{msg}
return true, err
case 2: // response.response_put
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(PutResponse)
err := b.DecodeMessage(msg)
m.Response = &ResponseOp_ResponsePut{msg}
return true, err
case 3: // response.response_delete_range
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(DeleteRangeResponse)
err := b.DecodeMessage(msg)
m.Response = &ResponseOp_ResponseDeleteRange{msg}
return true, err
default:
return false, nil
}
}
func _ResponseOp_OneofSizer(msg proto.Message) (n int) {
m := msg.(*ResponseOp)
// response
switch x := m.Response.(type) {
case *ResponseOp_ResponseRange:
s := proto.Size(x.ResponseRange)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *ResponseOp_ResponsePut:
s := proto.Size(x.ResponsePut)
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *ResponseOp_ResponseDeleteRange:
s := proto.Size(x.ResponseDeleteRange)
n += proto.SizeVarint(3<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type Compare struct {
// result is logical comparison operation for this comparison.
Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"`
// target is the key-value field to inspect for the comparison.
Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"`
// key is the subject key for the comparison operation.
Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
// Types that are valid to be assigned to TargetUnion:
// *Compare_Version
// *Compare_CreateRevision
// *Compare_ModRevision
// *Compare_Value
TargetUnion isCompare_TargetUnion `protobuf_oneof:"target_union"`
}
func (m *Compare) Reset() { *m = Compare{} }
func (m *Compare) String() string { return proto.CompactTextString(m) }
func (*Compare) ProtoMessage() {}
func (*Compare) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9} }
type isCompare_TargetUnion interface {
isCompare_TargetUnion()
MarshalTo([]byte) (int, error)
Size() int
}
type Compare_Version struct {
Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof"`
}
type Compare_CreateRevision struct {
CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,json=createRevision,proto3,oneof"`
}
type Compare_ModRevision struct {
ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,json=modRevision,proto3,oneof"`
}
type Compare_Value struct {
Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof"`
}
func (*Compare_Version) isCompare_TargetUnion() {}
func (*Compare_CreateRevision) isCompare_TargetUnion() {}
func (*Compare_ModRevision) isCompare_TargetUnion() {}
func (*Compare_Value) isCompare_TargetUnion() {}
func (m *Compare) GetTargetUnion() isCompare_TargetUnion {
if m != nil {
return m.TargetUnion
}
return nil
}
func (m *Compare) GetVersion() int64 {
if x, ok := m.GetTargetUnion().(*Compare_Version); ok {
return x.Version
}
return 0
}
func (m *Compare) GetCreateRevision() int64 {
if x, ok := m.GetTargetUnion().(*Compare_CreateRevision); ok {
return x.CreateRevision
}
return 0
}
func (m *Compare) GetModRevision() int64 {
if x, ok := m.GetTargetUnion().(*Compare_ModRevision); ok {
return x.ModRevision
}
return 0
}
func (m *Compare) GetValue() []byte {
if x, ok := m.GetTargetUnion().(*Compare_Value); ok {
return x.Value
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Compare) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Compare_OneofMarshaler, _Compare_OneofUnmarshaler, _Compare_OneofSizer, []interface{}{
(*Compare_Version)(nil),
(*Compare_CreateRevision)(nil),
(*Compare_ModRevision)(nil),
(*Compare_Value)(nil),
}
}
func _Compare_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Compare)
// target_union
switch x := m.TargetUnion.(type) {
case *Compare_Version:
_ = b.EncodeVarint(4<<3 | proto.WireVarint)
_ = b.EncodeVarint(uint64(x.Version))
case *Compare_CreateRevision:
_ = b.EncodeVarint(5<<3 | proto.WireVarint)
_ = b.EncodeVarint(uint64(x.CreateRevision))
case *Compare_ModRevision:
_ = b.EncodeVarint(6<<3 | proto.WireVarint)
_ = b.EncodeVarint(uint64(x.ModRevision))
case *Compare_Value:
_ = b.EncodeVarint(7<<3 | proto.WireBytes)
_ = b.EncodeRawBytes(x.Value)
case nil:
default:
return fmt.Errorf("Compare.TargetUnion has unexpected type %T", x)
}
return nil
}
func _Compare_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Compare)
switch tag {
case 4: // target_union.version
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.TargetUnion = &Compare_Version{int64(x)}
return true, err
case 5: // target_union.create_revision
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.TargetUnion = &Compare_CreateRevision{int64(x)}
return true, err
case 6: // target_union.mod_revision
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.TargetUnion = &Compare_ModRevision{int64(x)}
return true, err
case 7: // target_union.value
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.TargetUnion = &Compare_Value{x}
return true, err
default:
return false, nil
}
}
func _Compare_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Compare)
// target_union
switch x := m.TargetUnion.(type) {
case *Compare_Version:
n += proto.SizeVarint(4<<3 | proto.WireVarint)
n += proto.SizeVarint(uint64(x.Version))
case *Compare_CreateRevision:
n += proto.SizeVarint(5<<3 | proto.WireVarint)
n += proto.SizeVarint(uint64(x.CreateRevision))
case *Compare_ModRevision:
n += proto.SizeVarint(6<<3 | proto.WireVarint)
n += proto.SizeVarint(uint64(x.ModRevision))
case *Compare_Value:
n += proto.SizeVarint(7<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Value)))
n += len(x.Value)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// From google paxosdb paper:
// Our implementation hinges around a powerful primitive which we call MultiOp. All other database
// operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically
// and consists of three components:
// 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check
// for the absence or presence of a value, or compare with a given value. Two different tests in the guard
// may apply to the same or different entries in the database. All tests in the guard are applied and
// MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise
// it executes f op (see item 3 below).
// 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or
// lookup operation, and applies to a single database entry. Two different operations in the list may apply
// to the same or different entries in the database. These operations are executed
// if guard evaluates to
// true.
// 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
type TxnRequest struct {
// compare is a list of predicates representing a conjunction of terms.
// If the comparisons succeed, then the success requests will be processed in order,
// and the response will contain their respective responses in order.
// If the comparisons fail, then the failure requests will be processed in order,
// and the response will contain their respective responses in order.
Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"`
// success is a list of requests which will be applied when compare evaluates to true.
Success []*RequestOp `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"`
// failure is a list of requests which will be applied when compare evaluates to false.
Failure []*RequestOp `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"`
}
func (m *TxnRequest) Reset() { *m = TxnRequest{} }
func (m *TxnRequest) String() string { return proto.CompactTextString(m) }
func (*TxnRequest) ProtoMessage() {}
func (*TxnRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{10} }
func (m *TxnRequest) GetCompare() []*Compare {
if m != nil {
return m.Compare
}
return nil
}
func (m *TxnRequest) GetSuccess() []*RequestOp {
if m != nil {
return m.Success
}
return nil
}
func (m *TxnRequest) GetFailure() []*RequestOp {
if m != nil {
return m.Failure
}
return nil
}
type TxnResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
// succeeded is set to true if the compare evaluated to true or false otherwise.
Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
// responses is a list of responses corresponding to the results from applying
// success if succeeded is true or failure if succeeded is false.
Responses []*ResponseOp `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"`
}
func (m *TxnResponse) Reset() { *m = TxnResponse{} }
func (m *TxnResponse) String() string { return proto.CompactTextString(m) }
func (*TxnResponse) ProtoMessage() {}
func (*TxnResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{11} }
func (m *TxnResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
func (m *TxnResponse) GetResponses() []*ResponseOp {
if m != nil {
return m.Responses
}
return nil
}
// CompactionRequest compacts the key-value store up to a given revision. All superseded keys
// with a revision less than the compaction revision will be removed.
type CompactionRequest struct {
// revision is the key-value store revision for the compaction operation.
Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
// physical is set so the RPC will wait until the compaction is physically
// applied to the local database such that compacted entries are totally
// removed from the backend database.
Physical bool `protobuf:"varint,2,opt,name=physical,proto3" json:"physical,omitempty"`
}
func (m *CompactionRequest) Reset() { *m = CompactionRequest{} }
func (m *CompactionRequest) String() string { return proto.CompactTextString(m) }
func (*CompactionRequest) ProtoMessage() {}
func (*CompactionRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{12} }
type CompactionResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
}
func (m *CompactionResponse) Reset() { *m = CompactionResponse{} }
func (m *CompactionResponse) String() string { return proto.CompactTextString(m) }
func (*CompactionResponse) ProtoMessage() {}
func (*CompactionResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{13} }
func (m *CompactionResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
type HashRequest struct {
}