diff --git a/wasmcloud/config.go b/wasmcloud/config.go index 39e72dd..9d4b2e3 100644 --- a/wasmcloud/config.go +++ b/wasmcloud/config.go @@ -2,6 +2,11 @@ package wasmcloud import "go.wasmcloud.dev/component/gen/wasi/config/runtime" +// GetConfigOrDefault tries to get a configuration value by provided key using +// [wasi:config/store.get] and falling back to the provided defaultValue if a +// configuration value by provided key is not found. +// +// [wasi:config/store.get]: https://github.com/WebAssembly/wasi-runtime-config/blob/f4d699bc6dd77adad99fa1a2246d482225ec6485/wit/store.wit#L17-L24 func GetConfigOrDefault(key string, defaultValue string) string { res := runtime.Get(key) if res.IsOK() { diff --git a/wasmcloud/secret.go b/wasmcloud/secret.go index c37aaf4..8b0d5e7 100644 --- a/wasmcloud/secret.go +++ b/wasmcloud/secret.go @@ -7,6 +7,8 @@ import ( "go.wasmcloud.dev/component/gen/wasmcloud/secrets/store" ) +// SecretGetAndReveal attempts to access a secret identified by the provided key +// and reveal it, returning the stored value as a slice of bytes. func SecretGetAndReveal(key string) ([]byte, error) { res := store.Get(key) if res.IsErr() {