Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateRequestUrl(location string) string
- func (c *Client) GetTimeout() time.Duration
- func (c *Client) PerformDeleteRequest(url string) error
- func (c *Client) PerformGetRequest(url string) ([]byte, error)
- func (c *Client) PerformPostRequest(url string, requestBody []byte) ([]byte, error)
- func (c *Client) PerformPostRequestJsontoXMLFIXME(url string, requestBody []byte) ([]byte, error)
- func (c *Client) PerformPutRequest(url string, requestBody []byte) ([]byte, error)
- func (c *Client) PerformPutRequestXMLtoJsonFIXME(url string, requestBody []byte) ([]byte, error)
- func (c *Client) SetTimeout(timeout time.Duration)
- type Error
Constants ¶
const ( DEFAULT_API_VERSION = "1.3.0" DEFAULT_API_BASEURL = "https://api.upcloud.com" // The default timeout (in seconds) DEFAULT_TIMEOUT = 10 )
Constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an API client
func (*Client) CreateRequestUrl ¶
CreateRequestUrl creates and returns a complete request URL for the specified API location
func (*Client) GetTimeout ¶
GetTimeout returns current timeout
func (*Client) PerformDeleteRequest ¶
PerformDeleteRequest performs a DELETE request to the specified URL and returns the response body and eventual errors
func (*Client) PerformGetRequest ¶
PerformGetRequest performs a GET request to the specified URL and returns the response body and eventual errors
func (*Client) PerformPostRequest ¶
PerformPostRequest performs a POST request to the specified URL and returns the response body and eventual errors
func (*Client) PerformPostRequestJsontoXMLFIXME ¶
PerformPostRequest performs a POST request to the specified URL and returns the response body and eventual errors FIXME
func (*Client) PerformPutRequest ¶
PerformPutRequest performs a PUT request to the specified URL and returns the response body and eventual errors
func (*Client) PerformPutRequestXMLtoJsonFIXME ¶
PerformPutRequest performs a PUT request to the specified URL and returns the response body and eventual errors
func (*Client) SetTimeout ¶
SetTimeout sets the client timeout to the specified amount of seconds