()
| 103 | } |
| 104 | |
| 105 | func (c *apiClient) Endpoint() string { |
| 106 | if c.cfg.Network() == "unix" { |
| 107 | return "http://unix/" |
| 108 | } |
| 109 | url := c.cfg.URL() |
| 110 | if !strings.HasSuffix(url, "/") { |
| 111 | url += "/" |
| 112 | } |
| 113 | return url |
| 114 | } |
| 115 | |
| 116 | func (c *apiClient) Do(req *http.Request) (*http.Response, error) { |
| 117 | req.Header.Set("X-Api-Key", c.apikey) |