componentized/directory

componentized:config-scope

component

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-draft;
  import scope: interface {
    variant error {
      upstream(string),
      io(string),
    }

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

  export wasi:config/store@0.2.0-draft;
}
package wasi:config@0.2.0-draft {
  interface store {
    variant error {
      upstream(string),
      io(string),
    }

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

    get-all: func() -> result<list<tuple<string, string>>, error>;
  }
}