Documentation ¶
Index ¶
Constants ¶
View Source
const RecorderPathEnvVariable = "GO_AUTUMN_RESTCLIENT_RECORDER_PATH"
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(wrapped aurestclientapi.Client) aurestclientapi.Client
New builds a new http recorder.
Insert this into your stack just above the actual http client.
Normally it does nothing, but if you set the environment variable RecorderPathEnvVariable to a path to a directory, it will write response recordings for your requests that you can then play back using aurestplayback.PlaybackImpl in your tests.
Types ¶
type RecorderData ¶
type RecorderData struct { Method string `json:"method"` RequestUrl string `json:"requestUrl"` RequestBody interface{} `json:"requestBody,omitempty"` ParsedResponse aurestclientapi.ParsedResponse `json:"parsedResponse"` Error error `json:"error,omitempty"` }
type RecorderImpl ¶
type RecorderImpl struct { Wrapped aurestclientapi.Client RecorderPath string }
func (*RecorderImpl) Perform ¶
func (c *RecorderImpl) Perform(ctx context.Context, method string, requestUrl string, requestBody interface{}, response *aurestclientapi.ParsedResponse) error
Click to show internal directories.
Click to hide internal directories.