Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Func ¶
type Func func(*http.HttpRequest, *http.HttpResponse) error
Func is the handler to process http request and return a http response or error
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
HttpClient is the mocked client of ucloud api
func NewHttpClient ¶
func NewHttpClient() *HttpClient
NewHttpClient will return a new mocked client instance
func (*HttpClient) MockData ¶
func (c *HttpClient) MockData(fn DataFunc) error
MockData will append the data mocking function to the mocked client
func (*HttpClient) MockHTTP ¶
func (c *HttpClient) MockHTTP(fn Func) error
MockHTTP will append the mocking function to the mocked client
func (*HttpClient) Send ¶
func (c *HttpClient) Send(req *http.HttpRequest) (*http.HttpResponse, error)
Send is the mocked method to handle the request and response data
Click to show internal directories.
Click to hide internal directories.