Help us shape the future of Go! Take the 2026 Go Developer Survey

tapeplayer

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package tapeplayer answers HTTP calls from recorded responses instead of the network, so a run can be shown again without the servers it first called.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRecorded = errors.New("the recording has no response for this call")

ErrNotRecorded is returned for a call the recording has no answer for.

Functions

This section is empty.

Types

type Player

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

Player is an http.RoundTripper that plays records back. It is safe for concurrent use.

func New

func New(records []engine.Record) *Player

New plays records back. HTTP records only: a message-based record (async, gRPC) is never matched.

func (*Player) RoundTrip

func (p *Player) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip answers with the first unused record for the same method and URL; failing that, the first unused one for the same method and path, since a timestamp in the query is the usual reason a replayed URL differs. A call with no record is ErrNotRecorded.

Jump to

Keyboard shortcuts

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