Documentation ¶
Index ¶
- Variables
- func NonSensitiveHeaders(h http.Header) http.Header
- type Doer
- type HTTPClient
- func (c *HTTPClient) Get(ctx context.Context, url string, headers *http.Header) (*http.Response, error)
- func (c *HTTPClient) GetBody(ctx context.Context, url string, headers *http.Header) (*http.Response, []byte, error)
- func (c *HTTPClient) GetJSON(ctx context.Context, url string, headers *http.Header, t interface{}) (*http.Response, error)
- func (c *HTTPClient) Post(ctx context.Context, url string, headers *http.Header, body io.Reader) (*http.Response, error)
- func (c *HTTPClient) PostBody(ctx context.Context, url string, headers *http.Header, body io.Reader) (*http.Response, []byte, error)
- func (c *HTTPClient) PostJSON(ctx context.Context, url string, headers *http.Header, body io.Reader, ...) (*http.Response, error)
- func (c *HTTPClient) Put(ctx context.Context, url string, headers *http.Header, body io.Reader) (*http.Response, error)
- func (c *HTTPClient) PutBody(ctx context.Context, url string, headers *http.Header, body io.Reader) (*http.Response, []byte, error)
- func (c *HTTPClient) PutJSON(ctx context.Context, url string, headers *http.Header, body io.Reader, ...) (*http.Response, error)
- func (c *HTTPClient) SetDebug(val bool)
- func (c *HTTPClient) SetHeaders(h http.Header)
- type Logger
- type RateLimit
- type RateLimiter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrResponse = errors.New("error response")
ErrResponse is the error that is wrapped and returned when there is a non-200 api response
Functions ¶
Types ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(deps dependencies) *HTTPClient
NewHTTPClient creates a new http client
func (*HTTPClient) SetDebug ¶
func (c *HTTPClient) SetDebug(val bool)
func (*HTTPClient) SetHeaders ¶
func (c *HTTPClient) SetHeaders(h http.Header)
Click to show internal directories.
Click to hide internal directories.