-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.proto
43 lines (37 loc) · 914 Bytes
/
log.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
syntax = "proto3";
package log.v1;
option go_package = "github.com/anshulsood11/api/log_v1";
message Record {
bytes value = 1;
uint64 offset = 2;
uint64 term = 3;
uint32 type = 4;
}
service Log {
rpc Produce(ProduceRequest) returns (ProduceResponse) {}
rpc Consume(ConsumeRequest) returns (ConsumeResponse) {}
rpc ConsumeStream(ConsumeRequest) returns (stream ConsumeResponse) {}
rpc ProduceStream(stream ProduceRequest) returns (stream ProduceResponse) {}
rpc GetServers(GetServersRequest) returns (GetServersResponse) {}
}
message ProduceRequest {
Record record = 1;
}
message ProduceResponse {
uint64 offset = 1;
}
message ConsumeRequest {
uint64 offset = 1;
}
message ConsumeResponse {
Record record = 1;
}
message GetServersRequest {}
message GetServersResponse {
repeated Server servers = 1;
}
message Server {
string id = 1;
string rpc_addr = 2;
bool is_leader = 3;
}