Versions in this module Expand all Collapse all v0 v0.0.1 Sep 23, 2021 Changes in this version + var DefaultClient = &Client + func DeleteJson(url string, headers map[string]string, body, data interface{}) error + func DeleteJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func GetJson(url string, headers map[string]string, body, data interface{}) error + func GetJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func HeadJson(url string, headers map[string]string, body, data interface{}) error + func HeadJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func PostJson(url string, headers map[string]string, body, data interface{}) error + func PostJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func PutJson(url string, headers map[string]string, body, data interface{}) error + func PutJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + type Client struct + BaseUrl string + Client *http.Client + MarshalFunc func(v interface{}) ([]byte, error) + UnmarshalFunc func(data []byte, v interface{}) error + func (c *Client) Delete(url string, headers map[string]string, body interface{}) (*Response, error) + func (c *Client) DeleteCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func (c *Client) DeleteJson(url string, headers map[string]string, body, data interface{}) error + func (c *Client) DeleteJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func (c *Client) Do(method, url string, headers map[string]string, body interface{}) (*Response, error) + func (c *Client) DoCtx(ctx context.Context, opName, method, url string, headers map[string]string, ...) (*Response, error) + func (c *Client) DoJson(method, url string, headers map[string]string, body, data interface{}) error + func (c *Client) DoJsonCtx(ctx context.Context, opName, method, url string, headers map[string]string, ...) error + func (c *Client) DoReq(req *http.Request) (*Response, error) + func (c *Client) Get(url string, headers map[string]string, body interface{}) (*Response, error) + func (c *Client) GetCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func (c *Client) GetJson(url string, headers map[string]string, body, data interface{}) error + func (c *Client) GetJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func (c *Client) GetMarshalFunc() func(v interface{}) ([]byte, error) + func (c *Client) Head(url string, headers map[string]string, body interface{}) (*Response, error) + func (c *Client) HeadCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func (c *Client) HeadJson(url string, headers map[string]string, body, data interface{}) error + func (c *Client) HeadJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func (c *Client) Post(url string, headers map[string]string, body interface{}) (*Response, error) + func (c *Client) PostCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func (c *Client) PostJson(url string, headers map[string]string, body, data interface{}) error + func (c *Client) PostJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + func (c *Client) Put(url string, headers map[string]string, body interface{}) (*Response, error) + func (c *Client) PutCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func (c *Client) PutJson(url string, headers map[string]string, body, data interface{}) error + func (c *Client) PutJsonCtx(ctx context.Context, opName, url string, headers map[string]string, ...) error + type CodeMessageData struct + Code string + Data interface{} + Message string + func (cmd *CodeMessageData) ValidateResponse(resp *Response) error + type Response struct + UnmarshalFunc func(data []byte, v interface{}) error + func Delete(url string, headers map[string]string, body interface{}) (*Response, error) + func DeleteCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func Get(url string, headers map[string]string, body interface{}) (*Response, error) + func GetCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func Head(url string, headers map[string]string, body interface{}) (*Response, error) + func HeadCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func Post(url string, headers map[string]string, body interface{}) (*Response, error) + func PostCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func Put(url string, headers map[string]string, body interface{}) (*Response, error) + func PutCtx(ctx context.Context, opName, url string, headers map[string]string, ...) (*Response, error) + func (resp *Response) Body() []byte + func (resp *Response) Check(codes ...int) error + func (resp *Response) CodeError() error + func (resp *Response) GetUnmarshalFunc() func(data []byte, v interface{}) error + func (resp *Response) Json(data interface{}) error + func (resp *Response) Ok() error