2019-10-11 16:08:50 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package go.micro.store;
|
|
|
|
|
|
|
|
service Store {
|
2019-10-24 00:05:39 +03:00
|
|
|
rpc List(ListRequest) returns (stream ListResponse) {};
|
2019-10-11 16:08:50 +03:00
|
|
|
rpc Read(ReadRequest) returns (ReadResponse) {};
|
|
|
|
rpc Write(WriteRequest) returns (WriteResponse) {};
|
|
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse) {};
|
|
|
|
}
|
|
|
|
|
|
|
|
message Record {
|
|
|
|
// key of the record
|
|
|
|
string key = 1;
|
|
|
|
// value in the record
|
|
|
|
bytes value = 2;
|
|
|
|
// timestamp in unix seconds
|
|
|
|
int64 expiry = 3;
|
|
|
|
}
|
|
|
|
|
2020-01-09 01:23:14 +03:00
|
|
|
message ReadOptions {
|
|
|
|
bool prefix = 1;
|
|
|
|
}
|
|
|
|
|
2019-10-11 16:08:50 +03:00
|
|
|
message ReadRequest {
|
2020-01-09 01:23:14 +03:00
|
|
|
string key = 1;
|
|
|
|
ReadOptions options = 2;
|
2019-10-11 16:08:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message ReadResponse {
|
|
|
|
repeated Record records = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteRequest {
|
2020-01-09 01:23:14 +03:00
|
|
|
Record record = 1;
|
2019-10-11 16:08:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message WriteResponse {}
|
|
|
|
|
|
|
|
message DeleteRequest {
|
2020-01-09 01:23:14 +03:00
|
|
|
string key = 1;
|
2019-10-11 16:08:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteResponse {}
|
|
|
|
|
2020-01-09 01:23:14 +03:00
|
|
|
message ListRequest {}
|
2019-10-11 16:08:50 +03:00
|
|
|
|
2019-10-24 00:05:39 +03:00
|
|
|
message ListResponse {
|
2019-10-11 16:08:50 +03:00
|
|
|
repeated Record records = 1;
|
|
|
|
}
|