executor.proto 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. syntax = "proto3";
  2. package apis;
  3. message Command {
  4. bytes path = 1;
  5. repeated bytes args = 2;
  6. repeated bytes env = 3;
  7. bytes dir = 4;
  8. }
  9. message Input {
  10. uint32 sn = 1;
  11. bytes input = 2;
  12. }
  13. message Stdout {
  14. bytes stdout = 1;
  15. bool closed = 2;
  16. bytes runtime_error = 3;
  17. bool start = 4;
  18. }
  19. message Stderr {
  20. bytes stderr = 1;
  21. bool closed = 2;
  22. bytes runtime_error = 3;
  23. bool start = 4;
  24. }
  25. message StartResponse {
  26. bool success = 1;
  27. bytes error = 2;
  28. }
  29. message WaitCommand {
  30. uint32 sn = 1;
  31. }
  32. message WaitResponse {
  33. uint32 exit_status = 1;
  34. bytes err_content = 2;
  35. }
  36. message Sn {
  37. uint32 sn = 1;
  38. }
  39. message StartInput {
  40. uint32 sn = 1;
  41. bool has_stdin = 2;
  42. bool has_stdout = 3;
  43. bool has_stderr = 4;
  44. }
  45. message Error {
  46. bytes error = 1;
  47. }
  48. service Executor {
  49. rpc SendInput(stream Input) returns (Error);
  50. rpc FetchStdout(Sn) returns (stream Stdout);
  51. rpc FetchStderr(Sn) returns (stream Stderr);
  52. rpc Start(StartInput) returns (StartResponse);
  53. rpc Wait(Sn) returns (WaitResponse);
  54. rpc ExecCommand(Command) returns (Sn);
  55. rpc Kill(Sn) returns (Error);
  56. }