File: replication.proto

package info (click to toggle)
weakforced 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,040 kB
  • sloc: cpp: 20,397; python: 2,002; sh: 700; makefile: 432
file content (61 lines) | stat: -rw-r--r-- 1,412 bytes parent folder | download
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
// replication.proto
// Neil Cook <neil.cook@open-xchange.com>
// (C) Open-Xchange 2016
//
// Protobuf definitions for replication of weakforce DBs
// This is somewhat similar to a CmRDT except that currently
// weakforced uses UDP rather than a "safe" transport like TCP

syntax = "proto2";

message SDBOperation {
  required string db_name = 1;
  enum SDBOpType {
    SDBOpAdd = 0;
    SDBOpSub = 1;
    SDBOpReset = 2;
    SDBOpResetField = 3;
    SDBOpSyncKey = 4;
    SDBOpNone = 999;
  }
  message SDBTimeWindow {
    required uint64 timestamp = 1;
    required bytes tw_string = 2;
  }
  message SDBSyncField {
    required bytes field_name = 1;
    required uint64 start_time = 2; 
    repeated SDBTimeWindow time_windows = 3;
  }
  required SDBOpType op_type = 2;
  required bytes key = 3;
  optional bytes field_name = 4;
  optional bytes str_param = 5;
  optional uint32 int_param = 6;
  repeated SDBSyncField sync_fields = 7;
}

message BLOperation {
  enum BLOpType {
    BLAdd = 0;
    BLDelete = 1;
    BLNone = 999;
  }
  required BLOpType op_type = 1;
  required uint32 type = 2;
  required bytes key = 3;
  optional uint32 ttl = 4;
  optional bytes reason = 5;
}

message WforceReplicationMsg {
  enum RepType {
    SDBType = 0;
    BlacklistType = 1;
    WhitelistType = 2;
    NoneType = 999;
  }
  required RepType rep_type = 1;
  required bytes rep_op = 2;
  optional bool forwarded = 3;
}