Skip to content

linode/linodego

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-linode

Go client for Linode REST v4 API

Installation

$ go get -u github.com/chiefy/go-linode

API Support

** 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.

Documentation

Current in progress.

Example

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)

}

License

MIT License