Skip to content

go-cloudatcost is a Go client library for accessing the cloudatcost

License

Notifications You must be signed in to change notification settings

masayukioguni/go-cloudatcost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-cloudatcost

go-cloudatcost is a Go client library for accessing the cloudatcost API.

go-cloudatcost was heavily inspired by the go-github library.

travis-ci: Build Status

drone.io: Build Status

Test Coverage: Coverage Status(gocov report)

GoDoc: GoDoc

API Version: v1

References

https://github.com/cloudatcost/api

Installation

$ go get github.com/masayukioguni/go-cloudatcost/cloudatcost

Example

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)

}

About

go-cloudatcost is a Go client library for accessing the cloudatcost

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published