aurestplayback

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PlaybackRewritePathEnvVariable = "GO_AUTUMN_RESTCLIENT_PLAYBACK_REWRITE_PATH"

Variables

This section is empty.

Functions

func New

func New(recorderPath string, additionalOptions ...PlaybackOptions) aurestclientapi.Client

New builds a new http client simulator based on playback.

Use this in your tests.

You can optionally add a PlaybackOptions instance to your call. The ... is really just so it's an optional argument.

Types

type PlaybackImpl

type PlaybackImpl struct {
	RecorderPath                string
	RecorderRewritePath         string
	ConstructFilenameCandidates []aurestrecorder.ConstructFilenameFunction
	Now                         func() time.Time
}

func (*PlaybackImpl) Perform

func (c *PlaybackImpl) Perform(ctx context.Context, method string, requestUrl string, requestBody interface{}, response *aurestclientapi.ParsedResponse) error

type PlaybackOptions added in v0.6.0

type PlaybackOptions struct {
	// ConstructFilenameCandidates contains filename constructor functions.
	//
	// The first one is considered "canonical", for all others, a log entry is printed that instructs the user
	// to rename the file.
	ConstructFilenameCandidates []aurestrecorder.ConstructFilenameFunction
	NowFunc                     func() time.Time
}

Jump to

Keyboard shortcuts

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