Documentation
¶
Index ¶
- Constants
- type BandwidthData
- type CacheStatusData
- type ConnectionData
- type Edgecast
- func (e Edgecast) Bandwidth(platform int) (*BandwidthData, error)
- func (e Edgecast) CacheStatus(platform int) (*CacheStatusData, error)
- func (e Edgecast) Connections(platform int) (*ConnectionData, error)
- func (e *Edgecast) SetRetries(retries int) *Edgecast
- func (e *Edgecast) SetTimeout(timeout int) *Edgecast
- func (e Edgecast) StatusCodes(platform int) (*StatusCodeData, error)
- type RawEdgecastResult
- type StatusCodeData
Constants ¶
const ( // APIEndpoint holds the Edgecast API endpoint URL // Meaning of the wildcards: // AccountID // Platform (see below) // Method endpoint (see Metric* below) APIEndpoint = "https://api.edgecast.com/v2/realtimestats/customers/%s/media/%d/%s" // DefaultRequestRetries defines the default number of http requests before giving up DefaultRequestRetries = 1 // DefaultRequestTimeout defines the default request timeout in seconds DefaultRequestTimeout = 5 // MethodBandwidth is the endpoint for Edgecast bandwidth MethodBandwidth = "bandwidth" // MethodConnections is the endpoint for Edgecast connections MethodConnections = "connections" // MethodCachestatus is the endpoint for the Edgecast cache status MethodCachestatus = "cachestatus" // MethodStatuscodes is the endpoint for the Edgecast status codes MethodStatuscodes = "statuscode" )
const ( MediaTypeFlash = 2 MediaTypeLarge = 3 MediaTypeSmall = 8 MediaTypeADN = 14 )
Media types (also known as "platform") Specify, which Edgecast platforms to monitor. They are identified by an integer value and passed to the API url. The following types are available: flash, http_large, http_small, adn
Unfortunately the stats aren't more fine grained than this. If you have more than one 'service' using the platform(s), you'll get them added together.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BandwidthData ¶
BandwidthData holds that data of a request to the edgecast bandwidth API
type CacheStatusData ¶
type CacheStatusData []struct {
CacheStatus string `json:"CacheStatus"`
Connections int64 `json:"Connections"`
}
CacheStatusData represends all fields returned from a request to the /cachestatus endpoint
type ConnectionData ¶
ConnectionData holds that data of a request to the edgecast connections API
type Edgecast ¶
Edgecast client for Go
func NewEdgecastClient ¶
NewEdgecastClient creates a new Edgecast client
func (Edgecast) Bandwidth ¶
func (e Edgecast) Bandwidth(platform int) (*BandwidthData, error)
Bandwidth returns the current bandwidth usage
func (Edgecast) CacheStatus ¶
func (e Edgecast) CacheStatus(platform int) (*CacheStatusData, error)
CacheStatus returns the current cache status usage
func (Edgecast) Connections ¶
func (e Edgecast) Connections(platform int) (*ConnectionData, error)
Connections returns the current bandwidth usage
func (*Edgecast) SetRetries ¶
SetRetries sets the number of consecutive query replies until giving up
func (*Edgecast) SetTimeout ¶
SetTimeout sets the request timeout
func (Edgecast) StatusCodes ¶
func (e Edgecast) StatusCodes(platform int) (*StatusCodeData, error)
StatusCodes returns the current HTTP status codes
type RawEdgecastResult ¶
type RawEdgecastResult struct {
Result float64
}
RawEdgecastResult represends a raw JSON response object from the API
type StatusCodeData ¶
type StatusCodeData []struct {
Connections int64 `json:"Connections"`
StatusCode string `json:"StatusCode"`
}
StatusCodeData represends all fields returned from a request to the /statuscode endpoint