Documentation
¶
Index ¶
- type AuthenticatedClient
- func (c *AuthenticatedClient) Delete(ctx context.Context, path string) (*http.Response, error)
- func (c *AuthenticatedClient) Do(req *http.Request) (*http.Response, error)
- func (c *AuthenticatedClient) Get(ctx context.Context, path string) (*http.Response, error)
- func (c *AuthenticatedClient) Post(ctx context.Context, path string, body io.Reader) (*http.Response, error)
- func (c *AuthenticatedClient) Put(ctx context.Context, path string, body io.Reader) (*http.Response, error)
- type HTTPClient
- func (c *HTTPClient) Do(req *http.Request) (*http.Response, error)
- func (c *HTTPClient) DoWithContext(ctx context.Context, req *http.Request) (*http.Response, error)
- func (c *HTTPClient) Get(url string) (*http.Response, error)
- func (c *HTTPClient) GetWithContext(ctx context.Context, url string) (*http.Response, error)
- func (c *HTTPClient) WithRetries(maxRetries int, retryDelay time.Duration) *HTTPClient
- func (c *HTTPClient) WithTimeout(timeout time.Duration) *HTTPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatedClient ¶
type AuthenticatedClient struct {
// contains filtered or unexported fields
}
AuthenticatedClient wraps http.Client with automatic OAuth authentication
func NewAuthenticatedClient ¶
func NewAuthenticatedClient(cfg *config.Config) (*AuthenticatedClient, error)
NewAuthenticatedClient creates a new authenticated HTTP client
func (*AuthenticatedClient) Do ¶
Do performs an HTTP request with automatic authentication and retry on 401
type HTTPClient ¶ added in v0.2.24
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient wraps http.Client with additional features
func NewHTTPClient ¶ added in v0.2.24
func NewHTTPClient() *HTTPClient
NewHTTPClient creates a new HTTP client with sensible defaults
func (*HTTPClient) DoWithContext ¶ added in v0.2.24
DoWithContext executes an HTTP request with a custom context
func (*HTTPClient) Get ¶ added in v0.2.24
func (c *HTTPClient) Get(url string) (*http.Response, error)
Get performs a GET request with retry logic
func (*HTTPClient) GetWithContext ¶ added in v0.2.24
GetWithContext performs a GET request with context
func (*HTTPClient) WithRetries ¶ added in v0.2.24
func (c *HTTPClient) WithRetries(maxRetries int, retryDelay time.Duration) *HTTPClient
WithRetries sets custom retry parameters
func (*HTTPClient) WithTimeout ¶ added in v0.2.24
func (c *HTTPClient) WithTimeout(timeout time.Duration) *HTTPClient
WithTimeout sets a custom timeout for the client
Click to show internal directories.
Click to hide internal directories.