go-judge/pb/judge.proto

40 lines
1.3 KiB
Protocol Buffer

edition = "2023";
package pb;
option features.field_presence = IMPLICIT;
option go_package = "github.com/criyle/go-judge/pb";
option features.(pb.go).api_level = API_HYBRID;
import "google/protobuf/empty.proto";
import "request.proto";
import "response.proto";
import "stream_request.proto";
import "stream_response.proto";
import "file.proto";
import "google/protobuf/go_features.proto";
service Executor {
// Exec defines unary RPC to run a program with resource limitations
rpc Exec(Request) returns (Response);
// ExecStream defines streaming RPC to run a program with real-time input &
// output. The first request must be execRequest and the following request
// must be execInput. The last response must be execResponse and the others
// are execOutput. TTY attribute will create single pty for the program thus
// stdout & stderr should have same name
rpc ExecStream(stream StreamRequest) returns (stream StreamResponse);
// FileList lists all files available in the file store
rpc FileList(google.protobuf.Empty) returns (FileListType);
// FileGet download the file from the file store
rpc FileGet(FileID) returns (FileContent);
// FileAdd create a file into the file store
rpc FileAdd(FileContent) returns (FileID);
// FileDelete deletes a file from the file store
rpc FileDelete(FileID) returns (google.protobuf.Empty);
};