-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathwit-wire.wit
More file actions
52 lines (40 loc) · 901 Bytes
/
wit-wire.wit
File metadata and controls
52 lines (40 loc) · 901 Bytes
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
package metatype:wit-wire;
interface typegate-wire {
hostcall: func(op-name: string, json: string) -> result<string, string>;
}
interface mat-wire {
type json-str = string;
record mat-info {
op-name: string,
mat-title: string,
mat-hash: string,
mat-data-json: string,
}
record init-args {
metatype-version: string,
expected-ops: list<mat-info>
}
record init-response {
ok: bool
}
variant init-error {
version-mismatch(string),
unexpected-mat(mat-info),
other(string)
}
init: func(args: init-args) -> result<init-response, init-error>;
record handle-req {
op-name: string,
in-json: json-str,
}
variant handle-err {
no-handler,
in-json-err(string),
handler-err(string),
}
handle: func(req: handle-req) -> result<json-str, handle-err>;
}
world wit-wire {
import typegate-wire;
export mat-wire;
}