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: 0

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