-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathlocket.proto
54 lines (42 loc) · 922 Bytes
/
locket.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
syntax = "proto3";
package models;
service Locket {
rpc Lock(LockRequest) returns (LockResponse) {}
rpc Fetch(FetchRequest) returns (FetchResponse) {}
rpc Release(ReleaseRequest) returns (ReleaseResponse) {}
rpc FetchAll(FetchAllRequest) returns (FetchAllResponse) {}
}
enum TypeCode {
UNKNOWN = 0;
LOCK = 1;
PRESENCE = 2;
}
message Resource {
string key = 1;
string owner = 2;
string value = 3;
string type = 4 [deprecated=true];
TypeCode type_code = 5;
}
message LockRequest {
Resource resource = 1;
int64 ttl_in_seconds = 2;
}
message LockResponse {}
message ReleaseRequest {
Resource resource = 1;
}
message ReleaseResponse {}
message FetchRequest {
string key = 1;
}
message FetchResponse {
Resource resource = 1;
}
message FetchAllRequest {
string type = 1 [deprecated=true];
TypeCode type_code = 2;
}
message FetchAllResponse {
repeated Resource resources = 1;
}