request

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRequest

func CloneRequest(req *restfile.Request) *restfile.Request

func RenderRequestText

func RenderRequestText(req *restfile.Request) string

Types

type Engine

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

func New

func New(cfg engine.Config, rt *rtrun.Runtime) *Engine

func (*Engine) CollectVariables

func (e *Engine) CollectVariables(
	doc *restfile.Document,
	req *restfile.Request,
	env string,
	extras ...map[string]string,
) map[string]string

func (*Engine) EvalCondition

func (e *Engine) EvalCondition(
	ctx context.Context,
	doc *restfile.Document,
	req *restfile.Request,
	env, base string,
	spec *restfile.ConditionSpec,
	vv map[string]string,
	extra map[string]rts.Value,
) (bool, string, error)

func (*Engine) EvalForEachItems

func (e *Engine) EvalForEachItems(
	ctx context.Context,
	doc *restfile.Document,
	req *restfile.Request,
	env, base string,
	spec ForEachSpec,
	vv map[string]string,
	extra map[string]rts.Value,
) ([]rts.Value, error)

func (*Engine) EvalValue

func (e *Engine) EvalValue(
	ctx context.Context,
	doc *restfile.Document,
	req *restfile.Request,
	env, base, expr, site string,
	pos rts.Pos,
	vv map[string]string,
	extra map[string]rts.Value,
) (rts.Value, error)

func (*Engine) Execute

func (e *Engine) Execute(
	doc *restfile.Document,
	req *restfile.Request,
	env string,
) (engine.RequestResult, error)

func (*Engine) ExecuteWith

func (e *Engine) ExecuteWith(
	doc *restfile.Document,
	req *restfile.Request,
	env string,
	opt ExecOptions,
) (engine.RequestResult, error)

func (*Engine) PosForLine

func (e *Engine) PosForLine(doc *restfile.Document, req *restfile.Request, line int) rts.Pos

func (*Engine) SetConfig

func (e *Engine) SetConfig(cfg engine.Config)

func (*Engine) ValueString

func (e *Engine) ValueString(ctx context.Context, pos rts.Pos, v rts.Value) (string, error)

type ExecMode

type ExecMode uint8
const (
	ExecModeSend ExecMode = iota
	ExecModePreview
)

type ExecOptions

type ExecOptions struct {
	Extra      map[string]string
	Values     map[string]rts.Value
	Record     bool
	Ctx        context.Context
	Mode       ExecMode
	AttachSSE  func(*httpclient.StreamHandle, *restfile.Request)
	AttachWS   func(*httpclient.WebSocketHandle, *restfile.Request)
	AttachGRPC func(*stream.Session, *restfile.Request)
	Release    func()
}

type ForEachSpec

type ForEachSpec struct {
	Expr string
	Var  string
	Line int
}

Jump to

Keyboard shortcuts

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