Documentation
¶
Index ¶
- Constants
- func Delete(url string, rfs ...RequestFunc) (*resty.Response, error)
- func Download(url, path string, rfs ...RequestFunc) error
- func Get(url string, rfs ...RequestFunc) (*resty.Response, error)
- func Head(url string, rfs ...RequestFunc) (*resty.Response, error)
- func Options(url string, rfs ...RequestFunc) (*resty.Response, error)
- func Patch(url string, rfs ...RequestFunc) (*resty.Response, error)
- func Post(url string, rfs ...RequestFunc) (*resty.Response, error)
- func Put(url string, rfs ...RequestFunc) (*resty.Response, error)
- type Client
- func (c *Client) Delete(url string, rfs ...RequestFunc) (*resty.Response, error)
- func (c *Client) Get(url string, rfs ...RequestFunc) (*resty.Response, error)
- func (c *Client) Head(url string, rfs ...RequestFunc) (*resty.Response, error)
- func (c *Client) Options(url string, rfs ...RequestFunc) (*resty.Response, error)
- func (c *Client) Patch(url string, rfs ...RequestFunc) (*resty.Response, error)
- func (c *Client) Post(url string, rfs ...RequestFunc) (*resty.Response, error)
- func (c *Client) Put(url string, rfs ...RequestFunc) (*resty.Response, error)
- func (c *Client) Request(method, url string, rfs ...RequestFunc) (*resty.Response, error)
- type ClientFunc
- type Error
- type RequestFunc
- func ForceContentType(contentType string) RequestFunc
- func SetBody(body interface{}) RequestFunc
- func SetHeader(header, value string) RequestFunc
- func SetQueryParam(param, value string) RequestFunc
- func SetQueryParams(params map[string]string) RequestFunc
- func SetQueryParamsFromValues(params url.Values) RequestFunc
- func SetResult(res interface{}) RequestFunc
Constants ¶
View Source
const UserAgent = "Zadig REST Client"
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download(url, path string, rfs ...RequestFunc) error
Download retrieves content from the given url and write it to path.
Types ¶
type Client ¶
type Client struct {
*resty.Client
Host string // http://example.org
BaseURI string // /api/v1
}
func New ¶
func New(cfs ...ClientFunc) *Client
type ClientFunc ¶
type ClientFunc func(*Client)
func SetAuthScheme ¶
func SetAuthScheme(scheme string) ClientFunc
func SetAuthToken ¶
func SetAuthToken(token string) ClientFunc
func SetBaseURI ¶
func SetBaseURI(uri string) ClientFunc
func SetBasicAuth ¶
func SetBasicAuth(username, password string) ClientFunc
func SetHostURL ¶
func SetHostURL(url string) ClientFunc
func SetProxy ¶
func SetProxy(proxyURL string) ClientFunc
type RequestFunc ¶
func ForceContentType ¶
func ForceContentType(contentType string) RequestFunc
func SetBody ¶
func SetBody(body interface{}) RequestFunc
func SetHeader ¶
func SetHeader(header, value string) RequestFunc
func SetQueryParam ¶
func SetQueryParam(param, value string) RequestFunc
func SetQueryParams ¶
func SetQueryParams(params map[string]string) RequestFunc
func SetQueryParamsFromValues ¶
func SetQueryParamsFromValues(params url.Values) RequestFunc
func SetResult ¶
func SetResult(res interface{}) RequestFunc
Click to show internal directories.
Click to hide internal directories.