execute

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package execute turns a normalized operation and a value generator into a real HTTP request and records the outcome.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	BaseURL string
	Client  *http.Client
	Headers http.Header
	// Overrides allows specific generated values to be replaced (for stateful
	// fuzzing variable binding). Keys use the format "location:field", e.g.
	// "path:id", "query:limit", "body:user_id", "body:address.city".
	Overrides map[string]any
}

Executor executes operations against a target base URL.

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, op *openapi.Operation, gen *generate.Generator) (*Outcome, error)

Execute generates values for op and sends the request.

type Outcome

type Outcome struct {
	Method      string
	Path        string
	URL         string
	StatusCode  int
	ContentType string
	Body        string
	Err         string
	// Params holds the generated values for path/query/header parameters,
	// keyed by "in:name".
	Params map[string]any
}

Outcome records what happened for one executed operation.

func (*Outcome) Failed

func (o *Outcome) Failed() bool

Failed reports whether the execution produced an obvious server-side failure (5xx or transport error).

Jump to

Keyboard shortcuts

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