Move move_money into a wasm module, add dynamic node test that uses move_money
Some checks failed
test / test (push) Failing after 1m11s
Some checks failed
test / test (push) Failing after 1m11s
This commit is contained in:
43
move-money-dynamic/wit/dynamic_node.wit
Normal file
43
move-money-dynamic/wit/dynamic_node.wit
Normal file
@@ -0,0 +1,43 @@
|
||||
package vato007:ingey;
|
||||
|
||||
interface types {
|
||||
resource csv-row {
|
||||
columns: func() -> list<string>;
|
||||
values: func() -> list<string>;
|
||||
entries: func() -> list<tuple<string, string>>;
|
||||
value: func(name: string) -> option<string>;
|
||||
}
|
||||
|
||||
resource csv-reader {
|
||||
columns: func() -> list<string>;
|
||||
|
||||
next: func() -> result<csv-row, string>;
|
||||
next-into-map: func() -> read-map;
|
||||
has-next: func() -> bool;
|
||||
|
||||
// Get a row by values in one or more columns
|
||||
query: func(values: list<tuple<string, string>>) -> csv-row;
|
||||
|
||||
read-into-string: func() -> string;
|
||||
}
|
||||
|
||||
resource csv-readers {
|
||||
get-reader: func(name: string) -> option<csv-reader>;
|
||||
read-into-string: func(name: string) -> string;
|
||||
}
|
||||
|
||||
resource csv-writer {
|
||||
write-row: func(row: list<tuple<string, string>>);
|
||||
write-string: func(row: string);
|
||||
}
|
||||
|
||||
resource read-map {
|
||||
get: func(key: string) -> option<string>;
|
||||
}
|
||||
}
|
||||
|
||||
// This will apply to csv files only for simplicity. A separate node should be created for arbitrary readers/writers
|
||||
world dynamic {
|
||||
use types.{csv-readers, read-map, csv-writer};
|
||||
export evaluate: func(properties: read-map, readers: csv-readers, writer: csv-writer);
|
||||
}
|
||||
Reference in New Issue
Block a user