forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 3
/
rpc.pb.go
3062 lines (2926 loc) · 66.6 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 proto "github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
// discarding unused import gogoproto "github.com/coreos/etcd/Godeps/_workspace/src/gogoproto"
import storagepb "github.com/coreos/etcd/storage/storagepb"
import (
context "github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
grpc "github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc"
)
import io "io"
import fmt "fmt"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
type Compare_CompareResult int32
const (
Compare_EQUAL Compare_CompareResult = 0
Compare_GREATER Compare_CompareResult = 1
Compare_LESS Compare_CompareResult = 2
)
var Compare_CompareResult_name = map[int32]string{
0: "EQUAL",
1: "GREATER",
2: "LESS",
}
var Compare_CompareResult_value = map[string]int32{
"EQUAL": 0,
"GREATER": 1,
"LESS": 2,
}
func (x Compare_CompareResult) String() string {
return proto.EnumName(Compare_CompareResult_name, int32(x))
}
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))
}
type ResponseHeader struct {
// an error type message?
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
ClusterId uint64 `protobuf:"varint,2,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"`
MemberId uint64 `protobuf:"varint,3,opt,name=member_id,proto3" json:"member_id,omitempty"`
// revision of the store when the request was applied.
Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
// term of raft when the request was applied.
RaftTerm uint64 `protobuf:"varint,5,opt,name=raft_term,proto3" json:"raft_term,omitempty"`
}
func (m *ResponseHeader) Reset() { *m = ResponseHeader{} }
func (m *ResponseHeader) String() string { return proto.CompactTextString(m) }
func (*ResponseHeader) ProtoMessage() {}
type RangeRequest struct {
// if the range_end is not given, the request returns the key.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// if the range_end is given, it gets the keys in range [key, range_end).
RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
// limit the number of keys returned.
Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
// range over the store at the given revision.
// if revision is less or equal to zero, range over the newest store.
// if the revision has been compacted, ErrCompaction will be returned in
// response.
Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"`
}
func (m *RangeRequest) Reset() { *m = RangeRequest{} }
func (m *RangeRequest) String() string { return proto.CompactTextString(m) }
func (*RangeRequest) ProtoMessage() {}
type RangeResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
Kvs []*storagepb.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"`
}
func (m *RangeResponse) Reset() { *m = RangeResponse{} }
func (m *RangeResponse) String() string { return proto.CompactTextString(m) }
func (*RangeResponse) ProtoMessage() {}
func (m *RangeResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
func (m *RangeResponse) GetKvs() []*storagepb.KeyValue {
if m != nil {
return m.Kvs
}
return nil
}
type PutRequest struct {
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *PutRequest) Reset() { *m = PutRequest{} }
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
func (*PutRequest) ProtoMessage() {}
type PutResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
}
func (m *PutResponse) Reset() { *m = PutResponse{} }
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
func (*PutResponse) ProtoMessage() {}
func (m *PutResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
type DeleteRangeRequest struct {
// if the range_end is not given, the request deletes the key.
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// if the range_end is given, it deletes the keys in range [key, range_end).
RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
}
func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} }
func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRangeRequest) ProtoMessage() {}
type DeleteRangeResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
}
func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} }
func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteRangeResponse) ProtoMessage() {}
func (m *DeleteRangeResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
type RequestUnion struct {
RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range" json:"request_range,omitempty"`
RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put" json:"request_put,omitempty"`
RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range" json:"request_delete_range,omitempty"`
}
func (m *RequestUnion) Reset() { *m = RequestUnion{} }
func (m *RequestUnion) String() string { return proto.CompactTextString(m) }
func (*RequestUnion) ProtoMessage() {}
func (m *RequestUnion) GetRequestRange() *RangeRequest {
if m != nil {
return m.RequestRange
}
return nil
}
func (m *RequestUnion) GetRequestPut() *PutRequest {
if m != nil {
return m.RequestPut
}
return nil
}
func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest {
if m != nil {
return m.RequestDeleteRange
}
return nil
}
type ResponseUnion struct {
ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range" json:"response_range,omitempty"`
ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put" json:"response_put,omitempty"`
ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range" json:"response_delete_range,omitempty"`
}
func (m *ResponseUnion) Reset() { *m = ResponseUnion{} }
func (m *ResponseUnion) String() string { return proto.CompactTextString(m) }
func (*ResponseUnion) ProtoMessage() {}
func (m *ResponseUnion) GetResponseRange() *RangeResponse {
if m != nil {
return m.ResponseRange
}
return nil
}
func (m *ResponseUnion) GetResponsePut() *PutResponse {
if m != nil {
return m.ResponsePut
}
return nil
}
func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse {
if m != nil {
return m.ResponseDeleteRange
}
return nil
}
type Compare struct {
Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"`
Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"`
// key path
Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
// version of the given key
Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
// create revision of the given key
CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,proto3" json:"create_revision,omitempty"`
// last modified revision of the given key
ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,proto3" json:"mod_revision,omitempty"`
// value of the given key
Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"`
}
func (m *Compare) Reset() { *m = Compare{} }
func (m *Compare) String() string { return proto.CompactTextString(m) }
func (*Compare) ProtoMessage() {}
// 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 []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"`
Success []*RequestUnion `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"`
Failure []*RequestUnion `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 (m *TxnRequest) GetCompare() []*Compare {
if m != nil {
return m.Compare
}
return nil
}
func (m *TxnRequest) GetSuccess() []*RequestUnion {
if m != nil {
return m.Success
}
return nil
}
func (m *TxnRequest) GetFailure() []*RequestUnion {
if m != nil {
return m.Failure
}
return nil
}
type TxnResponse struct {
Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
Responses []*ResponseUnion `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 (m *TxnResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
func (m *TxnResponse) GetResponses() []*ResponseUnion {
if m != nil {
return m.Responses
}
return nil
}
// Compaction compacts the kv store upto the given revision (including).
// It removes the old versions of a key. It keeps the newest version of
// the key even if its latest modification revision is smaller than the given
// revision.
type CompactionRequest struct {
Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
}
func (m *CompactionRequest) Reset() { *m = CompactionRequest{} }
func (m *CompactionRequest) String() string { return proto.CompactTextString(m) }
func (*CompactionRequest) ProtoMessage() {}
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 (m *CompactionResponse) GetHeader() *ResponseHeader {
if m != nil {
return m.Header
}
return nil
}
func init() {
proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value)
proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// Client API for Etcd service
type EtcdClient interface {
// Range gets the keys in the range from the store.
Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error)
// Put puts the given key into the store.
// A put request increases the revision of the store,
// and generates one event in the event history.
Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
// Delete deletes the given range from the store.
// A delete request increase the revision of the store,
// and generates one event in the event history.
DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error)
// Txn processes all the requests in one transaction.
// A txn request increases the revision of the store,
// and generates events with the same revision in the event history.
Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error)
// Compact compacts the event history in etcd. User should compact the
// event history periodically, or it will grow infinitely.
Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error)
}
type etcdClient struct {
cc *grpc.ClientConn
}
func NewEtcdClient(cc *grpc.ClientConn) EtcdClient {
return &etcdClient{cc}
}
func (c *etcdClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) {
out := new(RangeResponse)
err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Range", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *etcdClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) {
out := new(PutResponse)
err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Put", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *etcdClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) {
out := new(DeleteRangeResponse)
err := grpc.Invoke(ctx, "/etcdserverpb.etcd/DeleteRange", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *etcdClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) {
out := new(TxnResponse)
err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Txn", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *etcdClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) {
out := new(CompactionResponse)
err := grpc.Invoke(ctx, "/etcdserverpb.etcd/Compact", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Etcd service
type EtcdServer interface {
// Range gets the keys in the range from the store.
Range(context.Context, *RangeRequest) (*RangeResponse, error)
// Put puts the given key into the store.
// A put request increases the revision of the store,
// and generates one event in the event history.
Put(context.Context, *PutRequest) (*PutResponse, error)
// Delete deletes the given range from the store.
// A delete request increase the revision of the store,
// and generates one event in the event history.
DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error)
// Txn processes all the requests in one transaction.
// A txn request increases the revision of the store,
// and generates events with the same revision in the event history.
Txn(context.Context, *TxnRequest) (*TxnResponse, error)
// Compact compacts the event history in etcd. User should compact the
// event history periodically, or it will grow infinitely.
Compact(context.Context, *CompactionRequest) (*CompactionResponse, error)
}
func RegisterEtcdServer(s *grpc.Server, srv EtcdServer) {
s.RegisterService(&_Etcd_serviceDesc, srv)
}
func _Etcd_Range_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
in := new(RangeRequest)
if err := codec.Unmarshal(buf, in); err != nil {
return nil, err
}
out, err := srv.(EtcdServer).Range(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Etcd_Put_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
in := new(PutRequest)
if err := codec.Unmarshal(buf, in); err != nil {
return nil, err
}
out, err := srv.(EtcdServer).Put(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Etcd_DeleteRange_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
in := new(DeleteRangeRequest)
if err := codec.Unmarshal(buf, in); err != nil {
return nil, err
}
out, err := srv.(EtcdServer).DeleteRange(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Etcd_Txn_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
in := new(TxnRequest)
if err := codec.Unmarshal(buf, in); err != nil {
return nil, err
}
out, err := srv.(EtcdServer).Txn(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Etcd_Compact_Handler(srv interface{}, ctx context.Context, codec grpc.Codec, buf []byte) (interface{}, error) {
in := new(CompactionRequest)
if err := codec.Unmarshal(buf, in); err != nil {
return nil, err
}
out, err := srv.(EtcdServer).Compact(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
var _Etcd_serviceDesc = grpc.ServiceDesc{
ServiceName: "etcdserverpb.etcd",
HandlerType: (*EtcdServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Range",
Handler: _Etcd_Range_Handler,
},
{
MethodName: "Put",
Handler: _Etcd_Put_Handler,
},
{
MethodName: "DeleteRange",
Handler: _Etcd_DeleteRange_Handler,
},
{
MethodName: "Txn",
Handler: _Etcd_Txn_Handler,
},
{
MethodName: "Compact",
Handler: _Etcd_Compact_Handler,
},
},
Streams: []grpc.StreamDesc{},
}
func (m *ResponseHeader) 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 *ResponseHeader) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Error) > 0 {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(len(m.Error)))
i += copy(data[i:], m.Error)
}
if m.ClusterId != 0 {
data[i] = 0x10
i++
i = encodeVarintRpc(data, i, uint64(m.ClusterId))
}
if m.MemberId != 0 {
data[i] = 0x18
i++
i = encodeVarintRpc(data, i, uint64(m.MemberId))
}
if m.Revision != 0 {
data[i] = 0x20
i++
i = encodeVarintRpc(data, i, uint64(m.Revision))
}
if m.RaftTerm != 0 {
data[i] = 0x28
i++
i = encodeVarintRpc(data, i, uint64(m.RaftTerm))
}
return i, nil
}
func (m *RangeRequest) 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 *RangeRequest) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Key != nil {
if len(m.Key) > 0 {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(len(m.Key)))
i += copy(data[i:], m.Key)
}
}
if m.RangeEnd != nil {
if len(m.RangeEnd) > 0 {
data[i] = 0x12
i++
i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
i += copy(data[i:], m.RangeEnd)
}
}
if m.Limit != 0 {
data[i] = 0x18
i++
i = encodeVarintRpc(data, i, uint64(m.Limit))
}
if m.Revision != 0 {
data[i] = 0x20
i++
i = encodeVarintRpc(data, i, uint64(m.Revision))
}
return i, nil
}
func (m *RangeResponse) 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 *RangeResponse) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Header != nil {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
n1, err := m.Header.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n1
}
if len(m.Kvs) > 0 {
for _, msg := range m.Kvs {
data[i] = 0x12
i++
i = encodeVarintRpc(data, i, uint64(msg.Size()))
n, err := msg.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n
}
}
if m.More {
data[i] = 0x18
i++
if m.More {
data[i] = 1
} else {
data[i] = 0
}
i++
}
return i, nil
}
func (m *PutRequest) 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 *PutRequest) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Key != nil {
if len(m.Key) > 0 {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(len(m.Key)))
i += copy(data[i:], m.Key)
}
}
if m.Value != nil {
if len(m.Value) > 0 {
data[i] = 0x12
i++
i = encodeVarintRpc(data, i, uint64(len(m.Value)))
i += copy(data[i:], m.Value)
}
}
return i, nil
}
func (m *PutResponse) 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 *PutResponse) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Header != nil {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
n2, err := m.Header.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n2
}
return i, nil
}
func (m *DeleteRangeRequest) 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 *DeleteRangeRequest) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Key != nil {
if len(m.Key) > 0 {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(len(m.Key)))
i += copy(data[i:], m.Key)
}
}
if m.RangeEnd != nil {
if len(m.RangeEnd) > 0 {
data[i] = 0x12
i++
i = encodeVarintRpc(data, i, uint64(len(m.RangeEnd)))
i += copy(data[i:], m.RangeEnd)
}
}
return i, nil
}
func (m *DeleteRangeResponse) 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 *DeleteRangeResponse) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Header != nil {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(m.Header.Size()))
n3, err := m.Header.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n3
}
return i, nil
}
func (m *RequestUnion) 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 *RequestUnion) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.RequestRange != nil {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(m.RequestRange.Size()))
n4, err := m.RequestRange.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n4
}
if m.RequestPut != nil {
data[i] = 0x12
i++
i = encodeVarintRpc(data, i, uint64(m.RequestPut.Size()))
n5, err := m.RequestPut.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n5
}
if m.RequestDeleteRange != nil {
data[i] = 0x1a
i++
i = encodeVarintRpc(data, i, uint64(m.RequestDeleteRange.Size()))
n6, err := m.RequestDeleteRange.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n6
}
return i, nil
}
func (m *ResponseUnion) 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 *ResponseUnion) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.ResponseRange != nil {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(m.ResponseRange.Size()))
n7, err := m.ResponseRange.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n7
}
if m.ResponsePut != nil {
data[i] = 0x12
i++
i = encodeVarintRpc(data, i, uint64(m.ResponsePut.Size()))
n8, err := m.ResponsePut.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n8
}
if m.ResponseDeleteRange != nil {
data[i] = 0x1a
i++
i = encodeVarintRpc(data, i, uint64(m.ResponseDeleteRange.Size()))
n9, err := m.ResponseDeleteRange.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n9
}
return i, nil
}
func (m *Compare) 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 *Compare) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if m.Result != 0 {
data[i] = 0x8
i++
i = encodeVarintRpc(data, i, uint64(m.Result))
}
if m.Target != 0 {
data[i] = 0x10
i++
i = encodeVarintRpc(data, i, uint64(m.Target))
}
if m.Key != nil {
if len(m.Key) > 0 {
data[i] = 0x1a
i++
i = encodeVarintRpc(data, i, uint64(len(m.Key)))
i += copy(data[i:], m.Key)
}
}
if m.Version != 0 {
data[i] = 0x20
i++
i = encodeVarintRpc(data, i, uint64(m.Version))
}
if m.CreateRevision != 0 {
data[i] = 0x28
i++
i = encodeVarintRpc(data, i, uint64(m.CreateRevision))
}
if m.ModRevision != 0 {
data[i] = 0x30
i++
i = encodeVarintRpc(data, i, uint64(m.ModRevision))
}
if m.Value != nil {
if len(m.Value) > 0 {
data[i] = 0x3a
i++
i = encodeVarintRpc(data, i, uint64(len(m.Value)))
i += copy(data[i:], m.Value)
}
}
return i, nil
}
func (m *TxnRequest) 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 *TxnRequest) MarshalTo(data []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Compare) > 0 {
for _, msg := range m.Compare {
data[i] = 0xa
i++
i = encodeVarintRpc(data, i, uint64(msg.Size()))
n, err := msg.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n
}
}
if len(m.Success) > 0 {