-
Notifications
You must be signed in to change notification settings - Fork 0
/
hashring.proto
47 lines (36 loc) · 868 Bytes
/
hashring.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
//protoc hashring.proto --go-grpc_out=./ --go_out=./
syntax = "proto3";
import "google/protobuf/empty.proto";
option go_package = "./proto";
message Key {
string key = 1;
}
message Data {
bool found = 1;
optional string data =2;
}
message KeyData {
string key = 1;
string data = 2;
}
message UpdateStatus {
bool ok = 1;
optional string err = 2;
}
message Node {
string host = 1;
uint32 port = 2;
}
message NodeList {
repeated Node node = 1;
}
service HashStore {
rpc Get( Key) returns ( Data) {}
rpc Put( KeyData) returns (UpdateStatus) {}
rpc Remove( Key) returns (UpdateStatus) {}
}
service NodeStatus {
rpc AddNode( Node ) returns ( google.protobuf.Empty ) {}
rpc GetNodeList( google.protobuf.Empty ) returns (NodeList) {}
rpc RemoveNode(Node ) returns ( google.protobuf.Empty) {}
}