Documentation ¶
Index ¶
- func DefaultTestServer() *httptest.Server
- func MockHTTPClient(url string) api.Client
- type MockAPIRequest
- func (r MockAPIRequest) Delete(endpoint string) (*http.Response, error)
- func (r MockAPIRequest) Get(endpoint string) (*http.Response, error)
- func (r MockAPIRequest) MakeRequest(method string, url string, body string) (*http.Request, error)
- func (r MockAPIRequest) Post(endpoint string, data interface{}) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultTestServer ¶
DefaultTestServer creates a new http server
func MockHTTPClient ¶
MockHTTPClient mocks an http client
Types ¶
type MockAPIRequest ¶
type MockAPIRequest struct { StatusCode int // contains filtered or unexported fields }
MockAPIRequest implements the api.Request interface used for testing
func MakeMockAPIRequest ¶
func MakeMockAPIRequest(data *os.File, code int) MockAPIRequest
MakeMockAPIRequest creates and returns a MockAPIRequest data is a file pointer to the data to return for the request code is the status code that should be returned for the request
func (MockAPIRequest) Delete ¶
func (r MockAPIRequest) Delete(endpoint string) (*http.Response, error)
Delete returns a mocked http response
func (MockAPIRequest) Get ¶
func (r MockAPIRequest) Get(endpoint string) (*http.Response, error)
Get returns a mocked http response
func (MockAPIRequest) MakeRequest ¶
MakeRequest returns a mocked http request
Click to show internal directories.
Click to hide internal directories.