syntax = "proto3";

service LevelDB {
  rpc Get (GetRequest) returns (GetReply);
  rpc Put (PutRequest) returns (PutReply);
  rpc Delete (DeleteRequest) returns (DeleteReply);
  rpc BatchPut (BatchPutRequest) returns (BatchPutReply);
  rpc Iterator (IteratorRequest) returns (stream IteratorReply);
}

message PutRequest {
  bytes key = 1;
  bytes value = 2;
}

message PutReply {}

message GetRequest {
  bytes key = 1;
}

message GetReply {
  bytes value = 1;
}

message DeleteRequest {
  bytes key = 1;
}

message DeleteReply {}

message BatchPutItem {
  bytes key = 2;
  bytes value = 3;
}

message BatchPutRequest {
  repeated BatchPutItem items = 1;
}

message BatchPutReply {}

message IteratorRequest {
  bytes gte = 1;
  bytes lte = 2;
  sint32 limit = 3;
  bool reverse = 4;
}

message IteratorReply {
  bytes key = 1;
  bytes value = 2;
}