WithHTTPClient sets the HTTP client for the API client.
(client *http.Client)
| 96 | |
| 97 | // WithHTTPClient sets the HTTP client for the API client. |
| 98 | func WithHTTPClient(client *http.Client) func(c *Client) error { |
| 99 | return func(c *Client) error { |
| 100 | if client == nil { |
| 101 | return errors.New("HTTP client is nil") |
| 102 | } |
| 103 | c.client = client |
| 104 | return nil |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | // NewClient returns a new Client given an API key and options. |
| 109 | func NewClient(opts ...func(c *Client) error) (*Client, error) { |
no outgoing calls