1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/msg.proto
2018-05-25 16:16:28 -04:00

70 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 = 2;
SOURCE_CODE_FETCH_RES = 3;
SOURCE_CODE_CACHE = 4;
EXIT = 5;
TIMER_START = 6;
TIMER_READY = 7;
TIMER_CLEAR = 8;
}
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
string source_code_fetch_module_specifier = 20;
string source_code_fetch_containing_file = 21;
// 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.
// SOURCE_CODE_CACHE
string source_code_cache_filename = 41;
string source_code_cache_source_code = 42;
string source_code_cache_output_code = 43;
// EXIT
int32 exit_code = 50;
// TIMER_START
int32 timer_start_id = 60;
bool timer_start_interval = 61;
int32 timer_start_duration = 62; // In milliseconds.
// TIMER_READY
int32 timer_ready_id = 70;
bool timer_ready_done = 71;
// TIMER_CLEAR
int32 timer_clear_id = 80;
}