Versions in this module Expand all Collapse all v0 v0.0.13 Jan 18, 2020 v0.0.12 May 4, 2019 Changes in this version + const UnixBasePath + func DrainAndClose(res *http.Response) + func DrainResponseBody(res *http.Response) ([]byte, error) + func IsSuccess(status int) bool + func JoinPath(base string, sub string) string + type BasicErrorHandler struct + func (h BasicErrorHandler) DecodeError(status int, body []byte, res *http.Response) error + func (h BasicErrorHandler) IsError(status int, res *http.Response) bool + type Client struct + func New(base string, opts ...Option) (*Client, error) + func NewDefault(base string) (*Client, error) + func NewDefaultSkipVerify(base string) (*Client, error) + func (c *Client) Delete(ctx *Context, path string, resBody interface{}) error + func (c *Client) DeleteIgnoreRes(ctx *Context, path string) error + func (c *Client) DeleteRaw(ctx *Context, path string) (*http.Response, error) + func (c *Client) Do(ctx *Context, method httputil.Method, path string, reqBody interface{}) (*http.Response, error) + func (c *Client) FetchTo(ctx *Context, method httputil.Method, path string, reqBody interface{}, ...) error + func (c *Client) FetchToNull(ctx *Context, method httputil.Method, path string, reqBody interface{}) error + func (c *Client) Get(ctx *Context, path string, resBody interface{}) error + func (c *Client) GetHeaders() map[string]string + func (c *Client) GetIgnoreRes(ctx *Context, path string) error + func (c *Client) GetRaw(ctx *Context, path string) (*http.Response, error) + func (c *Client) NewRequest(ctx *Context, method httputil.Method, path string, reqBody interface{}) (*http.Request, error) + func (c *Client) Patch(ctx *Context, path string, reqBody interface{}, resBody interface{}) error + func (c *Client) PatchIgnoreRes(ctx *Context, path string, reqBody interface{}) error + func (c *Client) PatchRaw(ctx *Context, path string, reqBody interface{}) (*http.Response, error) + func (c *Client) Post(ctx *Context, path string, reqBody interface{}, resBody interface{}) error + func (c *Client) PostIgnoreRes(ctx *Context, path string, reqBody interface{}) error + func (c *Client) PostRaw(ctx *Context, path string, reqBody interface{}) (*http.Response, error) + func (c *Client) SetHeader(k, v string) *Client + func (c *Client) Transport() (tr *http.Transport, ok bool) + type Context struct + func Bkg() *Context + func ConvertContext(ctx context.Context) *Context + func NewContext(ctx context.Context) *Context + func (c *Context) Deadline() (deadline time.Time, ok bool) + func (c *Context) Done() <-chan struct{} + func (c *Context) Err() error + func (c *Context) SetBase(s string) *Context + func (c *Context) SetErrorHandler(h ErrorHandler) *Context + func (c *Context) SetHeader(k, v string) *Context + func (c *Context) SetParam(k, v string) *Context + func (c *Context) Value(key interface{}) interface{} + type ErrApplication struct + Body string + Method httputil.Method + Path string + Status int + Url string + func (e *ErrApplication) Error() string + type ErrDecoding struct + Body string + Codec string + Err error + func (e *ErrDecoding) Error() string + type ErrorHandler interface + DecodeError func(status int, body []byte, res *http.Response) (decodedError error) + IsError func(status int, res *http.Response) bool + func DefaultHandler() ErrorHandler + type ErrorHandlerFunc func(status int, body []byte, res *http.Response) (decodedError error) + func (f ErrorHandlerFunc) DecodeError(status int, body []byte, res *http.Response) error + func (f ErrorHandlerFunc) IsError(status int, res *http.Response) bool + type Option func(c *Client) error + func UseJSON() Option + func WithErrorHandler(h ErrorHandler) Option + func WithErrorHandlerFunc(f ErrorHandlerFunc) Option + func WithTransport(tr *http.Transport) Option