Go client for Linode REST v4 API
$ go get -u github.com/chiefy/go-linode
** Note: currently pagination is not supported. The response list will return the first page of responses only **
Check API_SUPPORT.md for current support of the Linode v4
API endpoints.
Current in progress.
package main
import (
"fmt"
"log"
"os"
golinode "github.com/chiefy/go-linode"
)
func main() {
apiKey, ok := os.LookupEnv("LINODE_API_KEY")
if !ok {
log.Fatal("Could not find LINODE_API_KEY, please assert it is set.")
}
linodeClient, err := golinode.NewClient(apiKey)
if err != nil {
log.Fatal(err)
}
linodeClient.SetDebug(true)
res, err := linodeClient.GetInstance(4090913)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%v", res)
}
Join us at #go-linode
on the gophers slack