Documentation ¶
Overview ¶
Package api provides low-level primitives for implementing interfaces to various HTTP APIs.
Index ¶
- func Get(endpoint *url.URL, apiKey string, body []byte) (res string, statusCode int, err error)
- func GetJSON(endpoint *url.URL, apiKey string, body []byte, v interface{}) (statusCode int, err error)
- func MakeAPIRequest(method string, endpoint *url.URL, APIKey string, body []byte) (res []byte, statusCode int, err error)
- func Post(endpoint *url.URL, apiKey string, body []byte) (res string, statusCode int, err error)
- func PostJSON(endpoint *url.URL, apiKey string, body []byte, v interface{}) (statusCode int, err error)
- type TimeoutError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJSON ¶
func GetJSON(endpoint *url.URL, apiKey string, body []byte, v interface{}) (statusCode int, err error)
GetJSON is a convenience method for MakeAPIRequest.
func MakeAPIRequest ¶
func MakeAPIRequest(method string, endpoint *url.URL, APIKey string, body []byte) (res []byte, statusCode int, err error)
MakeAPIRequest runs and logs a request backed by an `http.Client`.
Types ¶
type TimeoutError ¶
type TimeoutError error
Click to show internal directories.
Click to hide internal directories.