Documentation ¶
Index ¶
- func CassetteFileExists(cassetteName string) (bool, error)
- func CassetteFileName(cassetteName string) string
- func EnsureCassetteFileExists(cassetteName string) error
- type FakeRoundTripper
- type Interface
- type Redactor
- func (r *Redactor) AddLiteralRedaction(redactionValue string, replacementValue string)
- func (r *Redactor) AddRegexRedaction(regex string, replacementValue string)
- func (r *Redactor) HideRecordingData(s string) string
- func (r *Redactor) HideURLData(s string) string
- func (r *Redactor) RedactRequestHeaders(headers http.Header)
- func (r *Redactor) RedactResponseHeaders(headers http.Header)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CassetteFileExists ¶
func CassetteFileName ¶
Types ¶
type FakeRoundTripper ¶
type FakeRoundTripper struct {
// contains filtered or unexported fields
}
FakeRoundTripper is a fake implementation of http.RoundTripper used in testing.
func NewFakeRoundTripper ¶
func NewFakeRoundTripper() *FakeRoundTripper
func (*FakeRoundTripper) AddError ¶
func (fake *FakeRoundTripper) AddError(request *http.Request, err error)
AddError adds an error to the fake round tripper.
func (*FakeRoundTripper) AddResponse ¶
func (fake *FakeRoundTripper) AddResponse(request *http.Request, response *http.Response)
AddResponse adds a response to the fake round tripper.
type Interface ¶
type Interface interface { // Cfg returns the available configuration for the test Cfg() config.Values // Creds returns Azure credentials when running for real Creds() azcore.TokenCredential // IDs returns the available Azure resource IDs for the test IDs() creds.AzureIDs // AddLiteralRedaction adds literal redaction value to redactor AddLiteralRedaction(redactionValue, replacementValue string) // AddRegexpRedaction adds regular expression redaction value to redactor AddRegexpRedaction(pattern, replacementValue string) // Stop recording Stop() error // IsReplaying returns true if we're replaying a recorded test, false if we're recording a new test IsReplaying() bool // CreateClient creates an HTTP client configured to record or replay HTTP requests. // t is a reference to the test currently executing. CreateClient(t *testing.T) *http.Client }
Interface is a lightweight interface that allows us to swap out implementations of Go-VCR as required.
type Redactor ¶
type Redactor struct {
// contains filtered or unexported fields
}
func NewRedactor ¶
func (*Redactor) AddLiteralRedaction ¶
func (*Redactor) AddRegexRedaction ¶
func (*Redactor) HideRecordingData ¶
func (*Redactor) HideURLData ¶
func (*Redactor) RedactRequestHeaders ¶
func (*Redactor) RedactResponseHeaders ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.