Versions in this module Expand all Collapse all v0 v0.7.1 Aug 16, 2018 Changes in this version + const DefaultKeepAliveSecond + const DefaultTimeoutBySecond v0.5.1 May 31, 2018 Changes in this version + const DefaultMaxConnsPerHost + const DefaultTimoutBySecond + const FailureTypePrefix + const Name + const SchemaHTTP + const SchemaHTTPS + var ErrCanceled = errors.New("request cancelled") + var ErrInvalidReq = errors.New("rest consumer call arg is not *rest.Request type") + var ErrInvalidResp = errors.New("rest consumer response arg is not *rest.Response type") + var HTTPFailureTypeMap = map[string]bool + func NewRestClient(opts client.Options) client.ProtocolClient + type Client struct + func (c *Client) Call(ctx context.Context, addr string, req *client.Request, rsp interface{}) error + func (c *Client) Do(req *Request, resp *Response) (err error) + func (c *Client) String() string + type Request struct + Req *http.Request + func NewRequest(method, urlStr string, body ...[]byte) (*Request, error) + func (req *Request) Close() + func (req *Request) Copy() *Request + func (req *Request) GetContentType() string + func (req *Request) GetCookie(key string) string + func (req *Request) GetHeader(key string) string + func (req *Request) GetMethod() string + func (req *Request) GetRequest() *http.Request + func (req *Request) GetURI() string + func (req *Request) SetBody(body []byte) + func (req *Request) SetContentType(ct string) + func (req *Request) SetCookie(k, v string) + func (req *Request) SetHeader(key, value string) + func (req *Request) SetHeaderCookie(key, value string) + func (req *Request) SetMethod(method string) + func (req *Request) SetURI(url string) + type Response struct + Resp *http.Response + func NewResponse() *Response + func (resp *Response) Close() + func (resp *Response) GetCookie(key string) []byte + func (resp *Response) GetHeader() []byte + func (resp *Response) GetResponse() *http.Response + func (resp *Response) GetStatusCode() int + func (resp *Response) ReadBody() []byte + func (resp *Response) SetCookie(cookie *http.Cookie) + func (resp *Response) SetStatusCode(s int)