Documentation ¶
Overview ¶
Package httpreplay provides an API for recording and replaying traffic from HTTP-based Google API clients.
To record:
- Call NewRecorder to get a Recorder.
- Use its Client method to obtain an HTTP client to use when making API calls.
- Close the Recorder when you're done. That will save the log of interactions to the file you provided to NewRecorder.
To replay:
- Call NewReplayer with the same filename you used to record to get a Replayer.
- Call its Client method and use the client to make the same API calls. You will get back the recorded responses.
- Close the Replayer when you're done.
This package is EXPERIMENTAL and is subject to change or removal without notice.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
A Recorder records HTTP interactions.
func NewRecorder ¶
NewRecorder creates a recorder that writes to filename.
You must call Close on the Recorder to ensure that all data is written.
type Replayer ¶
type Replayer struct {
// contains filtered or unexported fields
}
A Replayer replays previously recorded HTTP interactions.
func NewReplayer ¶
NewReplayer creates a replayer that reads from filename.
Click to show internal directories.
Click to hide internal directories.