-
Notifications
You must be signed in to change notification settings - Fork 1
/
replication.pb.go
2455 lines (2331 loc) · 63.3 KB
/
replication.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: replication.proto
package pb
import (
context "context"
fmt "fmt"
io "io"
math "math"
math_bits "math/bits"
proto "github.com/gogo/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Replication message is a signable data structure to represent a replication scheme
type Replication struct {
// Header must be "rtrade-replication v0..." for development stage, this is a required security header.
// - Avoid collision from other signed data.
// - Allow future versions to require different validation rules.
// Any signer must understand every header tag to sign documents.
Header string `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
// CIDs is the list of contents to replicate.
// Please use helper functions GetCIDs and AddCIDs for this field
CidsBytes [][]byte `protobuf:"bytes,2,rep,name=cids_bytes,json=cidsBytes,proto3" json:"cids_bytes,omitempty"`
// Servers list the candidate severs to replicate to, in the order of preference.
Servers []*ServerSource `protobuf:"bytes,3,rep,name=servers,proto3" json:"servers,omitempty"`
// replication_factor is the number of replications desired.
ReplicationFactor int32 `protobuf:"varint,4,opt,name=replication_factor,json=replicationFactor,proto3" json:"replication_factor,omitempty"`
// refresh_interval_seconds is the *suggested* number of seconds to wait before checking
// if a remote server is up. The first check should be random from 0 to refresh_interval_seconds.
// Each replicator can have it's own max_interval. A sensible default value should be used if it is 0.
RefreshIntervalSeconds int32 `protobuf:"varint,5,opt,name=refresh_interval_seconds,json=refreshIntervalSeconds,proto3" json:"refresh_interval_seconds,omitempty"`
// server_down_delay_seconds is the number of seconds to wait after a server is down before the
// next reserved server is requested to be active. A sensible default value should be used if it is 0.
ServerDownDelaySeconds int32 `protobuf:"varint,6,opt,name=server_down_delay_seconds,json=serverDownDelaySeconds,proto3" json:"server_down_delay_seconds,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Replication) Reset() { *m = Replication{} }
func (m *Replication) String() string { return proto.CompactTextString(m) }
func (*Replication) ProtoMessage() {}
func (*Replication) Descriptor() ([]byte, []int) {
return fileDescriptor_ed0454e9e09fb71a, []int{0}
}
func (m *Replication) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Replication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Replication.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Replication) XXX_Merge(src proto.Message) {
xxx_messageInfo_Replication.Merge(m, src)
}
func (m *Replication) XXX_Size() int {
return m.Size()
}
func (m *Replication) XXX_DiscardUnknown() {
xxx_messageInfo_Replication.DiscardUnknown(m)
}
var xxx_messageInfo_Replication proto.InternalMessageInfo
func (m *Replication) GetHeader() string {
if m != nil {
return m.Header
}
return ""
}
func (m *Replication) GetCidsBytes() [][]byte {
if m != nil {
return m.CidsBytes
}
return nil
}
func (m *Replication) GetServers() []*ServerSource {
if m != nil {
return m.Servers
}
return nil
}
func (m *Replication) GetReplicationFactor() int32 {
if m != nil {
return m.ReplicationFactor
}
return 0
}
func (m *Replication) GetRefreshIntervalSeconds() int32 {
if m != nil {
return m.RefreshIntervalSeconds
}
return 0
}
func (m *Replication) GetServerDownDelaySeconds() int32 {
if m != nil {
return m.ServerDownDelaySeconds
}
return 0
}
// ServerSource is a list of one or more servers.
// TODO: add field to allow referring to a list of servers from another file.
type ServerSource struct {
AddrInfo *AddrInfo `protobuf:"bytes,1,opt,name=addr_info,json=addrInfo,proto3" json:"addr_info,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ServerSource) Reset() { *m = ServerSource{} }
func (m *ServerSource) String() string { return proto.CompactTextString(m) }
func (*ServerSource) ProtoMessage() {}
func (*ServerSource) Descriptor() ([]byte, []int) {
return fileDescriptor_ed0454e9e09fb71a, []int{1}
}
func (m *ServerSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ServerSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ServerSource.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ServerSource) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerSource.Merge(m, src)
}
func (m *ServerSource) XXX_Size() int {
return m.Size()
}
func (m *ServerSource) XXX_DiscardUnknown() {
xxx_messageInfo_ServerSource.DiscardUnknown(m)
}
var xxx_messageInfo_ServerSource proto.InternalMessageInfo
func (m *ServerSource) GetAddrInfo() *AddrInfo {
if m != nil {
return m.AddrInfo
}
return nil
}
// AddrInfo can be used to ID and locate a server (see also libp2p/go-libp2p-core/peer#AddrInfo)
type AddrInfo struct {
// id_bytes is a libp2p peer identity. It is used to verity the Peer's public key.
// Please use helper functions GetID and SetID for this field
IdBytes []byte `protobuf:"bytes,1,opt,name=id_bytes,json=idBytes,proto3" json:"id_bytes,omitempty"`
// addrBytes are bytes of Multiaddr for locating this peer.
// Please use helper functions GetMultiAddrs, and SetMultiAddrs for this field.
AddrsBytes [][]byte `protobuf:"bytes,2,rep,name=addrs_bytes,json=addrsBytes,proto3" json:"addrs_bytes,omitempty"`
// grpc port for replication protocol. will be optional once grpc is integrated into multistream.
GrpcPort int32 `protobuf:"varint,3,opt,name=grpc_port,json=grpcPort,proto3" json:"grpc_port,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AddrInfo) Reset() { *m = AddrInfo{} }
func (m *AddrInfo) String() string { return proto.CompactTextString(m) }
func (*AddrInfo) ProtoMessage() {}
func (*AddrInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_ed0454e9e09fb71a, []int{2}
}
func (m *AddrInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *AddrInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AddrInfo.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *AddrInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_AddrInfo.Merge(m, src)
}
func (m *AddrInfo) XXX_Size() int {
return m.Size()
}
func (m *AddrInfo) XXX_DiscardUnknown() {
xxx_messageInfo_AddrInfo.DiscardUnknown(m)
}
var xxx_messageInfo_AddrInfo proto.InternalMessageInfo
func (m *AddrInfo) GetIdBytes() []byte {
if m != nil {
return m.IdBytes
}
return nil
}
func (m *AddrInfo) GetAddrsBytes() [][]byte {
if m != nil {
return m.AddrsBytes
}
return nil
}
func (m *AddrInfo) GetGrpcPort() int32 {
if m != nil {
return m.GrpcPort
}
return 0
}
type Subscription struct {
Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
AuthorIdBytes []byte `protobuf:"bytes,2,opt,name=author_id_bytes,json=authorIdBytes,proto3" json:"author_id_bytes,omitempty"`
//if true, remove this Subscription.
//For replicator.Add, deactive this replication.
//For replicator.WaitForUpdates, stop reporting updates.
Remove bool `protobuf:"varint,3,opt,name=remove,proto3" json:"remove,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Subscription) Reset() { *m = Subscription{} }
func (m *Subscription) String() string { return proto.CompactTextString(m) }
func (*Subscription) ProtoMessage() {}
func (*Subscription) Descriptor() ([]byte, []int) {
return fileDescriptor_ed0454e9e09fb71a, []int{3}
}
func (m *Subscription) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Subscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Subscription.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Subscription) XXX_Merge(src proto.Message) {
xxx_messageInfo_Subscription.Merge(m, src)
}
func (m *Subscription) XXX_Size() int {
return m.Size()
}
func (m *Subscription) XXX_DiscardUnknown() {
xxx_messageInfo_Subscription.DiscardUnknown(m)
}
var xxx_messageInfo_Subscription proto.InternalMessageInfo
func (m *Subscription) GetTopic() string {
if m != nil {
return m.Topic
}
return ""
}
func (m *Subscription) GetAuthorIdBytes() []byte {
if m != nil {
return m.AuthorIdBytes
}
return nil
}
func (m *Subscription) GetRemove() bool {
if m != nil {
return m.Remove
}
return false
}
type ReplicationStatus struct {
//ok report success for action submitted
Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
//is_active report if the replication is currently active on this server
IsActive bool `protobuf:"varint,2,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
//current_version is the highest version this replicator/server has locally.
CurrentVersion int64 `protobuf:"varint,3,opt,name=current_version,json=currentVersion,proto3" json:"current_version,omitempty"`
//target_version is the highest version this replicator/server knows about and can verify to exist.
TargetVersion int64 `protobuf:"varint,4,opt,name=target_version,json=targetVersion,proto3" json:"target_version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReplicationStatus) Reset() { *m = ReplicationStatus{} }
func (m *ReplicationStatus) String() string { return proto.CompactTextString(m) }
func (*ReplicationStatus) ProtoMessage() {}
func (*ReplicationStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_ed0454e9e09fb71a, []int{4}
}
func (m *ReplicationStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ReplicationStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ReplicationStatus.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ReplicationStatus) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplicationStatus.Merge(m, src)
}
func (m *ReplicationStatus) XXX_Size() int {
return m.Size()
}
func (m *ReplicationStatus) XXX_DiscardUnknown() {
xxx_messageInfo_ReplicationStatus.DiscardUnknown(m)
}
var xxx_messageInfo_ReplicationStatus proto.InternalMessageInfo
func (m *ReplicationStatus) GetOk() bool {
if m != nil {
return m.Ok
}
return false
}
func (m *ReplicationStatus) GetIsActive() bool {
if m != nil {
return m.IsActive
}
return false
}
func (m *ReplicationStatus) GetCurrentVersion() int64 {
if m != nil {
return m.CurrentVersion
}
return 0
}
func (m *ReplicationStatus) GetTargetVersion() int64 {
if m != nil {
return m.TargetVersion
}
return 0
}
type SubscriptionUpdate struct {
//strictly increasing version number
Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
//replication file is in bytes for signing
ReplicationBytes []byte `protobuf:"bytes,2,opt,name=replication_bytes,json=replicationBytes,proto3" json:"replication_bytes,omitempty"`
//signature signs the Subscription and above data in length delimited form in the order topic|author|version|replication
Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SubscriptionUpdate) Reset() { *m = SubscriptionUpdate{} }
func (m *SubscriptionUpdate) String() string { return proto.CompactTextString(m) }
func (*SubscriptionUpdate) ProtoMessage() {}
func (*SubscriptionUpdate) Descriptor() ([]byte, []int) {
return fileDescriptor_ed0454e9e09fb71a, []int{5}
}
func (m *SubscriptionUpdate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SubscriptionUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SubscriptionUpdate.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *SubscriptionUpdate) XXX_Merge(src proto.Message) {
xxx_messageInfo_SubscriptionUpdate.Merge(m, src)
}
func (m *SubscriptionUpdate) XXX_Size() int {
return m.Size()
}
func (m *SubscriptionUpdate) XXX_DiscardUnknown() {
xxx_messageInfo_SubscriptionUpdate.DiscardUnknown(m)
}
var xxx_messageInfo_SubscriptionUpdate proto.InternalMessageInfo
func (m *SubscriptionUpdate) GetVersion() int64 {
if m != nil {
return m.Version
}
return 0
}
func (m *SubscriptionUpdate) GetReplicationBytes() []byte {
if m != nil {
return m.ReplicationBytes
}
return nil
}
func (m *SubscriptionUpdate) GetSignature() []byte {
if m != nil {
return m.Signature
}
return nil
}
type SignedSubscription struct {
SubPart *Subscription `protobuf:"bytes,1,opt,name=sub_part,json=subPart,proto3" json:"sub_part,omitempty"`
UpdatePart *SubscriptionUpdate `protobuf:"bytes,2,opt,name=update_part,json=updatePart,proto3" json:"update_part,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SignedSubscription) Reset() { *m = SignedSubscription{} }
func (m *SignedSubscription) String() string { return proto.CompactTextString(m) }
func (*SignedSubscription) ProtoMessage() {}
func (*SignedSubscription) Descriptor() ([]byte, []int) {
return fileDescriptor_ed0454e9e09fb71a, []int{6}
}
func (m *SignedSubscription) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *SignedSubscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SignedSubscription.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *SignedSubscription) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignedSubscription.Merge(m, src)
}
func (m *SignedSubscription) XXX_Size() int {
return m.Size()
}
func (m *SignedSubscription) XXX_DiscardUnknown() {
xxx_messageInfo_SignedSubscription.DiscardUnknown(m)
}
var xxx_messageInfo_SignedSubscription proto.InternalMessageInfo
func (m *SignedSubscription) GetSubPart() *Subscription {
if m != nil {
return m.SubPart
}
return nil
}
func (m *SignedSubscription) GetUpdatePart() *SubscriptionUpdate {
if m != nil {
return m.UpdatePart
}
return nil
}
func init() {
proto.RegisterType((*Replication)(nil), "pb.Replication")
proto.RegisterType((*ServerSource)(nil), "pb.ServerSource")
proto.RegisterType((*AddrInfo)(nil), "pb.AddrInfo")
proto.RegisterType((*Subscription)(nil), "pb.Subscription")
proto.RegisterType((*ReplicationStatus)(nil), "pb.ReplicationStatus")
proto.RegisterType((*SubscriptionUpdate)(nil), "pb.SubscriptionUpdate")
proto.RegisterType((*SignedSubscription)(nil), "pb.SignedSubscription")
}
func init() { proto.RegisterFile("replication.proto", fileDescriptor_ed0454e9e09fb71a) }
var fileDescriptor_ed0454e9e09fb71a = []byte{
// 622 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd4, 0x3c,
0x14, 0x55, 0x92, 0x76, 0x26, 0x73, 0x27, 0xfd, 0xb3, 0xbe, 0x8e, 0xd2, 0x0f, 0x28, 0xa3, 0x48,
0xc0, 0x40, 0x45, 0x55, 0xb5, 0x0b, 0xe8, 0x72, 0xaa, 0x0a, 0xd4, 0x5d, 0xe5, 0x08, 0xb6, 0x91,
0x13, 0x7b, 0xa6, 0x56, 0xdb, 0x38, 0xb2, 0x9d, 0xa9, 0xca, 0x53, 0xb0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x00, 0x00, 0xff, 0xff, 0xb7, 0xf0, 0x26, 0x7f, 0xd3, 0x04, 0x00, 0x00,
}
// 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
// ReplicatorClient is the client API for Replicator service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ReplicatorClient interface {
// Add is used to add a replication to this server, changing it's status from reserved to active.
Add(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (Replicator_AddClient, error)
// Status returns an updating stream of the replication status on the server.
Status(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (Replicator_StatusClient, error)
// GetSubscriptionUpdate returns the latest version of subscribed replication
GetSubscriptionUpdate(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*SubscriptionUpdate, error)
// SubmitReplication is used by client agents to start replications, after they
// have uploaded the files and retrieved the cid, and collected servers to replicate too.
SubmitReplication(ctx context.Context, in *SignedSubscription, opts ...grpc.CallOption) (Replicator_SubmitReplicationClient, error)
}
type replicatorClient struct {
cc *grpc.ClientConn
}
func NewReplicatorClient(cc *grpc.ClientConn) ReplicatorClient {
return &replicatorClient{cc}
}
func (c *replicatorClient) Add(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (Replicator_AddClient, error) {
stream, err := c.cc.NewStream(ctx, &_Replicator_serviceDesc.Streams[0], "/pb.replicator/Add", opts...)
if err != nil {
return nil, err
}
x := &replicatorAddClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Replicator_AddClient interface {
Recv() (*ReplicationStatus, error)
grpc.ClientStream
}
type replicatorAddClient struct {
grpc.ClientStream
}
func (x *replicatorAddClient) Recv() (*ReplicationStatus, error) {
m := new(ReplicationStatus)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *replicatorClient) Status(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (Replicator_StatusClient, error) {
stream, err := c.cc.NewStream(ctx, &_Replicator_serviceDesc.Streams[1], "/pb.replicator/Status", opts...)
if err != nil {
return nil, err
}
x := &replicatorStatusClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Replicator_StatusClient interface {
Recv() (*ReplicationStatus, error)
grpc.ClientStream
}
type replicatorStatusClient struct {
grpc.ClientStream
}
func (x *replicatorStatusClient) Recv() (*ReplicationStatus, error) {
m := new(ReplicationStatus)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *replicatorClient) GetSubscriptionUpdate(ctx context.Context, in *Subscription, opts ...grpc.CallOption) (*SubscriptionUpdate, error) {
out := new(SubscriptionUpdate)
err := c.cc.Invoke(ctx, "/pb.replicator/GetSubscriptionUpdate", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *replicatorClient) SubmitReplication(ctx context.Context, in *SignedSubscription, opts ...grpc.CallOption) (Replicator_SubmitReplicationClient, error) {
stream, err := c.cc.NewStream(ctx, &_Replicator_serviceDesc.Streams[2], "/pb.replicator/SubmitReplication", opts...)
if err != nil {
return nil, err
}
x := &replicatorSubmitReplicationClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Replicator_SubmitReplicationClient interface {
Recv() (*ReplicationStatus, error)
grpc.ClientStream
}
type replicatorSubmitReplicationClient struct {
grpc.ClientStream
}
func (x *replicatorSubmitReplicationClient) Recv() (*ReplicationStatus, error) {
m := new(ReplicationStatus)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ReplicatorServer is the server API for Replicator service.
type ReplicatorServer interface {
// Add is used to add a replication to this server, changing it's status from reserved to active.
Add(*Subscription, Replicator_AddServer) error
// Status returns an updating stream of the replication status on the server.
Status(*Subscription, Replicator_StatusServer) error
// GetSubscriptionUpdate returns the latest version of subscribed replication
GetSubscriptionUpdate(context.Context, *Subscription) (*SubscriptionUpdate, error)
// SubmitReplication is used by client agents to start replications, after they
// have uploaded the files and retrieved the cid, and collected servers to replicate too.
SubmitReplication(*SignedSubscription, Replicator_SubmitReplicationServer) error
}
// UnimplementedReplicatorServer can be embedded to have forward compatible implementations.
type UnimplementedReplicatorServer struct {
}
func (*UnimplementedReplicatorServer) Add(req *Subscription, srv Replicator_AddServer) error {
return status.Errorf(codes.Unimplemented, "method Add not implemented")
}
func (*UnimplementedReplicatorServer) Status(req *Subscription, srv Replicator_StatusServer) error {
return status.Errorf(codes.Unimplemented, "method Status not implemented")
}
func (*UnimplementedReplicatorServer) GetSubscriptionUpdate(ctx context.Context, req *Subscription) (*SubscriptionUpdate, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSubscriptionUpdate not implemented")
}
func (*UnimplementedReplicatorServer) SubmitReplication(req *SignedSubscription, srv Replicator_SubmitReplicationServer) error {
return status.Errorf(codes.Unimplemented, "method SubmitReplication not implemented")
}
func RegisterReplicatorServer(s *grpc.Server, srv ReplicatorServer) {
s.RegisterService(&_Replicator_serviceDesc, srv)
}
func _Replicator_Add_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(Subscription)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ReplicatorServer).Add(m, &replicatorAddServer{stream})
}
type Replicator_AddServer interface {
Send(*ReplicationStatus) error
grpc.ServerStream
}
type replicatorAddServer struct {
grpc.ServerStream
}
func (x *replicatorAddServer) Send(m *ReplicationStatus) error {
return x.ServerStream.SendMsg(m)
}
func _Replicator_Status_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(Subscription)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ReplicatorServer).Status(m, &replicatorStatusServer{stream})
}
type Replicator_StatusServer interface {
Send(*ReplicationStatus) error
grpc.ServerStream
}
type replicatorStatusServer struct {
grpc.ServerStream
}
func (x *replicatorStatusServer) Send(m *ReplicationStatus) error {
return x.ServerStream.SendMsg(m)
}
func _Replicator_GetSubscriptionUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Subscription)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ReplicatorServer).GetSubscriptionUpdate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.replicator/GetSubscriptionUpdate",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ReplicatorServer).GetSubscriptionUpdate(ctx, req.(*Subscription))
}
return interceptor(ctx, in, info, handler)
}
func _Replicator_SubmitReplication_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SignedSubscription)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ReplicatorServer).SubmitReplication(m, &replicatorSubmitReplicationServer{stream})
}
type Replicator_SubmitReplicationServer interface {
Send(*ReplicationStatus) error
grpc.ServerStream
}
type replicatorSubmitReplicationServer struct {
grpc.ServerStream
}
func (x *replicatorSubmitReplicationServer) Send(m *ReplicationStatus) error {
return x.ServerStream.SendMsg(m)
}
var _Replicator_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.replicator",
HandlerType: (*ReplicatorServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetSubscriptionUpdate",
Handler: _Replicator_GetSubscriptionUpdate_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Add",
Handler: _Replicator_Add_Handler,
ServerStreams: true,
},
{
StreamName: "Status",
Handler: _Replicator_Status_Handler,
ServerStreams: true,
},
{
StreamName: "SubmitReplication",
Handler: _Replicator_SubmitReplication_Handler,
ServerStreams: true,
},
},
Metadata: "replication.proto",
}
func (m *Replication) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Replication) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Replication) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.ServerDownDelaySeconds != 0 {
i = encodeVarintReplication(dAtA, i, uint64(m.ServerDownDelaySeconds))
i--
dAtA[i] = 0x30
}
if m.RefreshIntervalSeconds != 0 {
i = encodeVarintReplication(dAtA, i, uint64(m.RefreshIntervalSeconds))
i--
dAtA[i] = 0x28
}
if m.ReplicationFactor != 0 {
i = encodeVarintReplication(dAtA, i, uint64(m.ReplicationFactor))
i--
dAtA[i] = 0x20
}
if len(m.Servers) > 0 {
for iNdEx := len(m.Servers) - 1; iNdEx >= 0; iNdEx-- {
{
size, err := m.Servers[iNdEx].MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintReplication(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
}
if len(m.CidsBytes) > 0 {
for iNdEx := len(m.CidsBytes) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.CidsBytes[iNdEx])
copy(dAtA[i:], m.CidsBytes[iNdEx])
i = encodeVarintReplication(dAtA, i, uint64(len(m.CidsBytes[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if len(m.Header) > 0 {
i -= len(m.Header)
copy(dAtA[i:], m.Header)
i = encodeVarintReplication(dAtA, i, uint64(len(m.Header)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *ServerSource) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *ServerSource) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *ServerSource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.AddrInfo != nil {
{
size, err := m.AddrInfo.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintReplication(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *AddrInfo) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *AddrInfo) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AddrInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.GrpcPort != 0 {
i = encodeVarintReplication(dAtA, i, uint64(m.GrpcPort))
i--
dAtA[i] = 0x18
}
if len(m.AddrsBytes) > 0 {
for iNdEx := len(m.AddrsBytes) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.AddrsBytes[iNdEx])
copy(dAtA[i:], m.AddrsBytes[iNdEx])
i = encodeVarintReplication(dAtA, i, uint64(len(m.AddrsBytes[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if len(m.IdBytes) > 0 {
i -= len(m.IdBytes)
copy(dAtA[i:], m.IdBytes)
i = encodeVarintReplication(dAtA, i, uint64(len(m.IdBytes)))
i--
dAtA[i] = 0xa