nativego

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package nativego is the native-Go extbench fixture. It registers a single `validate` function under the "validate-email" extension name, matching the shared semantics implemented identically across all 5 runtime fixtures (see goja-js/validate.js for the canonical reference):

in:    {"email": "Foo@Example.COM ", "age": 25}
ok:    {"ok": true, "email": "foo@example.com", "age": 25}
err:   {"ok": false, "error": "input must be an object"}
err:   {"ok": false, "error": "email required"}
err:   {"ok": false, "error": "age out of range"}
err:   {"ok": false, "error": "email shape"}
err:   {"ok": false, "error": "email domain"}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(ctx context.Context, payload []byte) ([]byte, error)

Validate is the exported alias of the unexported validate fn. It exists so other test packages (e.g. extbench scale_test.go) can register the same handler under additional extension names without re-implementing the logic. The init() registration below is the only call site we ship for production use.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL