-
Notifications
You must be signed in to change notification settings - Fork 473
/
crdt.pb.go
2196 lines (1894 loc) · 72.1 KB
/
crdt.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-go. DO NOT EDIT.
// source: crdt.proto
package protocol
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
any "github.com/golang/protobuf/ptypes/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// 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.ProtoPackageIsVersion3 // please upgrade the proto package
type CrdtWriteConsistency int32
const (
CrdtWriteConsistency_LOCAL CrdtWriteConsistency = 0
CrdtWriteConsistency_MAJORITY CrdtWriteConsistency = 1
CrdtWriteConsistency_ALL CrdtWriteConsistency = 2
)
var CrdtWriteConsistency_name = map[int32]string{
0: "LOCAL",
1: "MAJORITY",
2: "ALL",
}
var CrdtWriteConsistency_value = map[string]int32{
"LOCAL": 0,
"MAJORITY": 1,
"ALL": 2,
}
func (x CrdtWriteConsistency) String() string {
return proto.EnumName(CrdtWriteConsistency_name, int32(x))
}
func (CrdtWriteConsistency) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{0}
}
type CrdtClock int32
const (
// Use the default clock for deciding the last write, which is the system clocks
// milliseconds since epoch.
CrdtClock_DEFAULT CrdtClock = 0
// Use the reverse semantics with the default clock, to enable first write wins.
CrdtClock_REVERSE CrdtClock = 1
// Use a custom clock value, set using custom_clock_value.
CrdtClock_CUSTOM CrdtClock = 2
// Use a custom clock value, but automatically increment it by one if the clock
// value from the current value is equal to the custom_clock_value.
CrdtClock_CUSTOM_AUTO_INCREMENT CrdtClock = 3
)
var CrdtClock_name = map[int32]string{
0: "DEFAULT",
1: "REVERSE",
2: "CUSTOM",
3: "CUSTOM_AUTO_INCREMENT",
}
var CrdtClock_value = map[string]int32{
"DEFAULT": 0,
"REVERSE": 1,
"CUSTOM": 2,
"CUSTOM_AUTO_INCREMENT": 3,
}
func (x CrdtClock) String() string {
return proto.EnumName(CrdtClock_name, int32(x))
}
func (CrdtClock) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{1}
}
// Message for the Crdt handle stream in.
type CrdtStreamIn struct {
// Types that are valid to be assigned to Message:
// *CrdtStreamIn_Init
// *CrdtStreamIn_State
// *CrdtStreamIn_Changed
// *CrdtStreamIn_Deleted
// *CrdtStreamIn_Command
// *CrdtStreamIn_StreamCancelled
Message isCrdtStreamIn_Message `protobuf_oneof:"message"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CrdtStreamIn) Reset() { *m = CrdtStreamIn{} }
func (m *CrdtStreamIn) String() string { return proto.CompactTextString(m) }
func (*CrdtStreamIn) ProtoMessage() {}
func (*CrdtStreamIn) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{0}
}
func (m *CrdtStreamIn) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CrdtStreamIn.Unmarshal(m, b)
}
func (m *CrdtStreamIn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CrdtStreamIn.Marshal(b, m, deterministic)
}
func (m *CrdtStreamIn) XXX_Merge(src proto.Message) {
xxx_messageInfo_CrdtStreamIn.Merge(m, src)
}
func (m *CrdtStreamIn) XXX_Size() int {
return xxx_messageInfo_CrdtStreamIn.Size(m)
}
func (m *CrdtStreamIn) XXX_DiscardUnknown() {
xxx_messageInfo_CrdtStreamIn.DiscardUnknown(m)
}
var xxx_messageInfo_CrdtStreamIn proto.InternalMessageInfo
type isCrdtStreamIn_Message interface {
isCrdtStreamIn_Message()
}
type CrdtStreamIn_Init struct {
Init *CrdtInit `protobuf:"bytes,1,opt,name=init,proto3,oneof"`
}
type CrdtStreamIn_State struct {
State *CrdtState `protobuf:"bytes,2,opt,name=state,proto3,oneof"`
}
type CrdtStreamIn_Changed struct {
Changed *CrdtDelta `protobuf:"bytes,3,opt,name=changed,proto3,oneof"`
}
type CrdtStreamIn_Deleted struct {
Deleted *CrdtDelete `protobuf:"bytes,4,opt,name=deleted,proto3,oneof"`
}
type CrdtStreamIn_Command struct {
Command *Command `protobuf:"bytes,5,opt,name=command,proto3,oneof"`
}
type CrdtStreamIn_StreamCancelled struct {
StreamCancelled *StreamCancelled `protobuf:"bytes,6,opt,name=stream_cancelled,json=streamCancelled,proto3,oneof"`
}
func (*CrdtStreamIn_Init) isCrdtStreamIn_Message() {}
func (*CrdtStreamIn_State) isCrdtStreamIn_Message() {}
func (*CrdtStreamIn_Changed) isCrdtStreamIn_Message() {}
func (*CrdtStreamIn_Deleted) isCrdtStreamIn_Message() {}
func (*CrdtStreamIn_Command) isCrdtStreamIn_Message() {}
func (*CrdtStreamIn_StreamCancelled) isCrdtStreamIn_Message() {}
func (m *CrdtStreamIn) GetMessage() isCrdtStreamIn_Message {
if m != nil {
return m.Message
}
return nil
}
func (m *CrdtStreamIn) GetInit() *CrdtInit {
if x, ok := m.GetMessage().(*CrdtStreamIn_Init); ok {
return x.Init
}
return nil
}
func (m *CrdtStreamIn) GetState() *CrdtState {
if x, ok := m.GetMessage().(*CrdtStreamIn_State); ok {
return x.State
}
return nil
}
func (m *CrdtStreamIn) GetChanged() *CrdtDelta {
if x, ok := m.GetMessage().(*CrdtStreamIn_Changed); ok {
return x.Changed
}
return nil
}
func (m *CrdtStreamIn) GetDeleted() *CrdtDelete {
if x, ok := m.GetMessage().(*CrdtStreamIn_Deleted); ok {
return x.Deleted
}
return nil
}
func (m *CrdtStreamIn) GetCommand() *Command {
if x, ok := m.GetMessage().(*CrdtStreamIn_Command); ok {
return x.Command
}
return nil
}
func (m *CrdtStreamIn) GetStreamCancelled() *StreamCancelled {
if x, ok := m.GetMessage().(*CrdtStreamIn_StreamCancelled); ok {
return x.StreamCancelled
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*CrdtStreamIn) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*CrdtStreamIn_Init)(nil),
(*CrdtStreamIn_State)(nil),
(*CrdtStreamIn_Changed)(nil),
(*CrdtStreamIn_Deleted)(nil),
(*CrdtStreamIn_Command)(nil),
(*CrdtStreamIn_StreamCancelled)(nil),
}
}
// Message for the Crdt handle stream out.
type CrdtStreamOut struct {
// Types that are valid to be assigned to Message:
// *CrdtStreamOut_Reply
// *CrdtStreamOut_StreamedMessage
// *CrdtStreamOut_StreamCancelledResponse
// *CrdtStreamOut_Failure
Message isCrdtStreamOut_Message `protobuf_oneof:"message"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CrdtStreamOut) Reset() { *m = CrdtStreamOut{} }
func (m *CrdtStreamOut) String() string { return proto.CompactTextString(m) }
func (*CrdtStreamOut) ProtoMessage() {}
func (*CrdtStreamOut) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{1}
}
func (m *CrdtStreamOut) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CrdtStreamOut.Unmarshal(m, b)
}
func (m *CrdtStreamOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CrdtStreamOut.Marshal(b, m, deterministic)
}
func (m *CrdtStreamOut) XXX_Merge(src proto.Message) {
xxx_messageInfo_CrdtStreamOut.Merge(m, src)
}
func (m *CrdtStreamOut) XXX_Size() int {
return xxx_messageInfo_CrdtStreamOut.Size(m)
}
func (m *CrdtStreamOut) XXX_DiscardUnknown() {
xxx_messageInfo_CrdtStreamOut.DiscardUnknown(m)
}
var xxx_messageInfo_CrdtStreamOut proto.InternalMessageInfo
type isCrdtStreamOut_Message interface {
isCrdtStreamOut_Message()
}
type CrdtStreamOut_Reply struct {
Reply *CrdtReply `protobuf:"bytes,1,opt,name=reply,proto3,oneof"`
}
type CrdtStreamOut_StreamedMessage struct {
StreamedMessage *CrdtStreamedMessage `protobuf:"bytes,2,opt,name=streamed_message,json=streamedMessage,proto3,oneof"`
}
type CrdtStreamOut_StreamCancelledResponse struct {
StreamCancelledResponse *CrdtStreamCancelledResponse `protobuf:"bytes,3,opt,name=stream_cancelled_response,json=streamCancelledResponse,proto3,oneof"`
}
type CrdtStreamOut_Failure struct {
Failure *Failure `protobuf:"bytes,4,opt,name=failure,proto3,oneof"`
}
func (*CrdtStreamOut_Reply) isCrdtStreamOut_Message() {}
func (*CrdtStreamOut_StreamedMessage) isCrdtStreamOut_Message() {}
func (*CrdtStreamOut_StreamCancelledResponse) isCrdtStreamOut_Message() {}
func (*CrdtStreamOut_Failure) isCrdtStreamOut_Message() {}
func (m *CrdtStreamOut) GetMessage() isCrdtStreamOut_Message {
if m != nil {
return m.Message
}
return nil
}
func (m *CrdtStreamOut) GetReply() *CrdtReply {
if x, ok := m.GetMessage().(*CrdtStreamOut_Reply); ok {
return x.Reply
}
return nil
}
func (m *CrdtStreamOut) GetStreamedMessage() *CrdtStreamedMessage {
if x, ok := m.GetMessage().(*CrdtStreamOut_StreamedMessage); ok {
return x.StreamedMessage
}
return nil
}
func (m *CrdtStreamOut) GetStreamCancelledResponse() *CrdtStreamCancelledResponse {
if x, ok := m.GetMessage().(*CrdtStreamOut_StreamCancelledResponse); ok {
return x.StreamCancelledResponse
}
return nil
}
func (m *CrdtStreamOut) GetFailure() *Failure {
if x, ok := m.GetMessage().(*CrdtStreamOut_Failure); ok {
return x.Failure
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*CrdtStreamOut) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*CrdtStreamOut_Reply)(nil),
(*CrdtStreamOut_StreamedMessage)(nil),
(*CrdtStreamOut_StreamCancelledResponse)(nil),
(*CrdtStreamOut_Failure)(nil),
}
}
// The CRDT state. This represents the full state of a CRDT. When received, a user function should replace the current
// state with this, not apply it as a delta. This includes both for the top level CRDT, and embedded CRDTs, such as
// the values of an ORMap.
type CrdtState struct {
// Types that are valid to be assigned to State:
// *CrdtState_Gcounter
// *CrdtState_Pncounter
// *CrdtState_Gset
// *CrdtState_Orset
// *CrdtState_Lwwregister
// *CrdtState_Flag
// *CrdtState_Ormap
// *CrdtState_Vote
State isCrdtState_State `protobuf_oneof:"state"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CrdtState) Reset() { *m = CrdtState{} }
func (m *CrdtState) String() string { return proto.CompactTextString(m) }
func (*CrdtState) ProtoMessage() {}
func (*CrdtState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{2}
}
func (m *CrdtState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CrdtState.Unmarshal(m, b)
}
func (m *CrdtState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CrdtState.Marshal(b, m, deterministic)
}
func (m *CrdtState) XXX_Merge(src proto.Message) {
xxx_messageInfo_CrdtState.Merge(m, src)
}
func (m *CrdtState) XXX_Size() int {
return xxx_messageInfo_CrdtState.Size(m)
}
func (m *CrdtState) XXX_DiscardUnknown() {
xxx_messageInfo_CrdtState.DiscardUnknown(m)
}
var xxx_messageInfo_CrdtState proto.InternalMessageInfo
type isCrdtState_State interface {
isCrdtState_State()
}
type CrdtState_Gcounter struct {
Gcounter *GCounterState `protobuf:"bytes,1,opt,name=gcounter,proto3,oneof"`
}
type CrdtState_Pncounter struct {
Pncounter *PNCounterState `protobuf:"bytes,2,opt,name=pncounter,proto3,oneof"`
}
type CrdtState_Gset struct {
Gset *GSetState `protobuf:"bytes,3,opt,name=gset,proto3,oneof"`
}
type CrdtState_Orset struct {
Orset *ORSetState `protobuf:"bytes,4,opt,name=orset,proto3,oneof"`
}
type CrdtState_Lwwregister struct {
Lwwregister *LWWRegisterState `protobuf:"bytes,5,opt,name=lwwregister,proto3,oneof"`
}
type CrdtState_Flag struct {
Flag *FlagState `protobuf:"bytes,6,opt,name=flag,proto3,oneof"`
}
type CrdtState_Ormap struct {
Ormap *ORMapState `protobuf:"bytes,7,opt,name=ormap,proto3,oneof"`
}
type CrdtState_Vote struct {
Vote *VoteState `protobuf:"bytes,8,opt,name=vote,proto3,oneof"`
}
func (*CrdtState_Gcounter) isCrdtState_State() {}
func (*CrdtState_Pncounter) isCrdtState_State() {}
func (*CrdtState_Gset) isCrdtState_State() {}
func (*CrdtState_Orset) isCrdtState_State() {}
func (*CrdtState_Lwwregister) isCrdtState_State() {}
func (*CrdtState_Flag) isCrdtState_State() {}
func (*CrdtState_Ormap) isCrdtState_State() {}
func (*CrdtState_Vote) isCrdtState_State() {}
func (m *CrdtState) GetState() isCrdtState_State {
if m != nil {
return m.State
}
return nil
}
func (m *CrdtState) GetGcounter() *GCounterState {
if x, ok := m.GetState().(*CrdtState_Gcounter); ok {
return x.Gcounter
}
return nil
}
func (m *CrdtState) GetPncounter() *PNCounterState {
if x, ok := m.GetState().(*CrdtState_Pncounter); ok {
return x.Pncounter
}
return nil
}
func (m *CrdtState) GetGset() *GSetState {
if x, ok := m.GetState().(*CrdtState_Gset); ok {
return x.Gset
}
return nil
}
func (m *CrdtState) GetOrset() *ORSetState {
if x, ok := m.GetState().(*CrdtState_Orset); ok {
return x.Orset
}
return nil
}
func (m *CrdtState) GetLwwregister() *LWWRegisterState {
if x, ok := m.GetState().(*CrdtState_Lwwregister); ok {
return x.Lwwregister
}
return nil
}
func (m *CrdtState) GetFlag() *FlagState {
if x, ok := m.GetState().(*CrdtState_Flag); ok {
return x.Flag
}
return nil
}
func (m *CrdtState) GetOrmap() *ORMapState {
if x, ok := m.GetState().(*CrdtState_Ormap); ok {
return x.Ormap
}
return nil
}
func (m *CrdtState) GetVote() *VoteState {
if x, ok := m.GetState().(*CrdtState_Vote); ok {
return x.Vote
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*CrdtState) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*CrdtState_Gcounter)(nil),
(*CrdtState_Pncounter)(nil),
(*CrdtState_Gset)(nil),
(*CrdtState_Orset)(nil),
(*CrdtState_Lwwregister)(nil),
(*CrdtState_Flag)(nil),
(*CrdtState_Ormap)(nil),
(*CrdtState_Vote)(nil),
}
}
// A Grow-only counter
//
// A G-Counter can only be incremented, it can't be decremented.
type GCounterState struct {
// The current value of the counter.
Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GCounterState) Reset() { *m = GCounterState{} }
func (m *GCounterState) String() string { return proto.CompactTextString(m) }
func (*GCounterState) ProtoMessage() {}
func (*GCounterState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{3}
}
func (m *GCounterState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GCounterState.Unmarshal(m, b)
}
func (m *GCounterState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GCounterState.Marshal(b, m, deterministic)
}
func (m *GCounterState) XXX_Merge(src proto.Message) {
xxx_messageInfo_GCounterState.Merge(m, src)
}
func (m *GCounterState) XXX_Size() int {
return xxx_messageInfo_GCounterState.Size(m)
}
func (m *GCounterState) XXX_DiscardUnknown() {
xxx_messageInfo_GCounterState.DiscardUnknown(m)
}
var xxx_messageInfo_GCounterState proto.InternalMessageInfo
func (m *GCounterState) GetValue() uint64 {
if m != nil {
return m.Value
}
return 0
}
// A Positive-Negative Counter
//
// A PN-Counter can be both incremented and decremented.
type PNCounterState struct {
// The current value of the counter.
Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PNCounterState) Reset() { *m = PNCounterState{} }
func (m *PNCounterState) String() string { return proto.CompactTextString(m) }
func (*PNCounterState) ProtoMessage() {}
func (*PNCounterState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{4}
}
func (m *PNCounterState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PNCounterState.Unmarshal(m, b)
}
func (m *PNCounterState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PNCounterState.Marshal(b, m, deterministic)
}
func (m *PNCounterState) XXX_Merge(src proto.Message) {
xxx_messageInfo_PNCounterState.Merge(m, src)
}
func (m *PNCounterState) XXX_Size() int {
return xxx_messageInfo_PNCounterState.Size(m)
}
func (m *PNCounterState) XXX_DiscardUnknown() {
xxx_messageInfo_PNCounterState.DiscardUnknown(m)
}
var xxx_messageInfo_PNCounterState proto.InternalMessageInfo
func (m *PNCounterState) GetValue() int64 {
if m != nil {
return m.Value
}
return 0
}
// A Grow-only Set
//
// A G-Set can only have items added, items cannot be removed.
type GSetState struct {
// The current items in the set.
Items []*any.Any `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GSetState) Reset() { *m = GSetState{} }
func (m *GSetState) String() string { return proto.CompactTextString(m) }
func (*GSetState) ProtoMessage() {}
func (*GSetState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{5}
}
func (m *GSetState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GSetState.Unmarshal(m, b)
}
func (m *GSetState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GSetState.Marshal(b, m, deterministic)
}
func (m *GSetState) XXX_Merge(src proto.Message) {
xxx_messageInfo_GSetState.Merge(m, src)
}
func (m *GSetState) XXX_Size() int {
return xxx_messageInfo_GSetState.Size(m)
}
func (m *GSetState) XXX_DiscardUnknown() {
xxx_messageInfo_GSetState.DiscardUnknown(m)
}
var xxx_messageInfo_GSetState proto.InternalMessageInfo
func (m *GSetState) GetItems() []*any.Any {
if m != nil {
return m.Items
}
return nil
}
// An Observed-Removed Set
//
// An OR-Set may have items added and removed, with the condition that an item must be observed to be in the set before
// it is removed.
type ORSetState struct {
// The current items in the set.
Items []*any.Any `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ORSetState) Reset() { *m = ORSetState{} }
func (m *ORSetState) String() string { return proto.CompactTextString(m) }
func (*ORSetState) ProtoMessage() {}
func (*ORSetState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{6}
}
func (m *ORSetState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ORSetState.Unmarshal(m, b)
}
func (m *ORSetState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ORSetState.Marshal(b, m, deterministic)
}
func (m *ORSetState) XXX_Merge(src proto.Message) {
xxx_messageInfo_ORSetState.Merge(m, src)
}
func (m *ORSetState) XXX_Size() int {
return xxx_messageInfo_ORSetState.Size(m)
}
func (m *ORSetState) XXX_DiscardUnknown() {
xxx_messageInfo_ORSetState.DiscardUnknown(m)
}
var xxx_messageInfo_ORSetState proto.InternalMessageInfo
func (m *ORSetState) GetItems() []*any.Any {
if m != nil {
return m.Items
}
return nil
}
// A Last-Write-Wins Register
//
// A LWW-Register holds a single value, with the current value being selected based on when it was last written.
// The time of the last write may either be determined using the proxies clock, or may be based on a custom, domain
// specific value.
type LWWRegisterState struct {
// The current value of the register.
Value *any.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
// The clock to use if this state needs to be merged with another one.
Clock CrdtClock `protobuf:"varint,2,opt,name=clock,proto3,enum=cloudstate.crdt.CrdtClock" json:"clock,omitempty"`
// The clock value if the clock in use is a custom clock.
CustomClockValue int64 `protobuf:"varint,3,opt,name=custom_clock_value,json=customClockValue,proto3" json:"custom_clock_value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LWWRegisterState) Reset() { *m = LWWRegisterState{} }
func (m *LWWRegisterState) String() string { return proto.CompactTextString(m) }
func (*LWWRegisterState) ProtoMessage() {}
func (*LWWRegisterState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{7}
}
func (m *LWWRegisterState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LWWRegisterState.Unmarshal(m, b)
}
func (m *LWWRegisterState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LWWRegisterState.Marshal(b, m, deterministic)
}
func (m *LWWRegisterState) XXX_Merge(src proto.Message) {
xxx_messageInfo_LWWRegisterState.Merge(m, src)
}
func (m *LWWRegisterState) XXX_Size() int {
return xxx_messageInfo_LWWRegisterState.Size(m)
}
func (m *LWWRegisterState) XXX_DiscardUnknown() {
xxx_messageInfo_LWWRegisterState.DiscardUnknown(m)
}
var xxx_messageInfo_LWWRegisterState proto.InternalMessageInfo
func (m *LWWRegisterState) GetValue() *any.Any {
if m != nil {
return m.Value
}
return nil
}
func (m *LWWRegisterState) GetClock() CrdtClock {
if m != nil {
return m.Clock
}
return CrdtClock_DEFAULT
}
func (m *LWWRegisterState) GetCustomClockValue() int64 {
if m != nil {
return m.CustomClockValue
}
return 0
}
// A Flag
//
// A Flag is a boolean value, that once set to true, stays true.
type FlagState struct {
// The current value of the flag.
Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FlagState) Reset() { *m = FlagState{} }
func (m *FlagState) String() string { return proto.CompactTextString(m) }
func (*FlagState) ProtoMessage() {}
func (*FlagState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{8}
}
func (m *FlagState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FlagState.Unmarshal(m, b)
}
func (m *FlagState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FlagState.Marshal(b, m, deterministic)
}
func (m *FlagState) XXX_Merge(src proto.Message) {
xxx_messageInfo_FlagState.Merge(m, src)
}
func (m *FlagState) XXX_Size() int {
return xxx_messageInfo_FlagState.Size(m)
}
func (m *FlagState) XXX_DiscardUnknown() {
xxx_messageInfo_FlagState.DiscardUnknown(m)
}
var xxx_messageInfo_FlagState proto.InternalMessageInfo
func (m *FlagState) GetValue() bool {
if m != nil {
return m.Value
}
return false
}
// An Observed-Removed Map
//
// Like an OR-Set, an OR-Map may have items added and removed, with the condition that an item must be observed to be
// in the map before it is removed. The values of the map are CRDTs themselves. Different keys are allowed to use
// different CRDTs, and if an item is removed, and then replaced, the new value may be a different CRDT.
type ORMapState struct {
// The entries of the map.
Entries []*ORMapEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ORMapState) Reset() { *m = ORMapState{} }
func (m *ORMapState) String() string { return proto.CompactTextString(m) }
func (*ORMapState) ProtoMessage() {}
func (*ORMapState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{9}
}
func (m *ORMapState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ORMapState.Unmarshal(m, b)
}
func (m *ORMapState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ORMapState.Marshal(b, m, deterministic)
}
func (m *ORMapState) XXX_Merge(src proto.Message) {
xxx_messageInfo_ORMapState.Merge(m, src)
}
func (m *ORMapState) XXX_Size() int {
return xxx_messageInfo_ORMapState.Size(m)
}
func (m *ORMapState) XXX_DiscardUnknown() {
xxx_messageInfo_ORMapState.DiscardUnknown(m)
}
var xxx_messageInfo_ORMapState proto.InternalMessageInfo
func (m *ORMapState) GetEntries() []*ORMapEntry {
if m != nil {
return m.Entries
}
return nil
}
// An OR-Map entry.
type ORMapEntry struct {
// The entry key.
Key *any.Any `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// The value of the entry, a CRDT itself.
Value *CrdtState `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ORMapEntry) Reset() { *m = ORMapEntry{} }
func (m *ORMapEntry) String() string { return proto.CompactTextString(m) }
func (*ORMapEntry) ProtoMessage() {}
func (*ORMapEntry) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{10}
}
func (m *ORMapEntry) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ORMapEntry.Unmarshal(m, b)
}
func (m *ORMapEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ORMapEntry.Marshal(b, m, deterministic)
}
func (m *ORMapEntry) XXX_Merge(src proto.Message) {
xxx_messageInfo_ORMapEntry.Merge(m, src)
}
func (m *ORMapEntry) XXX_Size() int {
return xxx_messageInfo_ORMapEntry.Size(m)
}
func (m *ORMapEntry) XXX_DiscardUnknown() {
xxx_messageInfo_ORMapEntry.DiscardUnknown(m)
}
var xxx_messageInfo_ORMapEntry proto.InternalMessageInfo
func (m *ORMapEntry) GetKey() *any.Any {
if m != nil {
return m.Key
}
return nil
}
func (m *ORMapEntry) GetValue() *CrdtState {
if m != nil {
return m.Value
}
return nil
}
// A Vote. This allows nodes to vote on something.
type VoteState struct {
// The number of votes for
VotesFor uint32 `protobuf:"varint,1,opt,name=votes_for,json=votesFor,proto3" json:"votes_for,omitempty"`
// The total number of voters
TotalVoters uint32 `protobuf:"varint,2,opt,name=total_voters,json=totalVoters,proto3" json:"total_voters,omitempty"`
// The vote of the current node, which is included in the above two numbers
SelfVote bool `protobuf:"varint,3,opt,name=self_vote,json=selfVote,proto3" json:"self_vote,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *VoteState) Reset() { *m = VoteState{} }
func (m *VoteState) String() string { return proto.CompactTextString(m) }
func (*VoteState) ProtoMessage() {}
func (*VoteState) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{11}
}
func (m *VoteState) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_VoteState.Unmarshal(m, b)
}
func (m *VoteState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_VoteState.Marshal(b, m, deterministic)
}
func (m *VoteState) XXX_Merge(src proto.Message) {
xxx_messageInfo_VoteState.Merge(m, src)
}
func (m *VoteState) XXX_Size() int {
return xxx_messageInfo_VoteState.Size(m)
}
func (m *VoteState) XXX_DiscardUnknown() {
xxx_messageInfo_VoteState.DiscardUnknown(m)
}
var xxx_messageInfo_VoteState proto.InternalMessageInfo
func (m *VoteState) GetVotesFor() uint32 {
if m != nil {
return m.VotesFor
}
return 0
}
func (m *VoteState) GetTotalVoters() uint32 {
if m != nil {
return m.TotalVoters
}
return 0
}
func (m *VoteState) GetSelfVote() bool {
if m != nil {
return m.SelfVote
}
return false
}
// A CRDT delta
//
// Deltas only carry the change in value, not the full value (unless
type CrdtDelta struct {
// Types that are valid to be assigned to Delta:
// *CrdtDelta_Gcounter
// *CrdtDelta_Pncounter
// *CrdtDelta_Gset
// *CrdtDelta_Orset
// *CrdtDelta_Lwwregister
// *CrdtDelta_Flag
// *CrdtDelta_Ormap
// *CrdtDelta_Vote
Delta isCrdtDelta_Delta `protobuf_oneof:"delta"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CrdtDelta) Reset() { *m = CrdtDelta{} }
func (m *CrdtDelta) String() string { return proto.CompactTextString(m) }
func (*CrdtDelta) ProtoMessage() {}
func (*CrdtDelta) Descriptor() ([]byte, []int) {
return fileDescriptor_0c2f7bf98db4e2cd, []int{12}
}
func (m *CrdtDelta) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CrdtDelta.Unmarshal(m, b)
}
func (m *CrdtDelta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CrdtDelta.Marshal(b, m, deterministic)
}
func (m *CrdtDelta) XXX_Merge(src proto.Message) {
xxx_messageInfo_CrdtDelta.Merge(m, src)
}
func (m *CrdtDelta) XXX_Size() int {
return xxx_messageInfo_CrdtDelta.Size(m)
}
func (m *CrdtDelta) XXX_DiscardUnknown() {
xxx_messageInfo_CrdtDelta.DiscardUnknown(m)
}
var xxx_messageInfo_CrdtDelta proto.InternalMessageInfo
type isCrdtDelta_Delta interface {
isCrdtDelta_Delta()
}
type CrdtDelta_Gcounter struct {
Gcounter *GCounterDelta `protobuf:"bytes,1,opt,name=gcounter,proto3,oneof"`