Files
wazero/internal/gojs/custom/crypto.go
Edoardo Vacchi 599c097603 Add -hostlogging=crypto (#1064)
This allows you to specify multiple logging scopes, both in API and the CLI.

e.g for the CLI.
```bash
$ wazero run --hostlogging=crypto --hostlogging=filesystem --mount=.:/:ro cat.wasm
```

e.g. for Go
```go
loggingCtx := context.WithValue(testCtx, experimental.FunctionListenerFactoryKey{},
	logging.NewHostLoggingListenerFactory(&log, logging.LogScopeCrypto|logging.LogScopeFilesystem))
```

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Adrian Cole <adrian@tetrate.io>
2023-01-28 12:51:44 +02:00

18 lines
484 B
Go

package custom
const (
NameCrypto = "crypto"
NameCryptoGetRandomValues = "getRandomValues"
)
// CryptoNameSection are the functions defined in the object named NameCrypto.
// Results here are those set to the current event object, but effectively are
// results of the host function.
var CryptoNameSection = map[string]*Names{
NameCryptoGetRandomValues: {
Name: NameCryptoGetRandomValues,
ParamNames: []string{"r"},
ResultNames: []string{"n"},
},
}