Documentation
¶
Index ¶
- func IsBadRequest(err error) bool
- func IsNotFound(err error) bool
- func IsServerError(err error) bool
- func IsUnauthorized(err error) bool
- type Client
- func (c *Client) Delete(ctx context.Context, path string) error
- func (c *Client) Get(ctx context.Context, path string, result interface{}) error
- func (c *Client) GetVersion(ctx context.Context) (string, error)
- func (c *Client) Patch(ctx context.Context, path string, body, result interface{}) error
- func (c *Client) Post(ctx context.Context, path string, body, result interface{}) error
- type Error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBadRequest ¶
IsBadRequest checks if the error is a 400 Bad Request error
func IsNotFound ¶
IsNotFound checks if the error is a 404 Not Found error
func IsServerError ¶
IsServerError checks if the error is a 5xx server error
func IsUnauthorized ¶
IsUnauthorized checks if the error is a 401 or 403 error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the HTTP client for Coolify API
func (*Client) GetVersion ¶
GetVersion fetches the API version
type Error ¶
Error represents an API error response
type Option ¶
type Option func(*Client)
Option configures the API client
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client
func WithRetries ¶
WithRetries sets the number of retries for failed requests
func WithTimeout ¶
WithTimeout sets the request timeout
Click to show internal directories.
Click to hide internal directories.