https://github.com/dottorblaster/cloudatgost
CloudAtCost API wrapper written in Go
https://github.com/dottorblaster/cloudatgost
api cloudatcost go
Last synced: over 1 year ago
JSON representation
CloudAtCost API wrapper written in Go
- Host: GitHub
- URL: https://github.com/dottorblaster/cloudatgost
- Owner: dottorblaster
- License: mit
- Created: 2015-03-09T11:17:04.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-04-12T15:25:41.000Z (about 10 years ago)
- Last Synced: 2024-10-18T06:03:33.112Z (over 1 year ago)
- Topics: api, cloudatcost, go
- Language: Go
- Size: 28.3 KB
- Stars: 15
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cloudatGOst [](https://godoc.org/github.com/dottorblaster/cloudatgost) [](https://travis-ci.org/dottorblaster/cloudatgost)
CloudAtCost API wrapper written in Go.
API Version: `v1`
## References
https://github.com/cloudatcost/api
## Installation
```bash
$ go get github.com/dottorblaster/cloudatgost
```
## Example
To interact with the CaC API you simply need to initialize a new client, passing to it your API key and your login.
```go
package main
import (
"github.com/dottorblaster/cloudatgost"
)
func main() {
// Initializes a new CloudAtCost client
client := cloudatgost.NewClient("johndoe@example.com", "myApiKey", nil)
// d is defined as a TemplateList, a type that maps the JSON
// response of the listtemplates.php endpoint
first := client.ListTemplates()
// c is defined as a ServerList, a type that maps the JSON
// response of the listservers.php endpoint
second := client.ListServers()
// e is defined as a CacConsole, a type that maps the JSON
// response of the console.php endpoint. You need to provide
// to it a string containing the server ID.
third := client.Console("254484472")
}
```
## License
cloudatGOst is licensed under MIT License. (See LICENSE)
## TODO
- Refactoring to make all of this stuff more readable