httprecorder

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UpdateCassette = false

UpdateCassette is true when we are updating the cassette

Functions

func CreateRecordedScwClient

func CreateRecordedScwClient(cassetteName string) (*scw.Client, *recorder.Recorder, error)

CreateRecordedScwClient creates a new scw.Client that records all HTTP requests in a cassette. This cassette is then replayed whenever tests are executed again. This means that once the requests are recorded in the cassette, no more real HTTP request must be made to run the tests.

It is important to call add a `defer recorder.Stop()` so the given cassette files are correctly closed and saved after the requests.

To update the cassette files, add `UPDATE` to the environment variables. When using `UPDATE`, also the `SCW_ACCESS_KEY` and `SCW_SECRET_KEY` must be set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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