lib

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 1, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exports

type Exports struct {
	// Default is what will be the `default` export of a module
	Default interface{}
	// Named is the named exports of a module
	Named map[string]interface{}
}

Exports is representation of ESM exports of a module

type Instance

type Instance interface {
	Exports() Exports
}

Instance is what a module needs to return

type Module

type Module interface {
	// NewModuleInstance will get modules.VU that should provide the module with a way to interact with the VU.
	// This method will be called for *each* VU that imports the module *once* per that VU.
	NewModuleInstance(VU) Instance
}

Module is the interface js modules should implement in order to get access to the VU

type VU

type VU interface {
	// Context return the context.Context about the current VU
	Context() context.Context

	// Runtime returns the sobek.Runtime for the current VU
	Runtime() *sobek.Runtime
}

VU gives access to the currently executing VU to a module Instance

Jump to

Keyboard shortcuts

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