Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) DecodeError(resp *http.Response, requestMethod string, consumeBody bool) error
- func (c *Client) DefaultAuth() error
- func (c *Client) ExecuteRequest(ctx context.Context, inputs RequestInput) (io.ReadCloser, error)
- func (c *Client) ExecuteRequestNoEncode(ctx context.Context, inputs RequestNoEncodeInput) (io.ReadCloser, http.Header, error)
- func (c *Client) ExecuteRequestRaw(ctx context.Context, inputs RequestInput) (*http.Response, error)
- func (c *Client) ExecuteRequestStorage(ctx context.Context, inputs RequestInput) (io.ReadCloser, http.Header, error)
- func (c *Client) ExecuteRequestTSG(ctx context.Context, inputs RequestInput) (io.ReadCloser, error)
- func (c *Client) ExecuteRequestURIParams(ctx context.Context, inputs RequestInput) (io.ReadCloser, error)
- func (c *Client) InsecureSkipTLSVerify()
- type RequestInput
- type RequestNoEncodeInput
Constants ¶
This section is empty.
Variables ¶
var ( ErrDefaultAuth = pkgerrors.New("default SSH agent authentication requires SDC_KEY_ID / TRITON_KEY_ID and SSH_AUTH_SOCK") ErrAccountName = pkgerrors.New("missing account name") ErrMissingURL = pkgerrors.New("missing API URL") InvalidTritonURL = "invalid format of Triton URL" InvalidMantaURL = "invalid format of Manta URL" InvalidServicesURL = "invalid format of Triton Service Groups URL" InvalidDCInURL = "invalid data center in URL" )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { HTTPClient *http.Client RequestHeader *http.Header Authorizers []authentication.Signer TritonURL url.URL MantaURL url.URL ServicesURL url.URL AccountName string Username string }
Client represents a connection to the Triton Compute or Object Storage APIs.
func New ¶
func New(tritonURL string, mantaURL string, accountName string, signers ...authentication.Signer) (*Client, error)
New is used to construct a Client in order to make API requests to the Triton API.
At least one signer must be provided - example signers include authentication.PrivateKeySigner and authentication.SSHAgentSigner.
func (*Client) DecodeError ¶
DecodeError decodes a backend Triton error into a more usable Go error type
func (*Client) DefaultAuth ¶
initDefaultAuth provides a default key signer for a client. This should only be used internally if the client has no other key signer for authenticating with Triton. We first look for both `SDC_KEY_ID` and `SSH_AUTH_SOCK` in the user's environ(7). If so we default to the SSH agent key signer.
func (*Client) ExecuteRequest ¶
func (c *Client) ExecuteRequest(ctx context.Context, inputs RequestInput) (io.ReadCloser, error)
func (*Client) ExecuteRequestNoEncode ¶
func (c *Client) ExecuteRequestNoEncode(ctx context.Context, inputs RequestNoEncodeInput) (io.ReadCloser, http.Header, error)
func (*Client) ExecuteRequestRaw ¶
func (*Client) ExecuteRequestStorage ¶
func (c *Client) ExecuteRequestStorage(ctx context.Context, inputs RequestInput) (io.ReadCloser, http.Header, error)
func (*Client) ExecuteRequestTSG ¶
func (c *Client) ExecuteRequestTSG(ctx context.Context, inputs RequestInput) (io.ReadCloser, error)
func (*Client) ExecuteRequestURIParams ¶
func (c *Client) ExecuteRequestURIParams(ctx context.Context, inputs RequestInput) (io.ReadCloser, error)
func (*Client) InsecureSkipTLSVerify ¶
func (c *Client) InsecureSkipTLSVerify()
InsecureSkipTLSVerify turns off TLS verification for the client connection. This allows connection to an endpoint with a certificate which was signed by a non- trusted CA, such as self-signed certificates. This can be useful when connecting to temporary Triton installations such as Triton Cloud-On-A-Laptop.