wasm

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultParameters = Parameters{
	VerifyProbability: 0.1,
	NativeCompiler:    true,
}
View Source
var ErrModuleNotFound = errors.New("module not found")

Functions

func FillJavaScriptRegistration added in v0.5.0

func FillJavaScriptRegistration(state challenge.StateInterface, reg *challenge.Registration, parameters ast.Node) error

func MakeChallengeCall

func MakeChallengeCall(ctx context.Context, mod api.Module, in _interface.MakeChallengeInput) (*_interface.MakeChallengeOutput, error)

func VerifyChallengeCall

func VerifyChallengeCall(ctx context.Context, mod api.Module, in _interface.VerifyChallengeInput) (_interface.VerifyChallengeOutput, error)

Types

type Parameters added in v0.5.0

type Parameters struct {
	Path string `yaml:"path"`
	// Loader path to js/mjs file to use as challenge issuer
	Loader string `yaml:"js-loader"`

	// Runtime path to WASM wasip1 runtime
	Runtime string `yaml:"wasm-runtime"`

	Settings map[string]string `yaml:"wasm-runtime-settings"`

	NativeCompiler bool `yaml:"wasm-native-compiler"`

	VerifyProbability float64 `yaml:"verify-probability"`
}

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(useNativeCompiler bool) *Runner

func (*Runner) Close

func (r *Runner) Close() error

func (*Runner) Compile

func (r *Runner) Compile(key string, binary []byte) error

func (*Runner) Instantiate

func (r *Runner) Instantiate(key string, f func(ctx context.Context, mod api.Module) error) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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