httprecorder

package
v1.0.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 `SDK_UPDATE_CASSETTES=true` to the environment variables. When updating cassettes, make sure your Scaleway credentials are set in your config or in the variables `SCW_ACCESS_KEY` and `SCW_SECRET_KEY`.

func IsUpdatingCassette

func IsUpdatingCassette() bool

IsUpdatingCassette returns true if we are updating cassettes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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