Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (h *Client) Delete(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *Client) Get(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *Client) Post(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *Client) Put(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte)
- func (h *Client) Request(method string, params []KeyValue, requestBody interface{}, headers []KeyValue) (err error, code int, respBody []byte)
- type IHttpClient
- type KeyValue
Constants ¶
View Source
const ErrorCode = -1
Variables ¶
View Source
var DefaultTransport = &http.Transport{ DialContext: (&net.Dialer{ Timeout: 500 * time.Millisecond, }).DialContext, TLSHandshakeTimeout: 1000 * time.Millisecond, MaxIdleConns: 100, IdleConnTimeout: 30 * time.Second, }
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
type IHttpClient ¶
type IHttpClient interface { Request(method string, params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Get(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Post(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Delete(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) Put(params []KeyValue, body interface{}, header []KeyValue) (error, int, []byte) }
Click to show internal directories.
Click to hide internal directories.