Documentation
¶
Overview ¶
Package client provides the HTTP client for the deploybase API.
Index ¶
- func WithToken(ctx context.Context, token string) context.Context
- type APIClient
- func (c *APIClient) Delete(ctx context.Context, path string) *errors.APIError
- func (c *APIClient) Get(ctx context.Context, path string, params url.Values, out any) *errors.APIError
- func (c *APIClient) GetRaw(ctx context.Context, path string, params url.Values) (json.RawMessage, *errors.APIError)
- func (c *APIClient) PatchRaw(ctx context.Context, path string, body any) (json.RawMessage, *errors.APIError)
- func (c *APIClient) PostRaw(ctx context.Context, path string, body any) (json.RawMessage, *errors.APIError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient is a thin HTTP client for the deploybase REST API.
func NewAPIClient ¶
NewAPIClient creates a configured API client.
func (*APIClient) Delete ¶
Delete performs a DELETE request. Returns nil on success (204 No Content).
func (*APIClient) Get ¶
func (c *APIClient) Get(ctx context.Context, path string, params url.Values, out any) *errors.APIError
Get performs a GET request and unmarshals the "data" field into out. Returns *APIError on non-2xx responses.
func (*APIClient) GetRaw ¶
func (c *APIClient) GetRaw(ctx context.Context, path string, params url.Values) (json.RawMessage, *errors.APIError)
GetRaw performs a GET and returns the raw "data" JSON bytes.
Click to show internal directories.
Click to hide internal directories.