Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type Client
- func (c *Client) Delete(path string, params url.Values) (json.RawMessage, error)
- func (c *Client) Do(method, baseURL, path string, params url.Values, body any) (json.RawMessage, error)
- func (c *Client) DoWithHeaders(method, baseURL, path string, params url.Values, headers http.Header, body any) (json.RawMessage, error)
- func (c *Client) Get(path string, params url.Values) (json.RawMessage, error)
- func (c *Client) GetData(path string, params url.Values) (json.RawMessage, error)
- func (c *Client) Patch(path string, params url.Values, body any) (json.RawMessage, error)
- func (c *Client) Post(path string, params url.Values, body any) (json.RawMessage, error)
- func (c *Client) Put(path string, params url.Values, body any) (json.RawMessage, error)
- func (c *Client) RawRequest(method, fullURL string, body any) (json.RawMessage, error)
- func (c *Client) SetTimeout(d time.Duration)
Constants ¶
View Source
const ( ExitAPIError = 1 ExitAuthError = 2 )
Variables ¶
View Source
var Version = "dev"
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type Client ¶
type Client struct {
HTTP *http.Client
BaseURL string
DataURL string
APIKey string
Secret string
AccessToken string
UserAgent string
Verbose bool
Debug bool
Quiet bool
Trace bool
Timeout time.Duration
}
func (*Client) Do ¶ added in v0.0.5
func (c *Client) Do(method, baseURL, path string, params url.Values, body any) (json.RawMessage, error)
Do sends an HTTP request against baseURL + path with optional query params and body. All other Client methods are thin wrappers around Do.
func (*Client) DoWithHeaders ¶ added in v0.0.13
func (c *Client) DoWithHeaders(method, baseURL, path string, params url.Values, headers http.Header, body any) (json.RawMessage, error)
DoWithHeaders sends an HTTP request with endpoint-specific headers.
func (*Client) RawRequest ¶
func (*Client) SetTimeout ¶
Click to show internal directories.
Click to hide internal directories.