Documentation
¶
Index ¶
- func CreateHeaders(apiKey string) map[string]string
- type Client
- func (c *Client) Delete(ctx context.Context, url string, headers map[string]string) (*Response, error)
- func (c *Client) Get(ctx context.Context, url string, headers map[string]string) (*Response, error)
- func (c *Client) Patch(ctx context.Context, url string, body interface{}, headers map[string]string) (*Response, error)
- func (c *Client) Post(ctx context.Context, url string, body interface{}, headers map[string]string) (*Response, error)
- func (c *Client) Put(ctx context.Context, url string, body interface{}, headers map[string]string) (*Response, error)
- type HTTPClient
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHeaders ¶
CreateHeaders creates a standard set of headers with optional API key
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the base HTTP client for the SDK
func NewClientWithHTTPClient ¶
NewClientWithHTTPClient creates a new client with a custom HTTP client
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, url string, headers map[string]string) (*Response, error)
Delete performs a DELETE request
func (*Client) Patch ¶
func (c *Client) Patch(ctx context.Context, url string, body interface{}, headers map[string]string) (*Response, error)
Patch performs a PATCH request
type HTTPClient ¶
type HTTPClient interface {
Get(ctx context.Context, url string, headers map[string]string) (*Response, error)
Post(ctx context.Context, url string, body interface{}, headers map[string]string) (*Response, error)
Put(ctx context.Context, url string, body interface{}, headers map[string]string) (*Response, error)
Patch(ctx context.Context, url string, body interface{}, headers map[string]string) (*Response, error)
Delete(ctx context.Context, url string, headers map[string]string) (*Response, error)
}
HTTPClient defines the interface for making HTTP requests
Click to show internal directories.
Click to hide internal directories.