2018-07-04 14:50:28 -04:00
|
|
|
namespace deno;
|
|
|
|
|
2018-08-15 23:36:48 -04:00
|
|
|
union Any {
|
2018-07-06 11:27:36 -04:00
|
|
|
Start,
|
|
|
|
StartRes,
|
|
|
|
CodeFetch,
|
|
|
|
CodeFetchRes,
|
|
|
|
CodeCache,
|
|
|
|
Exit,
|
|
|
|
TimerStart,
|
|
|
|
TimerReady,
|
|
|
|
TimerClear,
|
2018-08-31 07:51:12 -04:00
|
|
|
Environ,
|
|
|
|
EnvironRes,
|
2018-07-06 11:27:36 -04:00
|
|
|
FetchReq,
|
|
|
|
FetchRes,
|
2018-08-23 18:36:45 -04:00
|
|
|
MakeTempDir,
|
|
|
|
MakeTempDirRes,
|
2018-08-26 02:26:30 -04:00
|
|
|
MkdirSync,
|
2018-07-06 11:27:36 -04:00
|
|
|
ReadFileSync,
|
|
|
|
ReadFileSyncRes,
|
2018-08-29 09:22:25 -04:00
|
|
|
StatSync,
|
|
|
|
StatSyncRes,
|
2018-08-31 07:51:12 -04:00
|
|
|
SetEnv,
|
2018-07-06 11:27:36 -04:00
|
|
|
WriteFileSync,
|
2018-07-04 14:50:28 -04:00
|
|
|
}
|
|
|
|
|
2018-08-15 23:36:48 -04:00
|
|
|
enum ErrorKind: byte {
|
|
|
|
NoError = 0,
|
|
|
|
|
|
|
|
// io errors
|
|
|
|
|
|
|
|
NotFound,
|
|
|
|
PermissionDenied,
|
|
|
|
ConnectionRefused,
|
|
|
|
ConnectionReset,
|
|
|
|
ConnectionAborted,
|
|
|
|
NotConnected,
|
|
|
|
AddrInUse,
|
|
|
|
AddrNotAvailable,
|
|
|
|
BrokenPipe,
|
|
|
|
AlreadyExists,
|
|
|
|
WouldBlock,
|
|
|
|
InvalidInput,
|
|
|
|
InvalidData,
|
|
|
|
TimedOut,
|
|
|
|
Interrupted,
|
|
|
|
WriteZero,
|
|
|
|
Other,
|
|
|
|
UnexpectedEof,
|
|
|
|
|
|
|
|
// url errors
|
|
|
|
|
|
|
|
EmptyHost,
|
|
|
|
IdnaError,
|
|
|
|
InvalidPort,
|
|
|
|
InvalidIpv4Address,
|
|
|
|
InvalidIpv6Address,
|
|
|
|
InvalidDomainCharacter,
|
|
|
|
RelativeUrlWithoutBase,
|
|
|
|
RelativeUrlWithCannotBeABaseBase,
|
|
|
|
SetHostOnCannotBeABaseUrl,
|
|
|
|
Overflow,
|
2018-08-14 16:50:53 -04:00
|
|
|
|
|
|
|
// hyper errors
|
|
|
|
|
|
|
|
HttpUser,
|
|
|
|
HttpClosed,
|
|
|
|
HttpCanceled,
|
|
|
|
HttpParse,
|
|
|
|
HttpOther,
|
2018-08-15 23:36:48 -04:00
|
|
|
}
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
table Base {
|
2018-08-17 16:59:57 -04:00
|
|
|
cmd_id: uint32;
|
2018-08-15 23:36:48 -04:00
|
|
|
error_kind: ErrorKind = NoError;
|
2018-07-06 11:27:36 -04:00
|
|
|
error: string;
|
|
|
|
msg: Any;
|
2018-07-04 14:50:28 -04:00
|
|
|
}
|
|
|
|
|
2018-07-23 14:13:12 -04:00
|
|
|
table Start {
|
2018-07-06 11:27:36 -04:00
|
|
|
unused: int8;
|
|
|
|
}
|
|
|
|
|
|
|
|
table StartRes {
|
|
|
|
cwd: string;
|
|
|
|
argv: [string];
|
|
|
|
debug_flag: bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
table CodeFetch {
|
|
|
|
module_specifier: string;
|
|
|
|
containing_file: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table CodeFetchRes {
|
|
|
|
// 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.
|
|
|
|
module_name: string;
|
|
|
|
filename: string;
|
|
|
|
source_code: string;
|
|
|
|
output_code: string; // Non-empty only if cached.
|
|
|
|
}
|
|
|
|
|
|
|
|
table CodeCache {
|
|
|
|
filename: string;
|
|
|
|
source_code: string;
|
|
|
|
output_code: string;
|
|
|
|
}
|
|
|
|
|
2018-07-23 14:13:12 -04:00
|
|
|
table Exit {
|
2018-07-06 11:27:36 -04:00
|
|
|
code: int;
|
|
|
|
}
|
|
|
|
|
2018-07-23 14:13:12 -04:00
|
|
|
table TimerStart {
|
2018-07-06 11:27:36 -04:00
|
|
|
id: uint;
|
|
|
|
interval: bool;
|
2018-08-09 15:17:08 -04:00
|
|
|
delay: uint;
|
2018-07-06 11:27:36 -04:00
|
|
|
}
|
|
|
|
|
2018-07-23 14:13:12 -04:00
|
|
|
table TimerReady {
|
2018-07-06 11:27:36 -04:00
|
|
|
id: uint;
|
|
|
|
done: bool;
|
|
|
|
}
|
|
|
|
|
2018-07-23 14:13:12 -04:00
|
|
|
table TimerClear {
|
2018-07-06 11:27:36 -04:00
|
|
|
id: uint;
|
|
|
|
}
|
|
|
|
|
2018-08-31 07:51:12 -04:00
|
|
|
table Environ {}
|
|
|
|
|
|
|
|
table SetEnv {
|
|
|
|
key: string;
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table EnvironRes {
|
|
|
|
map: [EnvPair];
|
|
|
|
}
|
|
|
|
|
|
|
|
table EnvPair {
|
|
|
|
key: string;
|
|
|
|
value: string;
|
|
|
|
}
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
table FetchReq {
|
|
|
|
id: uint;
|
|
|
|
url: string;
|
|
|
|
// header_line: [string];
|
|
|
|
}
|
|
|
|
|
|
|
|
table FetchRes {
|
|
|
|
id: uint;
|
|
|
|
status: int;
|
|
|
|
header_line: [string];
|
2018-08-13 15:02:35 -04:00
|
|
|
body: [ubyte];
|
2018-07-06 11:27:36 -04:00
|
|
|
}
|
|
|
|
|
2018-08-23 18:36:45 -04:00
|
|
|
table MakeTempDir {
|
|
|
|
dir: string;
|
|
|
|
prefix: string;
|
|
|
|
suffix: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table MakeTempDirRes {
|
|
|
|
path: string;
|
|
|
|
}
|
|
|
|
|
2018-08-26 02:26:30 -04:00
|
|
|
table MkdirSync {
|
|
|
|
path: string;
|
|
|
|
mode: uint;
|
|
|
|
// mode specified by https://godoc.org/os#FileMode
|
|
|
|
}
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
table ReadFileSync {
|
|
|
|
filename: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
table ReadFileSyncRes {
|
2018-08-13 15:02:35 -04:00
|
|
|
data: [ubyte];
|
2018-07-06 11:27:36 -04:00
|
|
|
}
|
|
|
|
|
2018-08-29 09:22:25 -04:00
|
|
|
table StatSync {
|
|
|
|
filename: string;
|
|
|
|
lstat: bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
table StatSyncRes {
|
|
|
|
is_file: bool;
|
|
|
|
is_symlink: bool;
|
|
|
|
len: ulong;
|
|
|
|
modified:ulong;
|
|
|
|
accessed:ulong;
|
|
|
|
created:ulong;
|
|
|
|
}
|
|
|
|
|
2018-07-06 11:27:36 -04:00
|
|
|
table WriteFileSync {
|
|
|
|
filename: string;
|
2018-08-13 15:02:35 -04:00
|
|
|
data: [ubyte];
|
2018-07-06 11:27:36 -04:00
|
|
|
perm: uint;
|
|
|
|
// perm specified by https://godoc.org/os#FileMode
|
|
|
|
}
|
2018-08-13 19:55:10 -04:00
|
|
|
|
|
|
|
root_type Base;
|