Documentation
¶
Overview ¶
Package client provides a base client implementation for interacting with EdgeCast CDN APIs. Configuration and authentication types are also provided.
Index ¶
- type Client
- func (c Client) BuildRequest(method, path string, body interface{}) (*retryablehttp.Request, error)
- func (c *Client) SendRequest(req *retryablehttp.Request, parsedResponse interface{}) (*http.Response, error)
- func (c *Client) SendRequestWithStringResponse(req *retryablehttp.Request) (*string, error)
- type ClientConfig
- type LiteralResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Config holds the configuration values for this client
Config ClientConfig
// Internal HTTP client
HTTPClient *retryablehttp.Client
}
Client is the primary means for services to interact with the EdgeCast API
func NewClient ¶
func NewClient(config ClientConfig) Client
Creates a new client pointing to EdgeCast APIs
func (Client) BuildRequest ¶
func (c Client) BuildRequest(method, path string, body interface{}) (*retryablehttp.Request, error)
BuildRequest creates a new Request for the Edgecast API, adding appropriate headers
func (*Client) SendRequest ¶
func (c *Client) SendRequest(req *retryablehttp.Request, parsedResponse interface{}) (*http.Response, error)
SendRequest sends an HTTP request and, if applicable, sets the response to parsedResponse
func (*Client) SendRequestWithStringResponse ¶
func (c *Client) SendRequestWithStringResponse(req *retryablehttp.Request) (*string, error)
SendRequest sends an HTTP request and, if applicable, sets the response to parsedResponse
type ClientConfig ¶
type ClientConfig struct {
// Generates Authorization Header values for HTTP requests
AuthProvider auth.AuthorizationProvider
// APIURL contains the base URL for the target API
BaseAPIURL url.URL
// The User Agent for outgoing HTTP requests
UserAgent string
Logger logging.Logger
}
ClientConfig provides configuration for the base client
type LiteralResponse ¶
type LiteralResponse struct {
Value interface{}
}
LiteralResponse is used for unmarshaling response data that is in an unrecognized format