Documentation
¶
Overview ¶
Package script runs JetBrains HTTP Client handler scripts ({% ... %}) on a goja JavaScript runtime. Each execution gets a fresh runtime with only the client/request/response objects registered — scripts have no filesystem, network, or process access. State persists between requests solely through vars.Globals.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
Globals *vars.Globals
Out io.Writer
// Timeout is the wall-clock guard per script; zero means 5s.
Timeout time.Duration
}
Engine executes pre-request and response handler scripts.
type PreRequest ¶
type PreRequest struct {
Method string
URL string
Body string
Headers [][2]string
Environment map[string]string
Resolve func(string) string
}
PreRequest is the raw (unresolved) view of the request a pre-request script is about to influence. Raw values keep their {{placeholders}}; Resolve backs the tryGetSubstituted views with the variables known at call time.
type TestResult ¶
TestResult is one client.test outcome.