componentized/directory

componentized:config-from-environment

component

Exposes the content of wasi:cli/environment variables as wasi:config/store.

Imports

Exports

WIT

package root:component;

world root {
  import wasi:cli/environment@0.2.3;

  export wasi:config/store@0.2.0-draft;
}
package wasi:cli@0.2.3 {
  interface environment {
    get-environment: func() -> list<tuple<string, string>>;
  }
}


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>;
  }
}