package
0.15.1
Repository: https://github.com/cisco-open/go-lanai.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

AdditionalMatcherOptions temporarily add additional RecordMatcherOptions to the current test context on top of test's HTTPVCROptions.
ApplyHttpLatency apply recorded HTTP latency.
Client extract http.Client that provided by Recorder.
ContextWithNewHttpRecorder is a convenient function that create a new HTTP recorder and store it in context.
ConvertCassetteFileV1toV2 is a utility function that help with migrating from httpvcr/v3 (using version 1 format) to httpvcr/v3 (using version 2 format).
No description provided by the author
DisableHttpRecorderHooks returns a HTTPVCROptions that removes installed hooks by name.
DisableHttpRecordingMode returns a HTTPVCROptions that force replaying mode regardless the command line flag.
DisableHttpRecordOrdering disable HTTP interactions order matching.
FixedDurationHook changes the duration of record HTTP interaction to constant, to avoid randomness.
FixedHttpRecordDuration install a hook to set a fixed duration on interactions before they are saved.
FuzzyForm returns RecordMatcherOptions that ignore form values (in queries and post body if applicable) of given keys during record matching Note: still check if the value exists, only value comparison is skipped.
FuzzyHeaders returns RecordMatcherOptions that ignore header values of given names during record matching Note: still check if the header exists, only value comparison is skipped.
FuzzyJsonPaths returns RecordMatcherOptions that ignore fields in JSON body that matching the given JSONPaths JSONPath Syntax: https://goessner.net/articles/JsonPath/.
FuzzyQueries returns RecordMatcherOptions that ignore query value of given keys during record matching Note: still check if the value exists, only value comparison is skipped.
HttpRecorderHooks returns a HTTPVCROptions that adds recording hooks.
HttpRecordIgnoreHost convenient HTTPVCROptions that would ignore host when matching recorded requests, equivalent to HttpRecordMatching(IgnoreHost()).
HttpRecordingMode returns a HTTPVCROptions that turns on Recording mode.
HttpRecordMatching returns a HTTPVCROptions that allows custom matching of recorded requests.
HttpRecordName returns a HTTPVCROptions that set HTTP record's name.
HttpRecordOrdering toggles HTTP interactions order matching.
HttpTransport override the RealTransport during recording mode.
IgnoreHost returns RecordMatcherOptions that ignore host during record matching.
InteractionIndexAwareHook inject interaction index into stored header: httpvcr store interaction's ID but doesn't expose it to cassette.MatcherFunc, so we need to store it in request for request matchers to access.
IsRecording returns true if HTTP VCR is in recording mode.
LocalhostRewriteHook changes the host of request to a pre-defined constant if it is localhost, in order to avoid randomness.
NewHttpRecorder create a new HttpRecorder.
No description provided by the author
No description provided by the author
NewRecordFormBodyMatcher returns RecordBodyMatcher that matches request bodies as application/x-www-form-urlencoded.
NewRecordHeaderMatcher returns RecordHeaderMatcherFunc that compare keys and values of recorded and actual queries Any header value is ignored if its key is in the optional fuzzyKeys.
NewRecordJsonBodyMatcher returns a RecordBodyMatcher that matches JSON body of recorded and outgoing request.
NewRecordLiteralBodyMatcher returns RecordBodyMatcher that matches request bodies literally.
NewRecordMatcher create a custom RecordMatcherFunc to compare recorded request and actual request.
NewRecordQueryMatcher returns RecordQueryMatcherFunc that compare keys and values of recorded and actual queries Any query value is ignored if its key is in the optional fuzzyKeys.
NewRecordURLMatcher returns RecordURLMatcherFunc that compares Method, Path, Host and Port.
No description provided by the author
PackageHttpRecordingMode returns a suitetest.PackageOptions that enables HTTP recording mode for the entire package.
Recorder extract HttpRecorder from given context.
No description provided by the author
ResetRecorder revert the change made by AdditionalMatcherOptions.
SanitizeHttpRecord install a hook to sanitize request and response before they are saved in file.
SanitizingHook is an HTTP VCR hook that sanitize values in header, query, body (x-form-urlencoded/json).
StopRecorder stops the recorder extracted from the given context.
No description provided by the author
WithHttpPlayback enables remote HTTP server playback capabilities supported by `httpvcr` This mode requires apptest.Bootstrap to work Each top-level test should have corresponding recorded HTTP responses in `testdata` folder, or the test will fail.
No description provided by the author

# Constants

nolint:gosec // G101: Potential hardcoded credentials, false positive.
No description provided by the author
No description provided by the author
DefaultHTTPDuration default duration of recorded HTTP interaction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ModeCommandline lets the commandline or the state in TestMain to determine the mode.
Recorder states.
Recorder states.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

HttpRecorder wrapper of recorder.RawRecorder, used to hold some value that normally inaccessible via wrapped recorder.RawRecorder.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RemoteTokenStoreReader implements oauth2.TokenStoreReader that leverage /check_token endpoint to load authentication Note: this implementation is not mocks.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
RecorderHook wrapper of recorder.Hook.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author