1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/msg.proto

103 lines
2.6 KiB
Protocol Buffer
Raw Normal View History

2018-05-28 21:50:44 -04:00
// Copyright 2018 Ryan Dahl <ry@tinyclouds.org>
// All rights reserved. MIT License.
2018-05-25 15:30:09 -04:00
syntax = "proto3";
2018-05-14 00:31:48 -04:00
package main;
2018-05-29 04:28:32 -04:00
option go_package = "deno";
2018-05-14 00:31:48 -04:00
2018-05-21 22:07:40 -04:00
message BaseMsg {
2018-05-25 15:30:09 -04:00
string channel = 1;
bytes payload = 2;
2018-05-21 22:07:40 -04:00
}
2018-05-14 00:31:48 -04:00
message Msg {
enum Command {
2018-05-25 15:30:09 -04:00
ERROR = 0;
START = 1;
CODE_FETCH = 2;
CODE_FETCH_RES = 3;
CODE_CACHE = 4;
2018-05-25 15:36:13 -04:00
EXIT = 5;
TIMER_START = 6;
TIMER_READY = 7;
TIMER_CLEAR = 8;
2018-05-27 03:46:18 -04:00
FETCH_REQ = 9;
FETCH_RES = 10;
2018-05-27 12:49:20 -04:00
READ_FILE_SYNC = 11;
READ_FILE_SYNC_RES = 12;
2018-05-28 14:39:02 -04:00
WRITE_FILE_SYNC = 13;
}
2018-05-27 03:46:18 -04:00
Command command = 1;
// 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.
2018-05-27 03:46:18 -04:00
// ERROR
string error = 2;
2018-05-25 15:36:13 -04:00
// START
2018-05-25 15:30:09 -04:00
string start_cwd = 10;
repeated string start_argv = 11;
2018-05-25 15:30:09 -04:00
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
// CODE_FETCH
string code_fetch_module_specifier = 20;
string code_fetch_containing_file = 21;
2018-05-25 15:36:13 -04:00
// CODE_FETCH_RES
2018-05-19 04:47:40 -04:00
// 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 code_fetch_res_module_name = 30;
string code_fetch_res_filename = 31;
string code_fetch_res_source_code = 32;
string code_fetch_res_output_code = 33; // Non-empty only if cached.
// CODE_CACHE
string code_cache_filename = 41;
string code_cache_source_code = 42;
string code_cache_output_code = 43;
2018-05-25 15:36:13 -04:00
// EXIT
int32 exit_code = 50;
2018-05-17 21:02:06 -04:00
2018-05-25 15:36:13 -04:00
// TIMER_START
int32 timer_start_id = 60;
bool timer_start_interval = 61;
2018-05-31 14:37:53 -04:00
int32 timer_start_delay = 62; // In milliseconds.
2018-05-18 11:49:28 -04:00
2018-05-25 15:36:13 -04:00
// TIMER_READY
int32 timer_ready_id = 70;
bool timer_ready_done = 71;
2018-05-18 11:49:28 -04:00
2018-05-25 15:36:13 -04:00
// TIMER_CLEAR
int32 timer_clear_id = 80;
2018-05-27 03:46:18 -04:00
// FETCH_REQ
int32 fetch_req_id = 90;
string fetch_req_url = 91;
// repeated string fetch_req_header_line = 91
// FETCH_RES
int32 fetch_res_id = 100;
int32 fetch_res_status = 101;
repeated string fetch_res_header_line = 102;
bytes fetch_res_body = 103;
2018-05-27 12:49:20 -04:00
// READ_FILE_SYNC
string read_file_sync_filename = 110;
// READ_FILE_SYNC_RES
bytes read_file_sync_data = 120;
2018-05-28 14:39:02 -04:00
// WRITE_FILE_SYNC
string write_file_sync_filename = 130;
bytes write_file_sync_data = 131;
uint32 write_file_sync_perm = 132;
// write_file_sync_perm specified by https://godoc.org/os#FileMode
2018-05-18 11:49:28 -04:00
}