recorder

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: BSD-2-Clause Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int

Mode represents recording/playback mode

const (
	ModeRecording Mode = iota
	ModeReplaying
	ModeDisabled
)

Recorder states

type Recorder

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

Recorder represents a type used to record and replay client and server interactions

func New

func New(cassetteName string) (*Recorder, error)

New creates a new recorder

func NewAsMode

func NewAsMode(cassetteName string, mode Mode, realTransport http.RoundTripper) (*Recorder, error)

NewAsMode creates a new recorder in the specified mode

func (*Recorder) AddFilter

func (r *Recorder) AddFilter(filter cassette.Filter)

AddFilter appends a hook to modify a request before it is recorded.

Filters are useful for filtering out sensitive parameters from the recorded data.

func (*Recorder) CancelRequest

func (r *Recorder) CancelRequest(req *http.Request)

CancelRequest implements the github.com/coreos/etcd/client.CancelableTransport interface

func (*Recorder) RoundTrip

func (r *Recorder) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the http.RoundTripper interface

func (*Recorder) SetMatcher

func (r *Recorder) SetMatcher(matcher cassette.Matcher)

SetMatcher sets a function to match requests against recorded HTTP interactions.

func (*Recorder) SetTransport

func (r *Recorder) SetTransport(t http.RoundTripper)

SetTransport can be used to configure the behavior of the 'real' client used in record-mode

func (*Recorder) Stop

func (r *Recorder) Stop() error

Stop is used to stop the recorder and save any recorded interactions

Jump to

Keyboard shortcuts

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