Documentation
¶
Index ¶
- func Delete[TResponse any](c *Client, url string, body any, contentType string) (TResponse, error)
- func DeleteJSON[TResponse any](c *Client, url string, body any) (TResponse, error)
- func Download(c *Client, url string, filePath string) (*resty.Response, error)
- func Get[TResponse any](c *Client, url string) (TResponse, error)
- func Post[TResponse any](c *Client, url string, body any, contentType string) (TResponse, error)
- func PostJSON[TResponse any](c *Client, url string, body any) (TResponse, error)
- func Put[TResponse any](c *Client, url string, body any, contentType string) (TResponse, error)
- func PutJSON[TResponse any](c *Client, url string, body any) (TResponse, error)
- func Request[TResponse any](c *Client, method string, url string, body any, contentType string) (TResponse, error)
- type Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Make a HTTP DELETE to the target URL with the specified body and unmarshal the response into the specified type. URL should start with a slash, e.g. "/v0/credentials/123/k8s"
func DeleteJSON ¶
Make a HTTP DELETE to the target URL with the specified body (with JSON as mimetype) and unmarshal the response into the specified type. URL should start with a slash, e.g. "/v0/credentials/123/k8s"
func Download ¶
Download a file from the specified URL to the specified file path. Note: The file gets created even if the request fails.
func Get ¶
Make a HTTP GET to the target URL and unmarshal the response into the specified type. URL should start with a slash, e.g. "/v0/credentials/123/k8s"
func Post ¶
Make a HTTP POST to the target URL with the specified body and unmarshal the response into the specified type. URL should start with a slash, e.g. "/v0/credentials/123/k8s"
func PostJSON ¶
Make a HTTP POST to the target URL with the specified body (with JSON as mimetype) and unmarshal the response into the specified type. URL should start with a slash, e.g. "/v0/credentials/123/k8s"
func Put ¶
Make a HTTP PUT to the target URL with the specified body and unmarshal the response into the specified type. URL should start with a slash, e.g. "/v0/credentials/123/k8s"
Types ¶
type Client ¶
type Client struct {
TokenSet *auth.TokenSet // Tokens to use to access the environment.
BaseURL string // Base URL of the target API (e.g. 'https://api.metaplay.io')
Resty *resty.Client // Resty client with authorization header configured.
}
Wrapper object for accessing an environment within a target stack.