http1

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package http1 implements a protocol.Protocol driver that speaks plain HTTP/1.1. It is the simplest of the four Phase 0 drivers and the reference implementation the others follow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver is an HTTP/1.1 protocol.Protocol. It reuses one *http.Client (and the connection pool behind it) across every call to Do, so repeated iterations against the same target benefit from keep-alive the way a real client would.

Driver deliberately disables HTTP/2 on its transport, even if the target would otherwise negotiate it over TLS. That is the difference between this driver and internal/protocol/http2: a scenario author who picks http1 is asking to test the HTTP/1.1 path specifically, and should get it even against a server that prefers HTTP/2.

func New

func New(target protocol.Target, timeout time.Duration) *Driver

New returns a ready-to-use Driver for target. timeout bounds each individual request; it should normally be shorter than the executor's own run duration. A timeout of 0 means no per-request timeout beyond ctx's own deadline.

func (*Driver) Close

func (d *Driver) Close() error

Close implements protocol.Protocol.

func (*Driver) Do

func (d *Driver) Do(ctx context.Context) (protocol.Result, error)

Do implements protocol.Protocol.

func (*Driver) Name

func (d *Driver) Name() string

Name implements protocol.Protocol.

Jump to

Keyboard shortcuts

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