Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct {
StatusCode int
Headers map[string]string
Body string
}
Response represents a mocked HTTP response.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a custom HTTP transport for handling mocked responses.
func NewClient ¶
func NewClient() (*http.Client, *Transport)
NewClient creates an *http.Client configured to use the Transport.
func NewTransport ¶
func NewTransport() *Transport
NewTransport creates a new instance of Transport.
func (*Transport) AddResponse ¶
func (t *Transport) AddResponse(url string, response Response)
AddResponse registers a response for a given URL. Multiple responses for the same URL will be returned in sequence.
Click to show internal directories.
Click to hide internal directories.