Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRequestor ¶
func SetRequestor(requestor Requestor)
SetRequestor sets the requestor used by Request
Types ¶
type MockRequestor ¶ added in v0.52.0
type MockRequestor struct {
// contains filtered or unexported fields
}
func NewMockRequestor ¶
func NewMockRequestor(mocks map[string][]*MockResponse) *MockRequestor
func (*MockRequestor) HasUnused ¶ added in v0.52.0
func (r *MockRequestor) HasUnused() bool
func (*MockRequestor) UnmarshalJSON ¶ added in v0.52.0
func (r *MockRequestor) UnmarshalJSON(data []byte) error
type MockResponse ¶ added in v0.52.0
type MockResponse struct { Status int `json:"status" validate:"required"` Body string `json:"body" validate:"required"` }
func NewMockResponse ¶
func NewMockResponse(status int, body string) *MockResponse
NewMockResponse creates a new mock response
type Requestor ¶
Requestor is anything that can make an HTTP request with a client
var DefaultRequestor Requestor = defaultRequestor{}
DefaultRequestor is the default HTTP requestor
type Trace ¶
type Trace struct { Request *http.Request Response *http.Response Body []byte RequestTrace []byte ResponseTrace []byte TimeTaken time.Duration }
Trace holds the complete trace of an HTTP request/response
Click to show internal directories.
Click to hide internal directories.