Line data Source code
1 : #pragma once
2 :
3 : #include <prefixdb/api/common_status.hpp>
4 : #include <prefixdb/api/fields.hpp>
5 : #include <memory>
6 : #include <string>
7 :
8 : namespace wamba { namespace prefixdb {
9 :
10 : namespace request
11 : {
12 0 : struct setnx
13 : {
14 :
15 : bool sync = false;
16 : bool nores = true;
17 : bool noval = false;
18 : std::string prefix;
19 : field_list_t fields;
20 : // Только для noval=false, пишет в базу, а значение из snapshot_id
21 : size_t snapshot = 0;
22 : typedef std::unique_ptr<setnx> ptr;
23 : };
24 : }
25 :
26 : namespace response
27 : {
28 0 : struct setnx
29 : {
30 : common_status status = common_status::OK;
31 : std::string prefix;
32 : field_list_t fields;
33 :
34 : typedef std::unique_ptr<setnx> ptr;
35 : typedef std::function< void(ptr) > handler;
36 : };
37 :
38 : }
39 :
40 : }}
|