Skip to content

Commit 382aad8

Browse files
committed
feat(api): Add .wit interface
1 parent ad340f7 commit 382aad8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

api/env.wit

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
enum log-level {
2+
null,
3+
error,
4+
warn,
5+
info,
6+
debug
7+
}
8+
enum http-method {
9+
get,
10+
head,
11+
options,
12+
post,
13+
put,
14+
patch,
15+
delete
16+
}
17+
enum field-type {
18+
meta,
19+
body,
20+
header,
21+
params,
22+
state,
23+
query
24+
}
25+
26+
return-result: function(res: list<u8>, ident: u32)
27+
return-error: function(code: u32, res: string, ident: u32)
28+
log-msg: function(msg: string, level: log-level, ident: u32)
29+
fetch-url: function(method: http-method, url: string, body: list<u8>, ident: u32) -> u32
30+
graphql-query: function(endpoint: string, query: string, ident: u32) -> u32
31+
cache-set: function(key: string, value: list<u8>, ttl: u32, ident: u32) -> u32
32+
cache-get: function(key: string, ident: u32) -> u32
33+
request-get-field: function(field-type: field-type, key: string, ident: u32) -> u32
34+
get-ffi-result: function(ptr: u32, ident: u32) -> u32
35+
return-abort: function(msg: string, file: string, line-num: u32, col-num: u32, ident: u32)

0 commit comments

Comments
 (0)