Documentation
¶
Overview ¶
Package httpclient provides a shared HTTP client with retry logic and metrics instrumentation.
Package httpclient provides a shared HTTP client with retry logic and metrics instrumentation.
Index ¶
- func Validate(s interface{}) error
- func Validator() *validator.Validate
- type APIError
- type AuthType
- type Client
- func (c *Client) BaseURL() string
- func (c *Client) Get(ctx context.Context, path string, result interface{}) error
- func (c *Client) Post(ctx context.Context, path string, body interface{}, result interface{}) error
- func (c *Client) Put(ctx context.Context, path string, body interface{}, result interface{}) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps resty.Client with common configuration for API clients.
type Config ¶
type Config struct {
BaseURL string
APIKey string
AuthType AuthType
Timeout time.Duration
MaxRetries int
RetryWaitMin time.Duration
RetryWaitMax time.Duration
}
Config holds the configuration for creating a new HTTP client.
func DefaultConfig ¶
DefaultConfig returns a Config with sensible defaults.