feat(wit): add versioned KV store package
Define wasmeld:kv/store@0.1.0 with get, set, and delete operations. Expose explicit invalid-key, value-too-large, and operation-failed variants so components can handle bounded storage failures without relying on host-specific errors.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package wasmeld:kv@0.1.0;
|
||||
|
||||
interface store {
|
||||
variant kv-error {
|
||||
invalid-key(string),
|
||||
value-too-large(u64),
|
||||
operation-failed(string),
|
||||
}
|
||||
|
||||
get: func(key: string) -> result<option<list<u8>>, kv-error>;
|
||||
set: func(key: string, value: list<u8>) -> result<_, kv-error>;
|
||||
delete: func(key: string) -> result<_, kv-error>;
|
||||
}
|
||||
|
||||
world kv-host {
|
||||
import store;
|
||||
}
|
||||
Reference in New Issue
Block a user