Documentation ¶
Overview ¶
Package replay provides the ability to record and replay HTTP requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGCPDialOptions ¶
func NewGCPDialOptions(t *testing.T, mode recorder.Mode, filename string) (opts []grpc.DialOption, done func())
NewGCPDialOptions return grpc.DialOptions that are to be appended to a GRPC dial request. These options allow a recorder/replayer to intercept RPCs and save RPCs to the file at filename, or read the RPCs from the file and return them.
func NewRecorder ¶
func NewRecorder(t *testing.T, mode recorder.Mode, matcher *ProviderMatcher, filename string) (r *recorder.Recorder, done func(), err error)
NewRecorder returns a go-vcr.Recorder which reads or writes golden files from the given path. When recording, done() saves the recording to a golden file. The Authorization request header is dropped, but otherwise the raw HTTP requests/responses are saved When replaying, HTTP requests are expected to arrive in the same order as in the recording. They are verified to have the same: -- Method -- URL -- Specific HTTP headers ((optional, via matcher). -- Body (optionally scrubbed, via matcher).