Skip to content

Go SDK

Idiomatic Go client with signed requests.

Latest releasev1.9.0pkg.go.dev

Agent setup

Install

Terminal

go get github.com/ovh/go-ovh/ovh

First call

Instantiate an OVH client and get the firstname of the currently logged-in user.

Go
package main import ( "fmt" "github.com/ovh/go-ovh/ovh") // PartialMe holds the first name of the currently logged-in user.// Visit https://api.ovh.com/console/#/me#GET for the full definitiontype PartialMe struct { Firstname string `json:"firstname"`} // Instantiate an OVH client and get the firstname of the currently logged-in user.// Visit https://api.ovh.com/createToken/?GET=/me to get your credentials.func main() { var me PartialMe client, err := ovh.NewClient( "ovh-eu", YOUR_APPLICATION_KEY, YOUR_APPLICATION_SECRET, YOUR_CONSUMER_KEY, ) if err != nil { fmt.Printf("Error: %q\n", err) return } err = client.Get("/me", &me) if err != nil { fmt.Printf("Error: %q\n", err) return } fmt.Printf("Welcome %s!\n", me.Firstname)}

Quoted from go-ovh's README.

NextNode.js SDK →