-
Notifications
You must be signed in to change notification settings - Fork 42
/
rpc.pb.go
3007 lines (2826 loc) · 73.9 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. DO NOT EDIT.
// source: src/rpc.proto
/*
Package wavelet is a generated protocol buffer package.
It is generated from these files:
src/rpc.proto
It has these top-level messages:
QueryRequest
QueryResponse
OutOfSyncRequest
OutOfSyncResponse
SyncInfo
SyncRequest
SyncResponse
GossipRequest
TransactionsSyncRequest
TransactionsSyncPart
TransactionsSyncResponse
TransactionPullRequest
TransactionPullResponse
*/
package wavelet
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type QueryRequest struct {
BlockIndex uint64 `protobuf:"varint,1,opt,name=block_index,json=blockIndex,proto3" json:"block_index,omitempty"`
CacheBlockId []byte `protobuf:"bytes,2,opt,name=cache_block_id,json=cacheBlockId,proto3" json:"cache_block_id,omitempty"`
}
func (m *QueryRequest) Reset() { *m = QueryRequest{} }
func (m *QueryRequest) String() string { return proto.CompactTextString(m) }
func (*QueryRequest) ProtoMessage() {}
func (*QueryRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} }
func (m *QueryRequest) GetBlockIndex() uint64 {
if m != nil {
return m.BlockIndex
}
return 0
}
func (m *QueryRequest) GetCacheBlockId() []byte {
if m != nil {
return m.CacheBlockId
}
return nil
}
type QueryResponse struct {
Block []byte `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
CacheValid bool `protobuf:"varint,2,opt,name=cache_valid,json=cacheValid,proto3" json:"cache_valid,omitempty"`
}
func (m *QueryResponse) Reset() { *m = QueryResponse{} }
func (m *QueryResponse) String() string { return proto.CompactTextString(m) }
func (*QueryResponse) ProtoMessage() {}
func (*QueryResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1} }
func (m *QueryResponse) GetBlock() []byte {
if m != nil {
return m.Block
}
return nil
}
func (m *QueryResponse) GetCacheValid() bool {
if m != nil {
return m.CacheValid
}
return false
}
type OutOfSyncRequest struct {
BlockIndex uint64 `protobuf:"varint,1,opt,name=block_index,json=blockIndex,proto3" json:"block_index,omitempty"`
}
func (m *OutOfSyncRequest) Reset() { *m = OutOfSyncRequest{} }
func (m *OutOfSyncRequest) String() string { return proto.CompactTextString(m) }
func (*OutOfSyncRequest) ProtoMessage() {}
func (*OutOfSyncRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{2} }
func (m *OutOfSyncRequest) GetBlockIndex() uint64 {
if m != nil {
return m.BlockIndex
}
return 0
}
type OutOfSyncResponse struct {
OutOfSync bool `protobuf:"varint,1,opt,name=out_of_sync,json=outOfSync,proto3" json:"out_of_sync,omitempty"`
}
func (m *OutOfSyncResponse) Reset() { *m = OutOfSyncResponse{} }
func (m *OutOfSyncResponse) String() string { return proto.CompactTextString(m) }
func (*OutOfSyncResponse) ProtoMessage() {}
func (*OutOfSyncResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{3} }
func (m *OutOfSyncResponse) GetOutOfSync() bool {
if m != nil {
return m.OutOfSync
}
return false
}
type SyncInfo struct {
Block []byte `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
Checksums [][]byte `protobuf:"bytes,2,rep,name=checksums" json:"checksums,omitempty"`
}
func (m *SyncInfo) Reset() { *m = SyncInfo{} }
func (m *SyncInfo) String() string { return proto.CompactTextString(m) }
func (*SyncInfo) ProtoMessage() {}
func (*SyncInfo) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{4} }
func (m *SyncInfo) GetBlock() []byte {
if m != nil {
return m.Block
}
return nil
}
func (m *SyncInfo) GetChecksums() [][]byte {
if m != nil {
return m.Checksums
}
return nil
}
type SyncRequest struct {
// Types that are valid to be assigned to Data:
// *SyncRequest_BlockId
// *SyncRequest_Checksum
Data isSyncRequest_Data `protobuf_oneof:"Data"`
}
func (m *SyncRequest) Reset() { *m = SyncRequest{} }
func (m *SyncRequest) String() string { return proto.CompactTextString(m) }
func (*SyncRequest) ProtoMessage() {}
func (*SyncRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{5} }
type isSyncRequest_Data interface {
isSyncRequest_Data()
MarshalTo([]byte) (int, error)
Size() int
}
type SyncRequest_BlockId struct {
BlockId uint64 `protobuf:"varint,1,opt,name=block_id,json=blockId,proto3,oneof"`
}
type SyncRequest_Checksum struct {
Checksum []byte `protobuf:"bytes,2,opt,name=checksum,proto3,oneof"`
}
func (*SyncRequest_BlockId) isSyncRequest_Data() {}
func (*SyncRequest_Checksum) isSyncRequest_Data() {}
func (m *SyncRequest) GetData() isSyncRequest_Data {
if m != nil {
return m.Data
}
return nil
}
func (m *SyncRequest) GetBlockId() uint64 {
if x, ok := m.GetData().(*SyncRequest_BlockId); ok {
return x.BlockId
}
return 0
}
func (m *SyncRequest) GetChecksum() []byte {
if x, ok := m.GetData().(*SyncRequest_Checksum); ok {
return x.Checksum
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*SyncRequest) 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 _SyncRequest_OneofMarshaler, _SyncRequest_OneofUnmarshaler, _SyncRequest_OneofSizer, []interface{}{
(*SyncRequest_BlockId)(nil),
(*SyncRequest_Checksum)(nil),
}
}
func _SyncRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*SyncRequest)
// Data
switch x := m.Data.(type) {
case *SyncRequest_BlockId:
_ = b.EncodeVarint(1<<3 | proto.WireVarint)
_ = b.EncodeVarint(uint64(x.BlockId))
case *SyncRequest_Checksum:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
_ = b.EncodeRawBytes(x.Checksum)
case nil:
default:
return fmt.Errorf("SyncRequest.Data has unexpected type %T", x)
}
return nil
}
func _SyncRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*SyncRequest)
switch tag {
case 1: // Data.block_id
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.Data = &SyncRequest_BlockId{x}
return true, err
case 2: // Data.checksum
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.Data = &SyncRequest_Checksum{x}
return true, err
default:
return false, nil
}
}
func _SyncRequest_OneofSizer(msg proto.Message) (n int) {
m := msg.(*SyncRequest)
// Data
switch x := m.Data.(type) {
case *SyncRequest_BlockId:
n += proto.SizeVarint(1<<3 | proto.WireVarint)
n += proto.SizeVarint(uint64(x.BlockId))
case *SyncRequest_Checksum:
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Checksum)))
n += len(x.Checksum)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type SyncResponse struct {
// Types that are valid to be assigned to Data:
// *SyncResponse_Header
// *SyncResponse_Chunk
Data isSyncResponse_Data `protobuf_oneof:"Data"`
}
func (m *SyncResponse) Reset() { *m = SyncResponse{} }
func (m *SyncResponse) String() string { return proto.CompactTextString(m) }
func (*SyncResponse) ProtoMessage() {}
func (*SyncResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{6} }
type isSyncResponse_Data interface {
isSyncResponse_Data()
MarshalTo([]byte) (int, error)
Size() int
}
type SyncResponse_Header struct {
Header *SyncInfo `protobuf:"bytes,1,opt,name=header,oneof"`
}
type SyncResponse_Chunk struct {
Chunk []byte `protobuf:"bytes,2,opt,name=chunk,proto3,oneof"`
}
func (*SyncResponse_Header) isSyncResponse_Data() {}
func (*SyncResponse_Chunk) isSyncResponse_Data() {}
func (m *SyncResponse) GetData() isSyncResponse_Data {
if m != nil {
return m.Data
}
return nil
}
func (m *SyncResponse) GetHeader() *SyncInfo {
if x, ok := m.GetData().(*SyncResponse_Header); ok {
return x.Header
}
return nil
}
func (m *SyncResponse) GetChunk() []byte {
if x, ok := m.GetData().(*SyncResponse_Chunk); ok {
return x.Chunk
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*SyncResponse) 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 _SyncResponse_OneofMarshaler, _SyncResponse_OneofUnmarshaler, _SyncResponse_OneofSizer, []interface{}{
(*SyncResponse_Header)(nil),
(*SyncResponse_Chunk)(nil),
}
}
func _SyncResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*SyncResponse)
// Data
switch x := m.Data.(type) {
case *SyncResponse_Header:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Header); err != nil {
return err
}
case *SyncResponse_Chunk:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
_ = b.EncodeRawBytes(x.Chunk)
case nil:
default:
return fmt.Errorf("SyncResponse.Data has unexpected type %T", x)
}
return nil
}
func _SyncResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*SyncResponse)
switch tag {
case 1: // Data.header
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(SyncInfo)
err := b.DecodeMessage(msg)
m.Data = &SyncResponse_Header{msg}
return true, err
case 2: // Data.chunk
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.Data = &SyncResponse_Chunk{x}
return true, err
default:
return false, nil
}
}
func _SyncResponse_OneofSizer(msg proto.Message) (n int) {
m := msg.(*SyncResponse)
// Data
switch x := m.Data.(type) {
case *SyncResponse_Header:
s := proto.Size(x.Header)
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *SyncResponse_Chunk:
n += proto.SizeVarint(2<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Chunk)))
n += len(x.Chunk)
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type GossipRequest struct {
Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions" json:"transactions,omitempty"`
}
func (m *GossipRequest) Reset() { *m = GossipRequest{} }
func (m *GossipRequest) String() string { return proto.CompactTextString(m) }
func (*GossipRequest) ProtoMessage() {}
func (*GossipRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{7} }
func (m *GossipRequest) GetTransactions() [][]byte {
if m != nil {
return m.Transactions
}
return nil
}
type TransactionsSyncRequest struct {
// Types that are valid to be assigned to Data:
// *TransactionsSyncRequest_Filter
// *TransactionsSyncRequest_ChunkSize
Data isTransactionsSyncRequest_Data `protobuf_oneof:"Data"`
}
func (m *TransactionsSyncRequest) Reset() { *m = TransactionsSyncRequest{} }
func (m *TransactionsSyncRequest) String() string { return proto.CompactTextString(m) }
func (*TransactionsSyncRequest) ProtoMessage() {}
func (*TransactionsSyncRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{8} }
type isTransactionsSyncRequest_Data interface {
isTransactionsSyncRequest_Data()
MarshalTo([]byte) (int, error)
Size() int
}
type TransactionsSyncRequest_Filter struct {
Filter []byte `protobuf:"bytes,1,opt,name=filter,proto3,oneof"`
}
type TransactionsSyncRequest_ChunkSize struct {
ChunkSize uint64 `protobuf:"varint,2,opt,name=chunk_size,json=chunkSize,proto3,oneof"`
}
func (*TransactionsSyncRequest_Filter) isTransactionsSyncRequest_Data() {}
func (*TransactionsSyncRequest_ChunkSize) isTransactionsSyncRequest_Data() {}
func (m *TransactionsSyncRequest) GetData() isTransactionsSyncRequest_Data {
if m != nil {
return m.Data
}
return nil
}
func (m *TransactionsSyncRequest) GetFilter() []byte {
if x, ok := m.GetData().(*TransactionsSyncRequest_Filter); ok {
return x.Filter
}
return nil
}
func (m *TransactionsSyncRequest) GetChunkSize() uint64 {
if x, ok := m.GetData().(*TransactionsSyncRequest_ChunkSize); ok {
return x.ChunkSize
}
return 0
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*TransactionsSyncRequest) 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 _TransactionsSyncRequest_OneofMarshaler, _TransactionsSyncRequest_OneofUnmarshaler, _TransactionsSyncRequest_OneofSizer, []interface{}{
(*TransactionsSyncRequest_Filter)(nil),
(*TransactionsSyncRequest_ChunkSize)(nil),
}
}
func _TransactionsSyncRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*TransactionsSyncRequest)
// Data
switch x := m.Data.(type) {
case *TransactionsSyncRequest_Filter:
_ = b.EncodeVarint(1<<3 | proto.WireBytes)
_ = b.EncodeRawBytes(x.Filter)
case *TransactionsSyncRequest_ChunkSize:
_ = b.EncodeVarint(2<<3 | proto.WireVarint)
_ = b.EncodeVarint(uint64(x.ChunkSize))
case nil:
default:
return fmt.Errorf("TransactionsSyncRequest.Data has unexpected type %T", x)
}
return nil
}
func _TransactionsSyncRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*TransactionsSyncRequest)
switch tag {
case 1: // Data.filter
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.Data = &TransactionsSyncRequest_Filter{x}
return true, err
case 2: // Data.chunk_size
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.Data = &TransactionsSyncRequest_ChunkSize{x}
return true, err
default:
return false, nil
}
}
func _TransactionsSyncRequest_OneofSizer(msg proto.Message) (n int) {
m := msg.(*TransactionsSyncRequest)
// Data
switch x := m.Data.(type) {
case *TransactionsSyncRequest_Filter:
n += proto.SizeVarint(1<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(len(x.Filter)))
n += len(x.Filter)
case *TransactionsSyncRequest_ChunkSize:
n += proto.SizeVarint(2<<3 | proto.WireVarint)
n += proto.SizeVarint(uint64(x.ChunkSize))
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type TransactionsSyncPart struct {
Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions" json:"transactions,omitempty"`
}
func (m *TransactionsSyncPart) Reset() { *m = TransactionsSyncPart{} }
func (m *TransactionsSyncPart) String() string { return proto.CompactTextString(m) }
func (*TransactionsSyncPart) ProtoMessage() {}
func (*TransactionsSyncPart) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9} }
func (m *TransactionsSyncPart) GetTransactions() [][]byte {
if m != nil {
return m.Transactions
}
return nil
}
type TransactionsSyncResponse struct {
// Types that are valid to be assigned to Data:
// *TransactionsSyncResponse_TransactionsNum
// *TransactionsSyncResponse_Transactions
Data isTransactionsSyncResponse_Data `protobuf_oneof:"Data"`
}
func (m *TransactionsSyncResponse) Reset() { *m = TransactionsSyncResponse{} }
func (m *TransactionsSyncResponse) String() string { return proto.CompactTextString(m) }
func (*TransactionsSyncResponse) ProtoMessage() {}
func (*TransactionsSyncResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{10} }
type isTransactionsSyncResponse_Data interface {
isTransactionsSyncResponse_Data()
MarshalTo([]byte) (int, error)
Size() int
}
type TransactionsSyncResponse_TransactionsNum struct {
TransactionsNum uint64 `protobuf:"varint,1,opt,name=transactions_num,json=transactionsNum,proto3,oneof"`
}
type TransactionsSyncResponse_Transactions struct {
Transactions *TransactionsSyncPart `protobuf:"bytes,2,opt,name=transactions,oneof"`
}
func (*TransactionsSyncResponse_TransactionsNum) isTransactionsSyncResponse_Data() {}
func (*TransactionsSyncResponse_Transactions) isTransactionsSyncResponse_Data() {}
func (m *TransactionsSyncResponse) GetData() isTransactionsSyncResponse_Data {
if m != nil {
return m.Data
}
return nil
}
func (m *TransactionsSyncResponse) GetTransactionsNum() uint64 {
if x, ok := m.GetData().(*TransactionsSyncResponse_TransactionsNum); ok {
return x.TransactionsNum
}
return 0
}
func (m *TransactionsSyncResponse) GetTransactions() *TransactionsSyncPart {
if x, ok := m.GetData().(*TransactionsSyncResponse_Transactions); ok {
return x.Transactions
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*TransactionsSyncResponse) 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 _TransactionsSyncResponse_OneofMarshaler, _TransactionsSyncResponse_OneofUnmarshaler, _TransactionsSyncResponse_OneofSizer, []interface{}{
(*TransactionsSyncResponse_TransactionsNum)(nil),
(*TransactionsSyncResponse_Transactions)(nil),
}
}
func _TransactionsSyncResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*TransactionsSyncResponse)
// Data
switch x := m.Data.(type) {
case *TransactionsSyncResponse_TransactionsNum:
_ = b.EncodeVarint(1<<3 | proto.WireVarint)
_ = b.EncodeVarint(uint64(x.TransactionsNum))
case *TransactionsSyncResponse_Transactions:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Transactions); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("TransactionsSyncResponse.Data has unexpected type %T", x)
}
return nil
}
func _TransactionsSyncResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*TransactionsSyncResponse)
switch tag {
case 1: // Data.transactions_num
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.Data = &TransactionsSyncResponse_TransactionsNum{x}
return true, err
case 2: // Data.transactions
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TransactionsSyncPart)
err := b.DecodeMessage(msg)
m.Data = &TransactionsSyncResponse_Transactions{msg}
return true, err
default:
return false, nil
}
}
func _TransactionsSyncResponse_OneofSizer(msg proto.Message) (n int) {
m := msg.(*TransactionsSyncResponse)
// Data
switch x := m.Data.(type) {
case *TransactionsSyncResponse_TransactionsNum:
n += proto.SizeVarint(1<<3 | proto.WireVarint)
n += proto.SizeVarint(uint64(x.TransactionsNum))
case *TransactionsSyncResponse_Transactions:
s := proto.Size(x.Transactions)
n += proto.SizeVarint(2<<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 TransactionPullRequest struct {
TransactionIds [][]byte `protobuf:"bytes,1,rep,name=transaction_ids,json=transactionIds" json:"transaction_ids,omitempty"`
}
func (m *TransactionPullRequest) Reset() { *m = TransactionPullRequest{} }
func (m *TransactionPullRequest) String() string { return proto.CompactTextString(m) }
func (*TransactionPullRequest) ProtoMessage() {}
func (*TransactionPullRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{11} }
func (m *TransactionPullRequest) GetTransactionIds() [][]byte {
if m != nil {
return m.TransactionIds
}
return nil
}
type TransactionPullResponse struct {
Transactions [][]byte `protobuf:"bytes,1,rep,name=transactions" json:"transactions,omitempty"`
}
func (m *TransactionPullResponse) Reset() { *m = TransactionPullResponse{} }
func (m *TransactionPullResponse) String() string { return proto.CompactTextString(m) }
func (*TransactionPullResponse) ProtoMessage() {}
func (*TransactionPullResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{12} }
func (m *TransactionPullResponse) GetTransactions() [][]byte {
if m != nil {
return m.Transactions
}
return nil
}
func init() {
proto.RegisterType((*QueryRequest)(nil), "wavelet.QueryRequest")
proto.RegisterType((*QueryResponse)(nil), "wavelet.QueryResponse")
proto.RegisterType((*OutOfSyncRequest)(nil), "wavelet.OutOfSyncRequest")
proto.RegisterType((*OutOfSyncResponse)(nil), "wavelet.OutOfSyncResponse")
proto.RegisterType((*SyncInfo)(nil), "wavelet.SyncInfo")
proto.RegisterType((*SyncRequest)(nil), "wavelet.SyncRequest")
proto.RegisterType((*SyncResponse)(nil), "wavelet.SyncResponse")
proto.RegisterType((*GossipRequest)(nil), "wavelet.GossipRequest")
proto.RegisterType((*TransactionsSyncRequest)(nil), "wavelet.TransactionsSyncRequest")
proto.RegisterType((*TransactionsSyncPart)(nil), "wavelet.TransactionsSyncPart")
proto.RegisterType((*TransactionsSyncResponse)(nil), "wavelet.TransactionsSyncResponse")
proto.RegisterType((*TransactionPullRequest)(nil), "wavelet.TransactionPullRequest")
proto.RegisterType((*TransactionPullResponse)(nil), "wavelet.TransactionPullResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for Wavelet service
type WaveletClient interface {
Gossip(ctx context.Context, in *GossipRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error)
CheckOutOfSync(ctx context.Context, in *OutOfSyncRequest, opts ...grpc.CallOption) (*OutOfSyncResponse, error)
Sync(ctx context.Context, opts ...grpc.CallOption) (Wavelet_SyncClient, error)
PullTransactions(ctx context.Context, in *TransactionPullRequest, opts ...grpc.CallOption) (*TransactionPullResponse, error)
SyncTransactions(ctx context.Context, opts ...grpc.CallOption) (Wavelet_SyncTransactionsClient, error)
}
type waveletClient struct {
cc *grpc.ClientConn
}
func NewWaveletClient(cc *grpc.ClientConn) WaveletClient {
return &waveletClient{cc}
}
func (c *waveletClient) Gossip(ctx context.Context, in *GossipRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
out := new(google_protobuf.Empty)
err := grpc.Invoke(ctx, "/wavelet.Wavelet/Gossip", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *waveletClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) {
out := new(QueryResponse)
err := grpc.Invoke(ctx, "/wavelet.Wavelet/Query", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *waveletClient) CheckOutOfSync(ctx context.Context, in *OutOfSyncRequest, opts ...grpc.CallOption) (*OutOfSyncResponse, error) {
out := new(OutOfSyncResponse)
err := grpc.Invoke(ctx, "/wavelet.Wavelet/CheckOutOfSync", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *waveletClient) Sync(ctx context.Context, opts ...grpc.CallOption) (Wavelet_SyncClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Wavelet_serviceDesc.Streams[0], c.cc, "/wavelet.Wavelet/Sync", opts...)
if err != nil {
return nil, err
}
x := &waveletSyncClient{stream}
return x, nil
}
type Wavelet_SyncClient interface {
Send(*SyncRequest) error
Recv() (*SyncResponse, error)
grpc.ClientStream
}
type waveletSyncClient struct {
grpc.ClientStream
}
func (x *waveletSyncClient) Send(m *SyncRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *waveletSyncClient) Recv() (*SyncResponse, error) {
m := new(SyncResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *waveletClient) PullTransactions(ctx context.Context, in *TransactionPullRequest, opts ...grpc.CallOption) (*TransactionPullResponse, error) {
out := new(TransactionPullResponse)
err := grpc.Invoke(ctx, "/wavelet.Wavelet/PullTransactions", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *waveletClient) SyncTransactions(ctx context.Context, opts ...grpc.CallOption) (Wavelet_SyncTransactionsClient, error) {
stream, err := grpc.NewClientStream(ctx, &_Wavelet_serviceDesc.Streams[1], c.cc, "/wavelet.Wavelet/SyncTransactions", opts...)
if err != nil {
return nil, err
}
x := &waveletSyncTransactionsClient{stream}
return x, nil
}
type Wavelet_SyncTransactionsClient interface {
Send(*TransactionsSyncRequest) error
Recv() (*TransactionsSyncResponse, error)
grpc.ClientStream
}
type waveletSyncTransactionsClient struct {
grpc.ClientStream
}
func (x *waveletSyncTransactionsClient) Send(m *TransactionsSyncRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *waveletSyncTransactionsClient) Recv() (*TransactionsSyncResponse, error) {
m := new(TransactionsSyncResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for Wavelet service
type WaveletServer interface {
Gossip(context.Context, *GossipRequest) (*google_protobuf.Empty, error)
Query(context.Context, *QueryRequest) (*QueryResponse, error)
CheckOutOfSync(context.Context, *OutOfSyncRequest) (*OutOfSyncResponse, error)
Sync(Wavelet_SyncServer) error
PullTransactions(context.Context, *TransactionPullRequest) (*TransactionPullResponse, error)
SyncTransactions(Wavelet_SyncTransactionsServer) error
}
func RegisterWaveletServer(s *grpc.Server, srv WaveletServer) {
s.RegisterService(&_Wavelet_serviceDesc, srv)
}
func _Wavelet_Gossip_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GossipRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WaveletServer).Gossip(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wavelet.Wavelet/Gossip",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WaveletServer).Gossip(ctx, req.(*GossipRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wavelet_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WaveletServer).Query(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wavelet.Wavelet/Query",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WaveletServer).Query(ctx, req.(*QueryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wavelet_CheckOutOfSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(OutOfSyncRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WaveletServer).CheckOutOfSync(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wavelet.Wavelet/CheckOutOfSync",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WaveletServer).CheckOutOfSync(ctx, req.(*OutOfSyncRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wavelet_Sync_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(WaveletServer).Sync(&waveletSyncServer{stream})
}
type Wavelet_SyncServer interface {
Send(*SyncResponse) error
Recv() (*SyncRequest, error)
grpc.ServerStream
}
type waveletSyncServer struct {
grpc.ServerStream
}
func (x *waveletSyncServer) Send(m *SyncResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *waveletSyncServer) Recv() (*SyncRequest, error) {
m := new(SyncRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Wavelet_PullTransactions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TransactionPullRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WaveletServer).PullTransactions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/wavelet.Wavelet/PullTransactions",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WaveletServer).PullTransactions(ctx, req.(*TransactionPullRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Wavelet_SyncTransactions_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(WaveletServer).SyncTransactions(&waveletSyncTransactionsServer{stream})
}
type Wavelet_SyncTransactionsServer interface {
Send(*TransactionsSyncResponse) error
Recv() (*TransactionsSyncRequest, error)
grpc.ServerStream
}
type waveletSyncTransactionsServer struct {
grpc.ServerStream
}
func (x *waveletSyncTransactionsServer) Send(m *TransactionsSyncResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *waveletSyncTransactionsServer) Recv() (*TransactionsSyncRequest, error) {
m := new(TransactionsSyncRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _Wavelet_serviceDesc = grpc.ServiceDesc{
ServiceName: "wavelet.Wavelet",
HandlerType: (*WaveletServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Gossip",
Handler: _Wavelet_Gossip_Handler,
},
{
MethodName: "Query",
Handler: _Wavelet_Query_Handler,
},
{
MethodName: "CheckOutOfSync",
Handler: _Wavelet_CheckOutOfSync_Handler,
},
{
MethodName: "PullTransactions",
Handler: _Wavelet_PullTransactions_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Sync",
Handler: _Wavelet_Sync_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "SyncTransactions",
Handler: _Wavelet_SyncTransactions_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "src/rpc.proto",
}