Versions in this module Expand all Collapse all v2 v2.3.1 Apr 26, 2024 v2.3.0 Apr 19, 2024 v2.2.0 Feb 23, 2024 Changes in this version + const TimeoutSeconds + const UserAgent + 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 IsNotFound(err error) bool + 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 struct + BaseURI string + Host string + IgnoreCodes sets.Int + func New(cfs ...ClientFunc) *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 func(*Client) + func SetAuthScheme(scheme string) ClientFunc + func SetAuthToken(token string) ClientFunc + func SetBaseURI(uri string) ClientFunc + func SetBasicAuth(username, password string) ClientFunc + func SetClientHeader(header, value string) ClientFunc + func SetHostURL(url string) ClientFunc + func SetIgnoreCodes(codes ...int) ClientFunc + func SetProxy(proxyURL string) ClientFunc + func SetRetryCount(count int) ClientFunc + func SetRetryWaitTime(waitTime time.Duration) ClientFunc + func SetTLSClientConfig(config *tls.Config) ClientFunc + func UnsetTimeout() ClientFunc + type Error struct + Code int + Detail string + ErrStatus StatusReason + Message string + func NewErrorFromRestyResponse(res *resty.Response) *Error + func NewGenericServerResponse(code int, method string, detail string) *Error + func (e *Error) Error() string + func (e *Error) Status() StatusReason + type RequestFunc func(request *resty.Request) + func ForceContentType(contentType string) RequestFunc + func SetBody(body interface{}) RequestFunc + func SetFormData(data map[string]string) RequestFunc + func SetHeader(header, value string) RequestFunc + func SetHeaders(headers map[string]string) RequestFunc + func SetHeadersFromHTTPHeader(header http.Header) 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 + type StatusReason string + const StatusReasonAlreadyExists + const StatusReasonBadRequest + const StatusReasonConflict + const StatusReasonForbidden + const StatusReasonGone + const StatusReasonInternalError + const StatusReasonInvalid + const StatusReasonMethodNotAllowed + const StatusReasonNotAcceptable + const StatusReasonNotFound + const StatusReasonServiceUnavailable + const StatusReasonTooManyRequests + const StatusReasonUnauthorized + const StatusReasonUnknown + const StatusReasonUnsupportedMediaType + func ReasonForError(err error) StatusReason v2.2.0-20240131 Feb 9, 2024 Other modules containing this package github.com/koderover/zadig