Documentation
¶
Index ¶
- func NewHTTPError(resp *http.Response) error
- type Client
- func (c *Client) Delete(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) Do(ctx context.Context, method, path string, body io.Reader) (*http.Response, error)
- func (c *Client) Get(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) Post(ctx context.Context, path string, body []byte) (*http.Response, error)
- func (c *Client) Put(ctx context.Context, path string, body []byte) (*http.Response, error)
- type Config
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPError ¶
NewHTTPError creates a new HTTP error from a response
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client with retry logic, authentication, and logging
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, method, path string, body io.Reader) (*http.Response, error)
Do performs an HTTP request with retry logic
type Config ¶
type Config struct {
BaseURL string
Auth auth.Provider
CustomHeaders map[string]string
Logger *zerolog.Logger
Timeout time.Duration
MaxRetries int
RetryDelay time.Duration
SSLVerify bool
HTTPProxy string
HTTPSProxy string
SOCKSProxy string
NoProxy string
}
Config holds the configuration for creating a new client
Click to show internal directories.
Click to hide internal directories.