2020-05-11 14:08:27 +02:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package go.micro.server;
|
|
|
|
|
|
|
|
service File {
|
|
|
|
rpc Open(OpenRequest) returns(OpenResponse) {};
|
|
|
|
rpc Stat(StatRequest) returns(StatResponse) {};
|
|
|
|
rpc Read(ReadRequest) returns(ReadResponse) {};
|
|
|
|
rpc Write(WriteRequest) returns(WriteResponse) {};
|
|
|
|
rpc Close(CloseRequest) returns(CloseResponse) {};
|
|
|
|
}
|
|
|
|
|
|
|
|
message OpenRequest {
|
|
|
|
string filename = 1;
|
2020-05-13 12:07:53 +02:00
|
|
|
bool truncate = 2;
|
2020-05-11 14:08:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message OpenResponse {
|
|
|
|
int64 id = 1;
|
|
|
|
bool result = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CloseRequest {
|
|
|
|
int64 id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message CloseResponse {
|
|
|
|
}
|
|
|
|
|
|
|
|
message StatRequest {
|
|
|
|
string filename = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StatResponse {
|
|
|
|
string type = 1;
|
|
|
|
int64 size = 2;
|
|
|
|
int64 last_modified = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ReadRequest {
|
|
|
|
int64 id = 1;
|
|
|
|
int64 offset = 2;
|
|
|
|
int64 size = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ReadResponse {
|
|
|
|
int64 size = 1;
|
|
|
|
bytes data = 2;
|
|
|
|
bool eof = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetRequest {
|
|
|
|
int64 id = 1;
|
|
|
|
int64 block_id = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetResponse {
|
|
|
|
int64 block_id = 1;
|
|
|
|
int64 size = 2;
|
|
|
|
bytes data = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteRequest {
|
|
|
|
int64 id = 1;
|
|
|
|
int64 offset = 2;
|
|
|
|
bytes data = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteResponse {}
|