Documentation
¶
Index ¶
- type APIError
- type AuthHeader
- type Client
- func (c *Client) Delete(ctx context.Context, path string) error
- func (c *Client) Do(ctx context.Context, req Request) (*http.Response, error)
- func (c *Client) Get(ctx context.Context, path string, result any) error
- func (c *Client) Post(ctx context.Context, path string, body, result any) error
- func (c *Client) Put(ctx context.Context, path string, body, result any) error
- type ClientOption
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHeader ¶
AuthHeader defines a custom authentication header name and value format.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(apiKey string, opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(*Client)
func WithAuthHeader ¶
func WithAuthHeader(name, value string) ClientOption
WithAuthHeader sets a custom auth header instead of the default Authorization: Bearer.
func WithBaseURL ¶
func WithBaseURL(url string) ClientOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
func WithUserAgent ¶
func WithUserAgent(ua string) ClientOption
Click to show internal directories.
Click to hide internal directories.