componentized

component componentized:config-defaults@0.2.1

Combines value from two wasi:config/stores into a single store. The 'store' import is the base set of values, while the 'defaults' import, a mirror of the store interface, contributes default values when the config does not contain a value.

Imports

interface defaults

variant error

  • upstream: string
  • io: string

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

functionget-all: func() -> result<list<tuple<string, string>>, error>

Exports

WIT

package root:component;

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

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

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

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