Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Delete(ctx context.Context, apiPath string) ([]byte, int, string, error)
- func (c *Client) Get(ctx context.Context, apiPath string) ([]byte, int, string, error)
- func (c *Client) Post(ctx context.Context, apiPath string, body []byte) ([]byte, int, string, error)
- func (c *Client) Put(ctx context.Context, apiPath string, body []byte) ([]byte, int, string, error)
- type ClientError
- type ClientInterface
- type HTTPHeader
Constants ¶
View Source
const NoStatus = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(httpClient *http.Client, baseURL string, additionalHeader HTTPHeader) *Client
NewClient creates a new Client.
func NewDefaultClient ¶
NewDefaultClient creates a new Client with a default HTTP client set up
type ClientError ¶
type ClientError struct {
// contains filtered or unexported fields
}
func (*ClientError) Error ¶
func (e *ClientError) Error() string
type ClientInterface ¶
type ClientInterface interface { // Get performs an HTTP get request. Get(ctx context.Context, apiPath string) ([]byte, int, string, error) // Post performs an HTTP post request. Post(ctx context.Context, apiPath string, body []byte) ([]byte, int, string, error) // Put performs an HTTP put request. Put(ctx context.Context, apiPath string, body []byte) ([]byte, int, string, error) // Delete performs an HTTP delete request. Delete(ctx context.Context, apiPath string) ([]byte, int, string, error) }
type HTTPHeader ¶
func (HTTPHeader) Add ¶
func (h HTTPHeader) Add(key string, value string)
Click to show internal directories.
Click to hide internal directories.