49 lines
815 B
Protocol Buffer
49 lines
815 B
Protocol Buffer
|
syntax = "proto3";
|
||
|
|
||
|
package go.micro.store;
|
||
|
|
||
|
service Store {
|
||
|
rpc Read(ReadRequest) returns (ReadResponse) {};
|
||
|
rpc Write(WriteRequest) returns (WriteResponse) {};
|
||
|
rpc Delete(DeleteRequest) returns (DeleteResponse) {};
|
||
|
rpc Sync(SyncRequest) returns (stream SyncResponse) {};
|
||
|
}
|
||
|
|
||
|
message Record {
|
||
|
// key of the record
|
||
|
string key = 1;
|
||
|
// value in the record
|
||
|
bytes value = 2;
|
||
|
// timestamp in unix seconds
|
||
|
int64 expiry = 3;
|
||
|
}
|
||
|
|
||
|
message ReadRequest {
|
||
|
repeated string keys = 1;
|
||
|
}
|
||
|
|
||
|
message ReadResponse {
|
||
|
repeated Record records = 1;
|
||
|
}
|
||
|
|
||
|
message WriteRequest {
|
||
|
repeated Record records = 2;
|
||
|
}
|
||
|
|
||
|
message WriteResponse {}
|
||
|
|
||
|
message DeleteRequest {
|
||
|
repeated string keys = 1;
|
||
|
}
|
||
|
|
||
|
message DeleteResponse {}
|
||
|
|
||
|
message SyncRequest {
|
||
|
// optional key
|
||
|
string key = 1;
|
||
|
}
|
||
|
|
||
|
message SyncResponse {
|
||
|
repeated Record records = 1;
|
||
|
}
|