proxy-wasm-go-host
proxy-wasm-go-host copied to clipboard
Allow setting wazero module configuration
This allows for setting critical wazero module configuration. For example, to use the host time:
import (
"github.com/tetratelabs/wazero"
wazeroHost "mosn.io/proxy-wasm-go-host/wazero"
)
...
// compile the wasm module
module := vm.NewModule(wasmBytes)
// create a new instance
instance = module.NewInstance()
// configure wazero module environment
conf := wazero.NewModuleConfig().WithSysWalltime().WithSysNanotime()
// set wazero config
wazeroHost.InstanceWithConfig(conf)(instance.(*wazeroHost.Instance))
// proceed as usual
...