This project is NOT MAINTAINED. I'd recommend using DigitalOcean's official API instead.
DigitalOcean Go Client V2 API.
$ go get github.com/domluna/dogo
package main
import (
"github.com/domluna/dogo"
)
func main() {
// If the token is the empty string("") then it'll attempt
// to fill the value under env var $DIGITALOCEAN_TOKEN
client := dogo.NewClient("") // $DIGITALOCEAN_TOKEN
// get all droplets
droplets, err := client.ListDroplets()
if err != nil {
// deal with error
}
// do stuff with droplets
}