forked from spinframework/spin-trigger-sqs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqs.wit
36 lines (29 loc) · 791 Bytes
/
sqs.wit
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
package fermyon:spin-sqs@2.0.0;
interface sqs-types {
variant message-attribute-value {
str(string), // TODO: parse for the number case?
binary(list<u8>),
}
record message-attribute {
name: string,
data-type: option<string>,
value: message-attribute-value,
}
record message {
id: option<string>,
// TODO: built-in attributes? E.g. timestamps
message-attributes: list<message-attribute>,
body: option<string>,
}
variant error {
other(string),
}
enum message-action {
delete,
leave,
}
}
world spin-sqs {
use sqs-types.{message, message-action, error};
export handle-queue-message: func(message: message) -> result<message-action, error>;
}