summaryrefslogtreecommitdiff
path: root/msg.proto
blob: fbedf9752b5243b36401770a3fe1e2d8ad968cbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
syntax = "proto3";
package main;

message Msg {
  enum MsgKind {
    START = 0;
    READ_FILE_SYNC = 1;
    DATA_RESPONSE = 2;
    EXIT = 3;

    SOURCE_CODE_FETCH = 4;
    SOURCE_CODE_FETCH_RES = 5;
    SOURCE_CODE_CACHE = 6;
  }
  MsgKind kind = 10;

  oneof payload {
    StartMsg start = 90;
    SourceCodeFetchMsg source_code_fetch = 91;
    SourceCodeFetchResMsg source_code_fetch_res = 92;
    SourceCodeCacheMsg source_code_cache = 93;
  }

  // READ_FILE_SYNC and MKDIRP
  string path = 20;

  // DATA_RESPONSE
  bytes data = 30;
  string error = 31;

  // EXIT
  int32 code = 40;
}

// START
message StartMsg {
  string cwd = 1;
  repeated string argv = 2;
}

message SourceCodeFetchMsg { string filename = 1; }

message SourceCodeFetchResMsg {
  string source_code = 1;
  string output_code = 2;
}

message SourceCodeCacheMsg {
  string filename = 1;
  string source_code = 2;
  string output_code = 3;
}