Documentation
¶
Index ¶
Constants ¶
View Source
const PlaybackRewritePathEnvVariable = "GO_AUTUMN_RESTCLIENT_PLAYBACK_REWRITE_PATH"
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(recorderPath string, additionalOptions ...PlaybackOptions) aurestclientapi.Client
New builds a new http client simulator based on playback.
Use this in your tests.
You can optionally add a PlaybackOptions instance to your call. The ... is really just so it's an optional argument.
Types ¶
type PlaybackImpl ¶
type PlaybackImpl struct {
RecorderPath string
RecorderRewritePath string
ConstructFilenameCandidates []aurestrecorder.ConstructFilenameFunction
Now func() time.Time
}
func (*PlaybackImpl) Perform ¶
func (c *PlaybackImpl) Perform(ctx context.Context, method string, requestUrl string, requestBody interface{}, response *aurestclientapi.ParsedResponse) error
type PlaybackOptions ¶ added in v0.6.0
type PlaybackOptions struct {
// ConstructFilenameCandidates contains filename constructor functions.
//
// The first one is considered "canonical", for all others, a log entry is printed that instructs the user
// to rename the file.
ConstructFilenameCandidates []aurestrecorder.ConstructFilenameFunction
NowFunc func() time.Time
}
Click to show internal directories.
Click to hide internal directories.