Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mre/edgecast
A golang client for the Edgecast API
https://github.com/mre/edgecast
api client edgecast wrapper
Last synced: 9 days ago
JSON representation
A golang client for the Edgecast API
- Host: GitHub
- URL: https://github.com/mre/edgecast
- Owner: mre
- License: mit
- Created: 2017-03-14T15:40:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T08:47:19.000Z (over 3 years ago)
- Last Synced: 2024-10-26T15:46:21.045Z (about 2 months ago)
- Topics: api, client, edgecast, wrapper
- Language: Go
- Size: 10.7 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# edgecast
[![Build Status](https://travis-ci.org/mre/edgecast.svg?branch=master)](https://travis-ci.org/mre/edgecast)
A golang client for the [Edgecast CDN API](https://www.programmableweb.com/api/edgecast-cdn).
## Installation
```go
// Go vendor experiment (recommended)
gvt fetch "github.com/mre/edgecast"// or globally (not recommended)
go get github.com/mre/edgecast
```## Usage:
```go
import github.com/mre/edgecastclient := edgecast.NewEdgecastClient("AccountID", "Token")
data, err := client.Bandwidth()// Example output:
// BandwidthData {
// Bps: 42.5,
// Platform: 2,
// }```
## Methods
```go
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:
```go
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
```