Documentation
¶
Index ¶
- type Client
- func (client *Client) Do(c context.Context, req *xhttp.Request, res interface{}, v ...string) (err error)
- func (client *Client) Get(c context.Context, uri, ip string, params url.Values, res interface{}) (err error)
- func (client *Client) NewRequest(method, uri, realIP string, params url.Values) (req *xhttp.Request, err error)
- func (client *Client) Post(c context.Context, uri, ip string, params url.Values, res interface{}) (err error)
- func (client *Client) Raw(c context.Context, req *xhttp.Request, v ...string) (bs []byte, err error)
- func (client *Client) SetTransport(t xhttp.RoundTripper)
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is http client.
func (*Client) Do ¶
func (client *Client) Do(c context.Context, req *xhttp.Request, res interface{}, v ...string) (err error)
Do sends an HTTP request and returns an HTTP json response.
func (*Client) Get ¶
func (client *Client) Get(c context.Context, uri, ip string, params url.Values, res interface{}) (err error)
Get issues a GET to the specified URL.
func (*Client) NewRequest ¶
func (client *Client) NewRequest(method, uri, realIP string, params url.Values) (req *xhttp.Request, err error)
NewRequest new http request with method, uri, ip, values and headers.
func (*Client) Post ¶
func (client *Client) Post(c context.Context, uri, ip string, params url.Values, res interface{}) (err error)
Post issues a Post to the specified URL.
func (*Client) Raw ¶
func (client *Client) Raw(c context.Context, req *xhttp.Request, v ...string) (bs []byte, err error)
Raw sends an HTTP request and returns bytes response
func (*Client) SetTransport ¶
func (client *Client) SetTransport(t xhttp.RoundTripper)
SetTransport set client transport
Click to show internal directories.
Click to hide internal directories.