go-cloudatcost is a Go client library for accessing the cloudatcost API.
go-cloudatcost was heavily inspired by the go-github library.
Test Coverage: (gocov report)
API Version: v1
https://github.com/cloudatcost/api
$ go get github.com/masayukioguni/go-cloudatcost/cloudatcost
package main
import (
"fmt"
"github.com/masayukioguni/go-cloudatcost/cloudatcost"
"os"
)
func main() {
Login := os.Getenv("CLOUDATCOST_API_LOGIN")
Key := os.Getenv("CLOUDATCOST_API_KEY")
// Initializes a new CloudAtCost client
client, _ := cloudatcost.NewClient(&cloudatcost.Option{Login: Login, Key: Key})
listservers, hr, err := client.ServersService.List()
if err != nil {
fmt.Printf("error: %v\n\n", err)
return
}
if hr.StatusCode != 200 {
fmt.Printf("http response error: %+v %+v \n\n", hr, err)
return
}
fmt.Printf("%v,%v\n", listservers, err)
}