Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client that wraps a Doer with base URL and auth headers.
func New ¶
New creates a production Client from the given Config. It defaults Timeout to 30s if unset, and InsecureSkipVerify to false.
func NewWithDoer ¶
NewWithDoer creates a Client with an injected Doer for testing.
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, method, path string, body interface{}) (map[string]interface{}, int, error)
Do builds an HTTP request from the base URL + path, JSON-encodes the body, executes via the Doer, and JSON-decodes the response. It returns the decoded JSON map, the HTTP status code, and any error.
Click to show internal directories.
Click to hide internal directories.