mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
76 lines
1.9 KiB
Protocol Buffer
76 lines
1.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
package main;
|
|
|
|
message BaseMsg {
|
|
string channel = 1;
|
|
bytes payload = 2;
|
|
}
|
|
|
|
message Msg {
|
|
string error = 1;
|
|
|
|
enum Command {
|
|
ERROR = 0;
|
|
START = 1;
|
|
SOURCE_CODE_FETCH_RES = 2;
|
|
ONEOF = 100;
|
|
}
|
|
Command command = 2;
|
|
|
|
// We avoid creating a message for each command (and use oneof or any types)
|
|
// In order to reduce code in the size of the generated javascript
|
|
// "msg.pb.js". It seems that each new message adds 20k and we want to
|
|
// potentially add many hundreds of commands. Therefore we just prefix command
|
|
// arguments by their name.
|
|
|
|
// Start
|
|
string start_cwd = 10;
|
|
repeated string start_argv = 11;
|
|
bool start_debug_flag = 12;
|
|
string start_main_js = 13; // The contents of dist/main.js
|
|
string start_main_map = 14; // The contents of dist/main.map
|
|
|
|
// SOURCE_CODE_FETCH_RES
|
|
// If it's a non-http module, moduleName and filename will be the same.
|
|
// For http modules, moduleName is its resolved http URL, and filename
|
|
// is the location of the locally downloaded source code.
|
|
string source_code_fetch_res_module_name = 30;
|
|
string source_code_fetch_res_filename = 31;
|
|
string source_code_fetch_res_source_code = 32;
|
|
string source_code_fetch_res_output_code = 33; // Non-empty only if cached.
|
|
|
|
oneof payload {
|
|
SourceCodeFetchMsg source_code_fetch = 100;
|
|
SourceCodeCacheMsg source_code_cache = 102;
|
|
ExitMsg exit = 103;
|
|
TimerStartMsg timer_start = 104;
|
|
TimerReadyMsg timer_ready = 105;
|
|
TimerClearMsg timer_clear = 106;
|
|
}
|
|
}
|
|
|
|
message SourceCodeFetchMsg {
|
|
string module_specifier = 1;
|
|
string containing_file = 2;
|
|
}
|
|
|
|
message SourceCodeCacheMsg {
|
|
string filename = 1;
|
|
string source_code = 2;
|
|
string output_code = 3;
|
|
}
|
|
|
|
message ExitMsg { int32 code = 1; }
|
|
|
|
message TimerStartMsg {
|
|
int32 id = 1;
|
|
bool interval = 2;
|
|
int32 duration = 3; // In milliseconds.
|
|
}
|
|
|
|
message TimerReadyMsg {
|
|
int32 id = 1;
|
|
bool done = 2;
|
|
}
|
|
|
|
message TimerClearMsg { int32 id = 1; }
|