exec

package
v0.28.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StageCaptures = "captures"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssertInput

type AssertInput struct {
	Context   context.Context
	Doc       *restfile.Document
	Req       *restfile.Request
	EnvName   string
	BaseDir   string
	Vars      map[string]string
	ExtraVals map[string]rts.Value
	HTTP      *httpclient.Response
	Stream    *scripts.StreamInfo
}

type CaptureInput

type CaptureInput struct {
	Doc       *restfile.Document
	Req       *restfile.Request
	Resolver  *vars.Resolver
	Response  *scripts.Response
	Stream    *scripts.StreamInfo
	EnvName   string
	Vars      map[string]string
	ExtraVals map[string]rts.Value
}

type HTTPHooks

type HTTPHooks struct {
	AttachSSEHandle       func(*httpclient.StreamHandle, *restfile.Request)
	AttachWebSocketHandle func(*httpclient.WebSocketHandle, *restfile.Request)
	ApplyCaptures         func(CaptureInput) error
	CollectVariables      func(*restfile.Document, *restfile.Request, string) map[string]string
	CollectGlobalValues   func(*restfile.Document, string) map[string]scripts.GlobalValue
	RunAsserts            func(AssertInput) ([]scripts.TestResult, error)
	ApplyRuntimeGlobals   func(map[string]scripts.GlobalValue)
}

type HTTPInput

type HTTPInput struct {
	Client           *httpclient.Client
	Scripts          *scripts.Runner
	Context          context.Context
	Doc              *restfile.Document
	Req              *restfile.Request
	Resolver         *vars.Resolver
	Options          httpclient.Options
	EnvName          string
	EffectiveTimeout time.Duration
	ScriptVars       map[string]string
	ExtraVals        map[string]rts.Value
}

type HTTPResult

type HTTPResult struct {
	Response  *httpclient.Response
	Stream    *scripts.StreamInfo
	Tests     []scripts.TestResult
	ScriptErr error
	Err       error
	Decision  string
	ErrStage  string
}

type RequestFlow

type RequestFlow interface {
	PendingCancel() *RequestResult
	Finish()
	EvaluateCondition() *RequestResult
	RunPreRequest() *RequestResult
	PrepareRequest() *RequestResult
	PreviewResult() RequestResult
	UseGRPC() bool
	IsInteractiveWebSocket() bool
	ExecuteInteractiveWebSocket() RequestResult
	ExecuteGRPC() RequestResult
	ExecuteHTTP() RequestResult
}

type RequestResult

type RequestResult struct {
	Response       *httpclient.Response
	GRPC           *grpcclient.Response
	Stream         *scripts.StreamInfo
	Transcript     []byte
	Err            error
	Tests          []scripts.TestResult
	ScriptErr      error
	Executed       *restfile.Request
	RequestText    string
	RuntimeSecrets []string
	Environment    string
	Skipped        bool
	SkipReason     string
	Preview        bool
	Explain        *explain.Report
	Timing         engine.Timing
}

func RunRequest

func RunRequest(flow RequestFlow) RequestResult

type Runner

type Runner struct {
	Hooks HTTPHooks
}

func (Runner) RunHTTP

func (r Runner) RunHTTP(in HTTPInput) HTTPResult

Jump to

Keyboard shortcuts

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