Documentation
¶
Index ¶
- type Client
- func (c *Client) Get(ctx context.Context, url string) (Response, error)
- func (c *Client) GetCached(ctx context.Context, url string, ttl time.Duration) (Response, error)
- func (c *Client) GetWithLimit(ctx context.Context, url string, limitBytes int64) (Response, error)
- func (c *Client) WithRetryPolicy(maxRetries int, baseDelay time.Duration) *Client
- func (c *Client) WithTimeout(timeout time.Duration) *Client
- func (c *Client) WithTransport(transport http.RoundTripper) *Client
- type HTTPError
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a small context-aware HTTP client for Open Data Hub API calls.
func NewWithHTTPClient ¶
NewWithHTTPClient creates a client around an injected HTTP client.
func (*Client) GetWithLimit ¶ added in v0.1.5
GetWithLimit performs an HTTP GET and reads at most limitBytes bytes.
func (*Client) WithRetryPolicy ¶ added in v0.1.10
WithRetryPolicy returns a copy of the client with custom retry behavior.
func (*Client) WithTimeout ¶ added in v0.1.7
WithTimeout returns a copy of the client with a different HTTP timeout.
func (*Client) WithTransport ¶ added in v0.1.10
func (c *Client) WithTransport(transport http.RoundTripper) *Client
WithTransport returns a copy of the client using a specific RoundTripper.
Click to show internal directories.
Click to hide internal directories.