Documentation
¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) Delete(path string, result any, opts *RequestOptions) error
- func (c *Client) Get(path string, result any, opts *RequestOptions) error
- func (c *Client) Patch(path string, body, result any, opts *RequestOptions) error
- func (c *Client) Post(path string, body, result any, opts *RequestOptions) error
- func (c *Client) Put(path string, body, result any, opts *RequestOptions) error
- type ClientConfig
- type RequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents an optimized API client with connection pooling
func NewClientWithConfig ¶
func NewClientWithConfig(config *ClientConfig) *Client
NewClientWithConfig creates a new API client with custom configuration
func (*Client) Delete ¶
func (c *Client) Delete(path string, result any, opts *RequestOptions) error
Delete performs a DELETE request
func (*Client) Get ¶
func (c *Client) Get(path string, result any, opts *RequestOptions) error
Get performs a GET request
func (*Client) Patch ¶
func (c *Client) Patch(path string, body, result any, opts *RequestOptions) error
Patch performs a PATCH request
type ClientConfig ¶
type ClientConfig struct {
BaseURL string
Timeout time.Duration
MaxIdleConns int
MaxIdleConnsPerHost int
IdleConnTimeout time.Duration
DialTimeout time.Duration
KeepAlive time.Duration
TLSHandshakeTimeout time.Duration
}
ClientConfig holds configuration for the API client
func DefaultClientConfig ¶
func DefaultClientConfig(baseURL string) *ClientConfig
DefaultClientConfig returns optimized defaults for the API client
Click to show internal directories.
Click to hide internal directories.