-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathkyototycoon.idl
113 lines (108 loc) · 4.4 KB
/
kyototycoon.idl
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
/*************************************************************************************************
* IDL for bindings of scripting languages
* Copyright (C) 2009-2012 FAL Labs
* This file is part of Kyoto Tycoon.
* This program is free software: you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation, either version
* 3 of the License, or any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*************************************************************************************************/
/**
* namespace of Kyoto Tycoon
*/
module kyototycoon {
//----------------------------------------------------------------
// prediction
//----------------------------------------------------------------
interface List;
interface Map;
interface Error;
interface Cursor;
interface DB;
//----------------------------------------------------------------
// list of strings (substituted by the native mechanism)
//----------------------------------------------------------------
interface List {
string get(in long index);
};
//----------------------------------------------------------------
// map of strings (substituted by the native mechanism)
//----------------------------------------------------------------
interface Map {
string get(in string key);
};
//----------------------------------------------------------------
// error information
//----------------------------------------------------------------
interface Error {
const long SUCCESS = 0;
const long NOIMPL = 1;
const long INVALID = 2;
const long LOGIC = 3;
const long INTERNAL = 4;
const long NETWORK = 5;
const long EMISC = 15;
long code();
string name();
string message();
};
//----------------------------------------------------------------
// cursor
//----------------------------------------------------------------
interface Cursor {
boolean set_value(in string value, in long long xt, in boolean step);
boolean remove();
string get_key(in boolean step);
string get_value(in boolean step);
boolean jump();
boolean jump_(in string key);
boolean jump_back();
boolean jump_back_(in string key);
boolean step();
boolean step_back();
DB db();
Error error();
};
//----------------------------------------------------------------
// common database operations
//----------------------------------------------------------------
interface DB {
Error error();
boolean open(in string host, in long port, in double timeout);
boolean close();
Map report();
Map play_script(in string name, in Map args);
boolean tune_replication(in string host, in long port, in long long ts, in double iv);
List ulog_list();
boolean ulog_remove(in long long ts);
Map status();
boolean clear();
long long count();
long long size();
boolean set(in string key, in string value, in long long xt);
boolean add(in string key, in string value, in long long xt);
boolean replace(in string key, in string value, in long long xt);
boolean append(in string key, in string value, in long long xt);
long long increment(in string key, in long long num, in long long orig, in long long xt);
double increment_double(in string key, in double num, in double orig, in long long xt);
boolean cas(in string key, in string oval, in string nval, in long long xt);
boolean remove(in string key);
string get(in string key);
string seize(in string key);
long long set_bulk(in Map recs, in long long xt);
long long remove_bulk(in List keys);
Map get_bulk(in List keys);
boolean vacuum(in long long steps);
List match_prefix(in string prefix, in long long max);
List match_regex(in string regex, in long long max);
List match_similar(in string origin, in long long range, in boolean utf, in long long max);
void set_target(in string expr);
string expression();
Cursor cursor();
};
};
/* END OF FILE */