Documentation ¶
Index ¶
- Variables
- type BaseMockResponse
- type ExpectHttp
- func (exp *ExpectHttp) Close()
- func (exp *ExpectHttp) ExpectRequest(url string, response MockResponse)
- func (exp *ExpectHttp) ExpectRequestWithHeaders(url string, response MockResponse, requestHeaders map[string]string)
- func (exp *ExpectHttp) Start() string
- func (exp *ExpectHttp) ValidateExpectations(T *testing.T)
- type MockRequest
- type MockResponse
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BaseMockResponse ¶
type BaseMockResponse struct {
// contains filtered or unexported fields
}
func (BaseMockResponse) Body ¶
func (res BaseMockResponse) Body() []byte
func (BaseMockResponse) Headers ¶
func (res BaseMockResponse) Headers() map[string]string
func (BaseMockResponse) Status ¶
func (res BaseMockResponse) Status() int
type ExpectHttp ¶
type ExpectHttp struct { Errors []string // contains filtered or unexported fields }
func NewExpectHttp ¶
func NewExpectHttp() *ExpectHttp
func (*ExpectHttp) Close ¶
func (exp *ExpectHttp) Close()
func (*ExpectHttp) ExpectRequest ¶
func (exp *ExpectHttp) ExpectRequest(url string, response MockResponse)
func (*ExpectHttp) ExpectRequestWithHeaders ¶ added in v0.2.0
func (exp *ExpectHttp) ExpectRequestWithHeaders(url string, response MockResponse, requestHeaders map[string]string)
func (*ExpectHttp) Start ¶
func (exp *ExpectHttp) Start() string
func (*ExpectHttp) ValidateExpectations ¶
func (exp *ExpectHttp) ValidateExpectations(T *testing.T)
type MockRequest ¶
type MockRequest struct { Url string Response MockResponse RequestHeaders map[string]string }
type MockResponse ¶
func JSONMockResponse ¶
func JSONMockResponse(status int, body interface{}, headers map[string]string) MockResponse
Click to show internal directories.
Click to hide internal directories.