Documentation ¶
Index ¶
- type Mode
- type Passthrough
- type Recorder
- func (r *Recorder) AddFilter(filter cassette.Filter)
- func (r *Recorder) AddPassthrough(pass Passthrough)
- func (r *Recorder) AddSaveFilter(filter cassette.Filter)
- func (r *Recorder) CancelRequest(req *http.Request)
- func (r *Recorder) Mode() Mode
- func (r *Recorder) RoundTrip(req *http.Request) (*http.Response, error)
- func (r *Recorder) SetMatcher(matcher cassette.Matcher)
- func (r *Recorder) SetTransport(t http.RoundTripper)
- func (r *Recorder) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Passthrough ¶
Passthrough function allows ignoring certain requests.
type Recorder ¶
type Recorder struct { // Pass through requests. Passthroughs []Passthrough // contains filtered or unexported fields }
Recorder represents a type used to record and replay client and server interactions
func (*Recorder) AddFilter ¶
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) AddPassthrough ¶
func (r *Recorder) AddPassthrough(pass Passthrough)
AddPassthrough appends a hook to determine if a request should be ignored by the recorder.
func (*Recorder) AddSaveFilter ¶
AddSaveFilter appends a hook to modify a request before it is saved.
This filter is suitable for treating recorded responses to remove sensitive data. Altering responses using a regular AddFilter can have unintended consequences on code that is consuming responses.
func (*Recorder) CancelRequest ¶
CancelRequest implements the github.com/coreos/etcd/client.CancelableTransport interface
func (*Recorder) SetMatcher ¶
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