Documentation
¶
Index ¶
- func Apply(req *restfile.Request, out Output) error
- func Normalize(out *Output)
- func SetRequestVars(req *restfile.Request, variables vars.NameMap[string])
- type ExpandFunc
- type Input
- type Literal
- type Output
- func (o *Output) AddHeader(at diag.Pos, name, value string)
- func (o *Output) DelHeader(name string)
- func (o *Output) SetBody(at diag.Pos, value string)
- func (o *Output) SetHeader(at diag.Pos, name, value string)
- func (o *Output) SetQuery(at diag.Pos, name, value string)
- func (o *Output) SetURL(at diag.Pos, value string)
- func (o *Output) Warnings() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExpandFunc ¶ added in v1.11.0
ExpandFunc renders an authored request value as a script reads it. Variables and expressions see the script's own writes in set.
type Input ¶
type Input struct {
Request *restfile.Request
Variables map[string]string
Globals vars.Globals
BaseDir string
Context context.Context
Secrets *vars.Secrets
// Expand renders the authored values the script reads. A nil Expand shows
// them as written.
Expand ExpandFunc
}
Input is the host state available to a pre-request script runner.
type Output ¶
type Output struct {
Headers http.Header
// Removals are tracked separately because headers declared in the file are
// not part of Headers and would otherwise survive the script.
HeaderDels map[string]struct{}
// Query values are set, or removed when nil.
Query map[string]*string
Body *string
URL *string
Method *string
// Variables contains script writes, normalized to one entry per name.
Variables vars.NameMap[string]
Globals vars.Globals
// contains filtered or unexported fields
}
Output is a set of request changes from pre-request scripts or @apply patches.
Click to show internal directories.
Click to hide internal directories.