Documentation
¶
Overview ¶
Package script runs a scenario's JavaScript steps with goja. A script sees the virtual user's variables as `vars` (and may set new ones), the environment as `env`, its feeder rows as `data`, and `vu` and `iteration`; `fail(message)` fails the iteration. Scripts have no network, file or timer access, and each run is bounded by Timeout.
Index ¶
Constants ¶
View Source
const Timeout = time.Second
Timeout bounds one run of a script.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
Vars map[string]any
Env map[string]string
Data map[string]any
VU int64
Iteration int64
// Log receives console.log output; nil discards it.
Log func(string)
}
Input is what a script sees.
type Program ¶
type Program struct {
// Source is the script as written, for error messages.
Source string
// contains filtered or unexported fields
}
Program is a compiled script.
Click to show internal directories.
Click to hide internal directories.