-
Notifications
You must be signed in to change notification settings - Fork 0
/
honey_badger.proto
89 lines (71 loc) · 1.68 KB
/
honey_badger.proto
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
syntax = "proto3";
import "google/protobuf/empty.proto";
option go_package = "github.com/honey-badger-io/honey-badger/pb";
package hb;
service Data {
rpc Set(SetRequest) returns (google.protobuf.Empty) {}
rpc Get(KeyRequest) returns (GetResult) {}
rpc Delete(KeyRequest) returns (google.protobuf.Empty) {}
rpc DeleteByPrefix(PrefixRequest) returns (google.protobuf.Empty) {}
rpc CreateReadStream(ReadStreamReq) returns (stream DataItem) {}
rpc CreateSendStream(stream SendStreamReq) returns (google.protobuf.Empty) {}
}
service Db {
rpc Create(CreateDbReq) returns (google.protobuf.Empty) {}
rpc Drop(DropDbRequest) returns (google.protobuf.Empty) {}
rpc Exists(ExistsDbReq) returns (ExistsDbRes) {}
rpc EnsureDb(CreateDbReq) returns (google.protobuf.Empty) {}
}
service Sys {
rpc Ping(PingRequest) returns (PingResult) {}
}
message SetRequest {
string db = 1;
string key = 2;
bytes data = 3;
optional int32 ttl = 4;
}
message KeyRequest {
string db = 1;
string key = 2;
}
message GetResult {
bool hit = 1;
bytes data = 2;
}
message PrefixRequest {
string db = 1;
string prefix = 2;
}
message CreateDbOpt {
bool inMemory = 1;
}
message CreateDbReq {
string name = 1;
CreateDbOpt opt = 2;
}
message DropDbRequest {
string name = 1;
}
message PingRequest {}
message PingResult {
string mesage = 1;
}
message ReadStreamReq {
string db = 1;
optional string prefix = 2;
}
message SendStreamReq {
DataItem item = 1;
string db = 2;
}
message DataItem {
string key = 1;
bytes data = 2;
}
message ExistsDbReq {
string name = 1;
}
message ExistsDbRes {
bool exists = 1;
}