componentized/directory

componentized:config-scope

component dev

Selects keys in a wasi:config/store matching a scope prefix based on the content of a 'scope' import which mimics wasi:config/store. The scope value is removed from the resulting keys, and keys not matching the scope prefix are ignored.

Imports

Exports

WIT

package root:component;

world root {
  import wasi:config/store@0.2.0-rc.1;
  import scope: interface {
    variant error {
      upstream(string),
      io(string),
    }

    get: func(key: string) -> result<option<string>, error>;
  }

  export wasi:config/store@0.2.0-rc.1;
}