Documentation ¶
Index ¶
- func BuildResponse(code int, payload []byte) *http.Response
- func BuildResponseJson(code int, payload interface{}) *http.Response
- func BuildResponseString(code int, payload string) *http.Response
- func DeleteHeader(resp *http.Response, name string) *http.Response
- func HttpClientFromFile(filename string) *http.Client
- func HttpClientSaver(saved **http.Request, content string) *http.Client
- func HttpClientSaverWithJson(saved **http.Request, jsonData interface{}) *http.Client
- func HttpClientWithContent(content string) *http.Client
- func HttpClientWithError(err error) *http.Client
- func HttpClientWithJson(jsonData interface{}) *http.Client
- func MockWithJsonReply(url string, rawData interface{}) *http.Client
- func SetHeader(resp *http.Response, name string, value string) *http.Response
- type EchoSave
- type MockTransport
- func (transport *MockTransport) DELETE(path string, f RoundTripFunc)
- func (transport *MockTransport) GET(path string, f RoundTripFunc)
- func (transport *MockTransport) POST(path string, f RoundTripFunc)
- func (transport *MockTransport) PUT(path string, f RoundTripFunc)
- func (transport *MockTransport) PostOrDelete(isDelete bool, path string, f RoundTripFunc)
- func (transport *MockTransport) RoundTrip(req *http.Request) (*http.Response, error)
- type RoundTripFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildResponseJson ¶
func HttpClientFromFile ¶
func HttpClientSaver ¶
"Saver" refers to saving the *http.Request in a local variable provided by the caller.
func HttpClientSaverWithJson ¶
func HttpClientWithContent ¶
func HttpClientWithError ¶
func HttpClientWithJson ¶
func MockWithJsonReply ¶
Types ¶
type MockTransport ¶
type MockTransport struct {
// contains filtered or unexported fields
}
func (*MockTransport) DELETE ¶
func (transport *MockTransport) DELETE(path string, f RoundTripFunc)
func (*MockTransport) GET ¶
func (transport *MockTransport) GET(path string, f RoundTripFunc)
func (*MockTransport) POST ¶
func (transport *MockTransport) POST(path string, f RoundTripFunc)
func (*MockTransport) PUT ¶
func (transport *MockTransport) PUT(path string, f RoundTripFunc)
func (*MockTransport) PostOrDelete ¶
func (transport *MockTransport) PostOrDelete(isDelete bool, path string, f RoundTripFunc)
Used for migration to MAX v3 api, where order cancel uses DELETE (MAX v2 api uses POST).
Click to show internal directories.
Click to hide internal directories.