Skip to content

mre/edgecast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edgecast

Build Status

A golang client for the Edgecast CDN API.

Installation

// Go vendor experiment (recommended)
gvt fetch "github.com/mre/edgecast"

// or globally (not recommended)
go get github.com/mre/edgecast

Usage:

import github.com/mre/edgecast

client := edgecast.NewEdgecastClient("AccountID", "Token")
data, err := client.Bandwidth()

// Example output:
// BandwidthData {
//    Bps:      42.5,
//    Platform: 2,
// }

Methods

client.Bandwidth()    // Return current bandwidth usage
client.Connections()  // Return number of active CDN connections
client.CacheStatus()  // Return cache hits and misses
client.StatusCodes()  // Return sum of HTTP status codes by category (404, 5xx,...)

Fluent interface

You can also set additional parameters using a fluent interface:

client := edgecast.NewEdgecastClient(config.AccountID, config.Token).
    SetRetries(3). // Setup HTTP request retries (e.g. for flaky connections)
    SetTimeout(5)  // Set request timeout per HTTP request (in seconds

About

A golang client for the Edgecast API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published