-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkv.proto
63 lines (51 loc) · 1.25 KB
/
kv.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
syntax = "proto3";
package kv_pb;
import "google/api/annotations.proto";
import "google/api/http.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "protoc-gen-openapiv2/options/openapiv2.proto";
option go_package = "github.com/escalopa/raft-kv/pkg/kv";
service KVService {
rpc Get(GetRequest) returns (GetResponse){
option (google.api.http) = {
get: "/kv/{key}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
description: "Get a value by key"
};
}
rpc Set(SetRequest) returns (SetResponse){
option (google.api.http) = {
post: "/kv"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
description: "Set a value by key"
};
}
rpc Del(DelRequest) returns (DelResponse){
option (google.api.http) = {
delete: "/kv/{key}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
description: "Delete a value by key"
};
}
}
message GetRequest {
string key = 1;
}
message GetResponse {
string value = 1;
}
message SetRequest {
string key = 1;
string value = 2;
}
message SetResponse {
}
message DelRequest {
string key = 1;
}
message DelResponse {
}