1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: neton.proto
3 
4 module neton.protocol.neton;
5 
6 import google.protobuf;
7 
8 enum protocVersion = 3012003;
9 
10 class KeyValue
11 {
12     @Proto(1) bytes key = protoDefaultValue!bytes;
13     @Proto(2) long createRevision = protoDefaultValue!long;
14     @Proto(3) long modRevision = protoDefaultValue!long;
15     @Proto(4) long version_ = protoDefaultValue!long;
16     @Proto(5) bytes value = protoDefaultValue!bytes;
17     @Proto(6) long lease = protoDefaultValue!long;
18 }
19 
20 class Event
21 {
22     @Proto(1) EventType type = protoDefaultValue!EventType;
23     @Proto(2) KeyValue kv = protoDefaultValue!KeyValue;
24     @Proto(3) KeyValue prevKv = protoDefaultValue!KeyValue;
25 
26     enum EventType
27     {
28         PUT = 0,
29         DELETE = 1,
30     }
31 }
32 
33 class ResponseHeader
34 {
35     @Proto(1) ulong clusterId = protoDefaultValue!ulong;
36     @Proto(2) ulong memberId = protoDefaultValue!ulong;
37     @Proto(3) long revision = protoDefaultValue!long;
38     @Proto(4) ulong raftTerm = protoDefaultValue!ulong;
39 }
40 
41 class RangeRequest
42 {
43     @Proto(1) bytes key = protoDefaultValue!bytes;
44     @Proto(2) bytes rangeEnd = protoDefaultValue!bytes;
45     @Proto(3) long limit = protoDefaultValue!long;
46     @Proto(4) long revision = protoDefaultValue!long;
47     @Proto(5) SortOrder sortOrder = protoDefaultValue!SortOrder;
48     @Proto(6) SortTarget sortTarget = protoDefaultValue!SortTarget;
49     @Proto(7) bool serializable = protoDefaultValue!bool;
50     @Proto(8) bool keysOnly = protoDefaultValue!bool;
51     @Proto(9) bool countOnly = protoDefaultValue!bool;
52     @Proto(10) long minModRevision = protoDefaultValue!long;
53     @Proto(11) long maxModRevision = protoDefaultValue!long;
54     @Proto(12) long minCreateRevision = protoDefaultValue!long;
55     @Proto(13) long maxCreateRevision = protoDefaultValue!long;
56 
57     enum SortOrder
58     {
59         NONE = 0,
60         ASCEND = 1,
61         DESCEND = 2,
62     }
63 
64     enum SortTarget
65     {
66         KEY = 0,
67         VERSION = 1,
68         CREATE = 2,
69         MOD = 3,
70         VALUE = 4,
71     }
72 }
73 
74 class RangeResponse
75 {
76     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
77     @Proto(2) KeyValue[] kvs = protoDefaultValue!(KeyValue[]);
78     @Proto(3) bool more = protoDefaultValue!bool;
79     @Proto(4) long count = protoDefaultValue!long;
80 }
81 
82 class PutRequest
83 {
84     @Proto(1) bytes key = protoDefaultValue!bytes;
85     @Proto(2) bytes value = protoDefaultValue!bytes;
86     @Proto(3) long lease = protoDefaultValue!long;
87     @Proto(4) bool prevKv = protoDefaultValue!bool;
88     @Proto(5) bool ignoreValue = protoDefaultValue!bool;
89     @Proto(6) bool ignoreLease = protoDefaultValue!bool;
90 }
91 
92 class PutResponse
93 {
94     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
95     @Proto(2) KeyValue prevKv = protoDefaultValue!KeyValue;
96 }
97 
98 class DeleteRangeRequest
99 {
100     @Proto(1) bytes key = protoDefaultValue!bytes;
101     @Proto(2) bytes rangeEnd = protoDefaultValue!bytes;
102     @Proto(3) bool prevKv = protoDefaultValue!bool;
103 }
104 
105 class DeleteRangeResponse
106 {
107     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
108     @Proto(2) long deleted = protoDefaultValue!long;
109     @Proto(3) KeyValue[] prevKvs = protoDefaultValue!(KeyValue[]);
110 }
111 
112 class WatchRequest
113 {
114     enum RequestUnionCase
115     {
116         requestUnionNotSet = 0,
117         createRequest = 1,
118         cancelRequest = 2,
119     }
120     RequestUnionCase _requestUnionCase = RequestUnionCase.requestUnionNotSet;
121     @property RequestUnionCase requestUnionCase() { return _requestUnionCase; }
122     void clearRequestUnion() { _requestUnionCase = RequestUnionCase.requestUnionNotSet; }
123     @Oneof("_requestUnionCase") union
124     {
125         @Proto(1) WatchCreateRequest _createRequest = protoDefaultValue!WatchCreateRequest; mixin(oneofAccessors!_createRequest);
126         @Proto(2) WatchCancelRequest _cancelRequest; mixin(oneofAccessors!_cancelRequest);
127     }
128 }
129 
130 class WatchCreateRequest
131 {
132     @Proto(1) bytes key = protoDefaultValue!bytes;
133     @Proto(2) bytes rangeEnd = protoDefaultValue!bytes;
134     @Proto(3) long startRevision = protoDefaultValue!long;
135     @Proto(4) bool progressNotify = protoDefaultValue!bool;
136     @Proto(5) FilterType[] filters = protoDefaultValue!(FilterType[]);
137     @Proto(6) bool prevKv = protoDefaultValue!bool;
138     @Proto(7) long watchId = protoDefaultValue!long;
139     @Proto(8) bool fragment = protoDefaultValue!bool;
140 
141     enum FilterType
142     {
143         NOPUT = 0,
144         NODELETE = 1,
145     }
146 }
147 
148 class WatchCancelRequest
149 {
150     @Proto(1) long watchId = protoDefaultValue!long;
151 }
152 
153 class WatchProgressRequest
154 {
155 }
156 
157 class WatchResponse
158 {
159     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
160     @Proto(2) long watchId = protoDefaultValue!long;
161     @Proto(3) bool created = protoDefaultValue!bool;
162     @Proto(4) bool canceled = protoDefaultValue!bool;
163     @Proto(5) long compactRevision = protoDefaultValue!long;
164     @Proto(6) string cancelReason = protoDefaultValue!string;
165     @Proto(7) bool fragment = protoDefaultValue!bool;
166     @Proto(11) Event[] events = protoDefaultValue!(Event[]);
167 }
168 
169 class LeaseGrantRequest
170 {
171     @Proto(1) long TTL = protoDefaultValue!long;
172     @Proto(2) long ID = protoDefaultValue!long;
173 }
174 
175 class LeaseGrantResponse
176 {
177     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
178     @Proto(2) long ID = protoDefaultValue!long;
179     @Proto(3) long TTL = protoDefaultValue!long;
180     @Proto(4) string error = protoDefaultValue!string;
181 }
182 
183 class LeaseRevokeRequest
184 {
185     @Proto(1) long ID = protoDefaultValue!long;
186 }
187 
188 class LeaseRevokeResponse
189 {
190     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
191 }
192 
193 class LeaseCheckpoint
194 {
195     @Proto(1) long ID = protoDefaultValue!long;
196     @Proto(2) long remainingTTL = protoDefaultValue!long;
197 }
198 
199 class LeaseCheckpointRequest
200 {
201     @Proto(1) LeaseCheckpoint[] checkpoints = protoDefaultValue!(LeaseCheckpoint[]);
202 }
203 
204 class LeaseCheckpointResponse
205 {
206     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
207 }
208 
209 class LeaseKeepAliveRequest
210 {
211     @Proto(1) long ID = protoDefaultValue!long;
212 }
213 
214 class LeaseKeepAliveResponse
215 {
216     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
217     @Proto(2) long ID = protoDefaultValue!long;
218     @Proto(3) long TTL = protoDefaultValue!long;
219 }
220 
221 class LeaseTimeToLiveRequest
222 {
223     @Proto(1) long ID = protoDefaultValue!long;
224     @Proto(2) bool keys = protoDefaultValue!bool;
225 }
226 
227 class LeaseTimeToLiveResponse
228 {
229     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
230     @Proto(2) long ID = protoDefaultValue!long;
231     @Proto(3) long TTL = protoDefaultValue!long;
232     @Proto(4) long grantedTTL = protoDefaultValue!long;
233     @Proto(5) bytes[] keys = protoDefaultValue!(bytes[]);
234 }
235 
236 class LeaseLeasesRequest
237 {
238 }
239 
240 class LeaseStatus
241 {
242     @Proto(1) long ID = protoDefaultValue!long;
243 }
244 
245 class LeaseLeasesResponse
246 {
247     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
248     @Proto(2) LeaseStatus[] leases = protoDefaultValue!(LeaseStatus[]);
249 }
250 
251 class Member
252 {
253     @Proto(1) ulong ID = protoDefaultValue!ulong;
254     @Proto(2) string name = protoDefaultValue!string;
255     @Proto(3) string[] peerURLs = protoDefaultValue!(string[]);
256     @Proto(4) string[] clientURLs = protoDefaultValue!(string[]);
257 }
258 
259 class MemberAddRequest
260 {
261     @Proto(1) string[] peerURLs = protoDefaultValue!(string[]);
262 }
263 
264 class MemberAddResponse
265 {
266     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
267     @Proto(2) Member member = protoDefaultValue!Member;
268     @Proto(3) Member[] members = protoDefaultValue!(Member[]);
269 }
270 
271 class MemberRemoveRequest
272 {
273     @Proto(1) ulong ID = protoDefaultValue!ulong;
274 }
275 
276 class MemberRemoveResponse
277 {
278     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
279     @Proto(2) Member[] members = protoDefaultValue!(Member[]);
280 }
281 
282 class MemberUpdateRequest
283 {
284     @Proto(1) ulong ID = protoDefaultValue!ulong;
285     @Proto(2) string[] peerURLs = protoDefaultValue!(string[]);
286 }
287 
288 class MemberUpdateResponse
289 {
290     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
291     @Proto(2) Member[] members = protoDefaultValue!(Member[]);
292 }
293 
294 class MemberListRequest
295 {
296 }
297 
298 class MemberListResponse
299 {
300     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
301     @Proto(2) Member[] members = protoDefaultValue!(Member[]);
302 }
303 
304 class DefragmentRequest
305 {
306 }
307 
308 class DefragmentResponse
309 {
310     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
311 }
312 
313 class MoveLeaderRequest
314 {
315     @Proto(1) ulong targetID = protoDefaultValue!ulong;
316 }
317 
318 class MoveLeaderResponse
319 {
320     @Proto(1) ResponseHeader header = protoDefaultValue!ResponseHeader;
321 }